LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-27-2005, 03:44 PM   #1
snecklifter
Member
 
Registered: Mar 2004
Location: UK/West Yorkshire/Huddersfield
Distribution: Fedora 7
Posts: 982

Rep: Reputation: 30
conflicting types error in parser.c


Hi folks,

I'm not much of a C programmer - I'm just trying to get this puppy to compile. I'm not sure of the error and have run through everything on the site here but no dice. Any suggestions greatly appreciated. Its a network simulator, required libelf and the usual stuff to install but Fedora had it already installed. Many thanks to anyone who checks this out.

[chris@MtemiTux cnet-2.0.9]$ make
(cd src && make)
make[1]: Entering directory `/home/chris/cnet-2.0.9/src'
Linux 2.6.10-1.766_FC3.stk16
make[2]: Entering directory `/home/chris/cnet-2.0.9/src'
gcc -ansi -O -Wall -fPIC -Ilibelf -I/usr/X11R6/include -c parser.c
parser.c: In function `node_defn':
parser.c:423: error: conflicting types for '__CN062'
parser.c:227: error: previous declaration of '__CN062' was here
make[2]: *** [parser.o] Error 1
make[2]: Leaving directory `/home/chris/cnet-2.0.9/src'
make[1]: *** [it] Error 2
make[1]: Leaving directory `/home/chris/cnet-2.0.9/src'
make: *** [it] Error 2
[chris@MtemiTux cnet-2.0.9]$

Cheers
Chris
 
Old 02-27-2005, 03:49 PM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 58
Can you copy and paste the definition of __CN062 from lines 227 and 423 of parser.c?
 
Old 02-27-2005, 03:54 PM   #3
snecklifter
Member
 
Registered: Mar 2004
Location: UK/West Yorkshire/Huddersfield
Distribution: Fedora 7
Posts: 982

Original Poster
Rep: Reputation: 30
Love to.

Line 227: extern void init_reboot_args(NODEATTR *na, int argc, char **argv);

Line 423: extern void init_reboot_args(int n, int argc, char **argv);

Cheers,
Chris
 
Old 02-27-2005, 04:17 PM   #4
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 58
Well, it definitely looks like the definitions conflict. There's probably #if/#endif's surrounding one or the other definition. There should be a way to make the compiler only use 1 of them. Either through a compile option or changing a makefile or something.
 
Old 03-26-2005, 11:51 AM   #5
sanatox
LQ Newbie
 
Registered: Mar 2005
Posts: 3

Rep: Reputation: 0
well, i have the same problem. Im trying to install cnet on my fedora but i got the same error. i tried to comment the second definition and it seems to work. but dont. the cnet compiler doesnt work later. any suggestion about the Makefile??

Chau.
 
Old 04-08-2005, 03:06 PM   #6
funezto
LQ Newbie
 
Registered: Apr 2005
Posts: 1

Rep: Reputation: 0
Well, after some checks, I have the solution.

Change in line 423 the first parameter to 'NODEATTR *na'

Old line 423: extern void init_reboot_args(int n, int argc, char **argv);
New line 423: extern void init_reboot_args(NODEATTR *na, int argc, char **argv);

So its the same as line 227.

Then, there is another problem with CNET_exit, so you should change file 'src/exit.c' in line 27:

void CNET_exit(char *filenm, char *function, int lineno)

to

void CNET_exit(const char *filenm, const char *function, int lineno)

then make. It worked fine for me.

Felipe.
 
Old 04-08-2005, 06:59 PM   #7
snecklifter
Member
 
Registered: Mar 2004
Location: UK/West Yorkshire/Huddersfield
Distribution: Fedora 7
Posts: 982

Original Poster
Rep: Reputation: 30
Cheers felipe, much appreciated. This has sorted a long standing problem for me. Wish I knew more C. Affero left.

Just to add you also need to change the line in cnet.h to match the changes in exit.c

Last edited by snecklifter; 04-08-2005 at 07:23 PM.
 
  


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
checking for XML::Parser... configure: error: XML::Parser perl module is required for kornerr Linux - General 11 11-16-2008 07:24 AM
error: conflicting types for `IPPROTO_IP' Anastasia Linux - Software 0 07-14-2005 06:12 AM
opengl error... conflicting with ethernet?? LinToWinWin Linux - Software 4 05-17-2005 03:02 AM
RPM Conflicting Package Error kougar Linux - Newbie 1 09-01-2004 08:21 PM
warning "conflicting types for buit-in function" while cross-compiling cheema Programming 0 07-07-2004 03:02 AM


All times are GMT -5. The time now is 07:27 AM.

Main Menu
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