0

Hi I am getting lots of compiler errors and I have no clue what they mean. I am also using an old g++ compiler 3.4.6. I am trying to use tclap library. I have checked all the tclap source and headers files, none of them contain extern keyword.

   #include <string>
   #include <vector>
   #include <iostream>
   #include <algorithm>
   #include <tclap/CmdLine.h>
   int main(int argc, char** argv)
   {
   }   

g++ test_app.cpp -c
In file included from /system/gnu_library/lib/gcc/i686-stratus-vos/3.4.6/../../../../include/c++/3.4.6/list:66,
                 from /USERS/Dev/TumeloQ/c++/tclap/Arg.h:37,
                 from /USERS/Dev/TumeloQ/c++/tclap/SwitchArg.h:33,
                 from /USERS/Dev/TumeloQ/c++/tclap/CmdLine.h:27,
                 from test_app.cpp:6:
/system/gnu_library/lib/gcc/i686-stratus-vos/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h:40: error: previous declaration
+of `void std::__throw_bad_exception()' with C++ linkage


In file included from /USERS/Dev/TumeloQ/c++/tclap/Arg.h:58,
                 from /USERS/Dev/TumeloQ/c++/tclap/SwitchArg.h:33,
                 from /USERS/Dev/TumeloQ/c++/tclap/CmdLine.h:27,
                 from test_app.cpp:6:
/USERS/Dev/TumeloQ/c++/tclap/ArgTraits.h:79: error: template with C linkage
Tumelo
  • 57
  • 6
  • 2
    Your code is incorrectly formatted. Is that all of your code? This is probably caused by you linking with a C library (presumably tclap might be a C library). In that case you should specify to the compiler that the header is a C header, so it doesn't get confused. Check out [this](http://stackoverflow.com/questions/1041866/in-c-source-what-is-the-effect-of-extern-c). – tambre Dec 07 '16 at 19:34
  • Possible duplicate of [In C++ source, what is the effect of extern "C"?](http://stackoverflow.com/questions/1041866/in-c-source-what-is-the-effect-of-extern-c) – tambre Dec 07 '16 at 19:34

0 Answers0