![]() |
| | #1 |
| Registered User Join Date: May 2006 Location: Berkshire, UK
Posts: 29
| error: template with C linkage I am trying to build a project at the moment. However, I currently get a mass of "error template with C linkage" errors. They appear to relate to the GNU ISO C++ library. 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: Building the whole Project: mrmCalcEngine ... make make all-recursive make[1]: Entering directory `/home/miker/Projects/mrmCalcEngine' Making all in include make[2]: Entering directory `/home/miker/Projects/mrmCalcEngine/include' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/miker/Projects/mrmCalcEngine/include' Making all in src make[2]: Entering directory `/home/miker/Projects/mrmCalcEngine/src' if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/mysql++ -I/home/miker/Projects/mrmCalcEngine/include -I/usr/local/mysql/include/mysql -Wall -g -g -O2 -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.cc; \ then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi/usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:131: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:142: error: declaration of C function ‘const std::_Rb_tree_node_base* std::_Rb_tree_increment(const std::_Rb_tree_node_base*)’ conflicts with /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:139: error: previous declaration ‘std::_Rb_tree_node_base* std::_Rb_tree_increment(std::_Rb_tree_node_base*)’ here /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:148: error: declaration of C function ‘const std::_Rb_tree_node_base* std::_Rb_tree_decrement(const std::_Rb_tree_node_base*)’ conflicts with /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:145: error: previous declaration ‘std::_Rb_tree_node_base* std::_Rb_tree_decrement(std::_Rb_tree_node_base*)’ here /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:150: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:219: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:293: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:299: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:324: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:707: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:717: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:727: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:734: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:741: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:748: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:755: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:762: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:784: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:802: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:819: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:864: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:891: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:948: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1002: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1013: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1024: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1038: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1050: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1086: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1102: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1115: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1125: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1146: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1168: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1179: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1197: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1215: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1233: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1251: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1261: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_tree.h:1276: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_map.h:89: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_map.h:636: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_map.h:653: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_map.h:660: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_map.h:667: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_map.h:674: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_map.h:681: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_map.h:688: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:70: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:75: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:80: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:106: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:618: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:635: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:642: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:649: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:656: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:663: error: template with C linkage /usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../../../include/c++/4.0.2/bits/stl_multimap.h:670: error: template with C linkage make[2]: *** [main.o] Error 1 make[2]: Leaving directory `/home/miker/Projects/mrmCalcEngine/src' make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 make[1]: Leaving directory `/home/miker/Projects/mrmCalcEngine' Completed ... unsuccessful Total time taken: 1 secs Michael. |
| michaels-r is offline | |
| | #2 | |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 10,365
| Could it have something to do with extern "C" ? I am just speculating here, but maybe you used extern "C" around some template code, and since templates presumably require name mangling, the compiler/linker started complaining. Quote:
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way | |
| laserlight is online now | |
| | #3 |
| Registered User Join Date: May 2006 Location: Berkshire, UK
Posts: 29
| Thanks laserlight - that was my initial thought but it does not appear to do anything... However, I have sorted the problem out by getting #include <map> out of my main.cc file... I really don't know why this should make any difference! Must be something to do with templates. As for version control, I did not really think of this as a new version, I had just added a few functions, without any changes of significance (so I thought), just a couple of added include files! Being in the middle of a serious bad hair day, this has thrown up another, very odd problem... which I have put in a new thread! |
| michaels-r is offline | |
| | #4 | |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 10,365
| Quote:
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way | |
| laserlight is online now | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linkage question | DL1 | C++ Programming | 6 | 01-13-2009 07:56 PM |
| internal/external linkage | MarkZWEERS | C++ Programming | 1 | 07-29-2008 03:34 AM |
| Quantum Random Bit Generator | shawnt | C++ Programming | 62 | 06-18-2008 10:17 AM |
| We Got _DEBUG Errors | Tonto | Windows Programming | 5 | 12-22-2006 05:45 PM |
| Errors with including winsock 2 lib | gamingdl'er | C++ Programming | 3 | 12-05-2005 08:13 PM |