Mail Archives: djgpp/1998/02/05/22:17:42
Pat wrote in message <34DA3361 DOT EBDD575 AT megsinet DOT net>...
>Hello, could someone please tell me why djgpp won't compile this code?
Cockpit Error.
>I downloaded the c++ libraries again and the c++ executable and made
>sure to end my file with *.cpp.
Actually, its probably wiser to use *.cc instead of *.cpp
> Also, I checked the faq but I couldn't
>find anything about this.
Did you really? Its pretty easy in the section about compile and link
errors under undefined externs.
8.7 Unresolved externals when linking programs
==============================================
**Q*: Why do I get so many unresolved symbols when linking my programs?*
*A* : By default, GCC instructs the linker to only look in two libraries:
`libgcc.a' and `libc.a.' Some functions aren't included there, so the
linker
can't find them. If you need to link against some optional library, say
`libxy.a', put the library into the DJGPP `lib/' subdirectory and append a
`-lxy' to the link command line. To use C++ classes in the `libgpp.a' (it's
called `libg++.a' on Unix systems), append `-lgpp.' The Standard C++
Template classes are in `libstdcx.a' (it's called `libstdc++.a' on Unix);
append `-lstdcxx.'
When linking C++ programs, you can use the `gxx' command instead of `gcc';
it
will then instruct the linker to also scan the C++ libraries automatically,
so you don't have to remember doing that yourself.
- Raw text -