LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 01-13-2010, 09:25 AM   #1
Gracy
LQ Newbie
 
Registered: Nov 2005
Posts: 4

Rep: Reputation: 0
C++ linkage errors


I am porting a code which ran on HP unix to CentOS. It was a working code and compiled with gcc3.1.x and a c++ file and now I tried to compile with gcc3-3.4.6 and gcc4-4.2.4 also. But still I get this conflicts in declaration error as pasted below.

In file included from ../../../lol/ntk/nt_kslog.h:155,
from ../../../lol/ntk/nt_kernel.h:243,
from ../../../lol/ntk/nt_cp.h:110,
from ../../../soml/include/soml-afi-afu.h:131,
from ../../include/pcdb.h:58,
from ../../include/pcdb_addtypes.h:59,
from pcdb_addtypes.cc:94:

/opt/bcs/include/syslog.h:93: error: previous declaration of 'void syslog(int, const char*, ...)' with 'C++' linkage
/opt/bcs/include/syslog.h:93: error: conflicts with new declaration with 'C' linkage

I have the extern "C" included like this . But still I face the same problem . What Am I missing ??

#ifdef __cplusplus
extern "C" {
#endif

#include <syslog.h>
#include <stdarg.h>

#ifdef __cplusplus
}
#endif

Also , I work on Centos 5 box and it compiled without any issues on one machine and the same throws this error on other box with centos and both compilers.

Could anyone please help me , Where Am I going wrong ?
 
Old 01-13-2010, 09:41 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Don't post the same question in two different areas.
The other one was probably the better place for your question
http://www.linuxquestions.org/questi...inkage-781964/
 
  


Reply



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
[SOLVED] Library linkage using ld 1rDirEctoALgran0 Programming 8 08-20-2009 04:33 PM
Regarding the linkage of timer library eshwar_ind Programming 4 11-14-2005 03:17 AM
How does C libraries linkage work? Nerox Programming 4 12-25-2004 10:36 PM
GTK+2.5.0 and Pango 1.4.1 linkage problems.... SyBEX Linux - Software 10 10-29-2004 01:09 PM
Linkage Error with Libraries coming as Debian packages stackoverflow32 Linux - Software 0 08-05-2004 04:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:07 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
Open Source Consulting | Domain Registration