![]() |
|
#1
|
|||
|
|||
error template with C linkageI am trying to build a project at the moment. However, I currently get a mass of "error template with C linkage" errors. They all relate to GNU ISO C++ library.
The project built perfectly then this suddenly started. Does anyone have any suggestions? Thanks, Michael. Running under FC4. |
|||
|
#2
|
|||
|
|||
Re: error template with C linkageAre you compiling your project as a C++ project?
|
|
#3
|
|||
|
|||
Re: error template with C linkageHi
Yes, I am sure that it is compiling in C++. The full list of messages is attached. Most of the problems seem to be with the standard libraries. This all compiled and linked perfectly a few days ago with the same include files (apart from <vector>, I think), although <map> was included. Foolishly I do not have an earlier version to revert to! Anyway, the fulll build output is as follows: Code:
Thanks, Michael. |
|
#4
|
|||
|
|||
Re: error template with C linkageQuote:
The error messages are a symptom of what I call a 'dangling extern "C"' If some header that is #included before <map> or <vector> has an "extern "C" statement that is not associated with a function, you might see these messages. The things that come to mind are: 1. You have a local header file that is improperly formed. (Have you made any changes to your project header files? Are any of them #included before <map> or <vector> or any other standard library headers?) 2. One of the standard library header files (or other header files that are included before <map> or <vector>) has become corrupted. This is unlikely unless you have been poking around in some compiler/library directories while logged in as root. And I just know that you haven't done that. Have you done any compiler updates since you started? (yum update or rpm -U or whatever) If so, then maybe you can revert to a previous version and test again. An example of the dangling extern "C" CPP / C++ / C Code:
CPP / C++ / C Code:
Output: Code:
Note that stl_tree.h is the same for your 64-bit gcc as it is for my 32-bit gcc. Note that if I put the #include "oops.h" after #include <map> the errors don't occur. (Maybe a hint for you to track down the dirty dog that is causing the problem.) Regards, Dave Last edited by davekw7x : 17-May-2006 at 10:25.
|
|
#5
|
|||
|
|||
Re: error template with C linkagedavekw7x - thank you very much for that. It was where I was heading - checking header files etc.
The offending file appears to be param.h, although I cannot see what is wrong wtih it... is putting the #include inside the extern "C" section the problem? CPP / C++ / C Code:
Thanks, Michael. |
|
#6
|
|||
|
|||
Re: error template with C linkageAnswered my own question - all working fine now - thanks.
|
|
#7
|
|||
|
|||
Re: error template with C linkageQuote:
For others who might be interested: look in any standard header file where code may be used in C as well as C++ programs, for example <ctype.h> CPP / C++ / C Code:
Now if you have anything else that has (or includes) C++ function prototypes in the first #ifdef block, the extern "C" is dangling. (Pretend you are the C preprocessor and see what it gives you and compare with my simple "oops" example.) Regards, Dave |
Recent GIDBlog
Review: Gel laptop cooling pad by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The