LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 11-14-2007, 03:05 AM   #1
-Pb-
LQ Newbie
 
Registered: Aug 2007
Location: Moscow
Distribution: Slackware 12
Posts: 22

Rep: Reputation: 15
'incompatible implicit declaration' errors when compiling


I'm trying to install my ISP's billing program in Slackware 12. I've downloaded the tar.gz package, unpacked it, and when I ran _compile.sh as stated in the installation instructions I get the following:

bash-3.1# ./_compile.sh
login.hnt.c: In function 'main':
login.hnt.c:25: warning: incompatible implicit declaration of built-in function 'printf'
login.hnt.c:26: warning: incompatible implicit declaration of built-in function 'exit'
login.hnt.c:38: warning: incompatible implicit declaration of built-in function 'bzero'
login.hnt.c:44: warning: incompatible implicit declaration of built-in function 'printf'
login.hnt.c:69: warning: incompatible implicit declaration of built-in function 'printf'
login.hnt.c: In function 'md5':
login.hnt.c:109: warning: incompatible implicit declaration of built-in function 'strlen'
md5.c: In function 'md5_process':
md5.c:168: warning: incompatible implicit declaration of built-in function 'memcpy'
md5.c: In function 'md5_append':
md5.c:342: warning: incompatible implicit declaration of built-in function 'memcpy'
md5.c:356: warning: incompatible implicit declaration of built-in function 'memcpy'

I did a bit of googling and one of the possible reasons seems to be the lack of ncurses libraries on my system. I installed ncurses-5.6-i486-2. Still no go. What am I missing?
 
Old 11-14-2007, 05:20 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
I doubt very much that this has to do with ncurses.

Start with checking the logo.hnt.c file and see if stdio.h, stdlib.h, strings.h and string.h are included in the beginning of the file (or at least before lines 25, 26, 38 and 109 respectively).

Same for md5.c (only string.h required).

PS Those are only warnings, so you should end up with an executable anyway.
 
Old 11-14-2007, 05:40 AM   #3
-Pb-
LQ Newbie
 
Registered: Aug 2007
Location: Moscow
Distribution: Slackware 12
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Wim Sturkenboom View Post
I doubt very much that this has to do with ncurses.

Start with checking the logo.hnt.c file and see if stdio.h, stdlib.h, strings.h and string.h are included in the beginning of the file (or at least before lines 25, 26, 38 and 109 respectively).

Same for md5.c (only string.h required).

PS Those are only warnings, so you should end up with an executable anyway.
Thanks for your reply. You're right, the program is up and runnung. I checked login.hnt.c and there're no mention of stdio.h, stdlib.h, strings.h or string.h.
In fact I managed to install it flawlessly when I did so in a virtual machine. Now, I have Slack on my desktop, I did a custom installation and might have omitted some important packages...
 
Old 11-14-2007, 08:14 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
If you did a full slackware12 install, the compiler stuff should be available.

The include files can be included through another include file. Is there any #include in those files?
 
Old 11-15-2007, 05:59 AM   #5
-Pb-
LQ Newbie
 
Registered: Aug 2007
Location: Moscow
Distribution: Slackware 12
Posts: 22

Original Poster
Rep: Reputation: 15
The problem is I did a custom install. Perhaps, not the best thing for a newbie

Yes, there´re strings beginning with #include. Sorry, I'm new to Linux and have no idea of programming, I don't understand what these strings mean and how include files can be included through other include files.
 
Old 11-15-2007, 06:50 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
If an include file contains other includes, those files will be included as well.

So your c file might include mystuff.h and mystuff.h might include stdio.h etc
Code:
/* c-file *
#include "mystuff.h"
...
...
Code:
/* mystuff.h */
#include <stdio.h>
...
...
 
Old 11-18-2010, 01:39 AM   #7
PAix
Member
 
Registered: Jul 2007
Location: United Kingdom, W Mids
Distribution: SUSE 11.0 as of Nov 2008
Posts: 195

Rep: Reputation: 40
The exit and bzero warnings are cured by
#include <stdlib.h>
The strlen warnings are cured by
#include <string.h>
I believe that memcpy is also cured by the same header file.

I also believe that printf warnings are cured by:
#include <stdio.h>
The man pages for the functions (strlen, bzero etc.) indicate which header library the functions appear in.

I hope that this has clarified the good advice given previously.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
warning: implicit declaration of function liguorir Linux - Software 5 10-22-2012 04:20 PM
Implicit declaration means alaios Programming 7 03-09-2009 07:20 AM
warning: incompatible implicit declaration of built-in function ‘exit’ xzotech Programming 1 08-14-2005 06:43 AM
implicit declaration of function 'getdelim' MicahCarrick Programming 2 05-02-2005 12:03 PM
gcc 3.4.1 and c implicit declaration foo_bar_foo Programming 1 01-27-2005 05:49 PM


All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration