Re: linking problem - "undefined reference to ..."

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brian,

>#ifdef __cplusplus
>extern "C" {
>#endif
>
>and near the end:
>
>#ifdef __cplusplus
>}
>#endif
>
>The preprocessor symbol __cplusplus is defined when the file is being
>compiled as C++, and is used to wrap all the declarations with a large
>"extern "C" { ... }".  The reason for the #ifdef is that so it remains a
>valid C file as well.

I wrapped the header file's declarations with "extern "C" { ... }" and it worked!  Thank you very much.

>That or:
>
>mv fig6.cpp fig6.c
>gcc -o fig6 fig6.c -L. -ltsil

I tried this first but got the same error message...

Thanks again for all your help.  I'm now using the software application!

Chris Bouchard

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux