Mail Archives: djgpp/2000/03/06/05:54:37
On Mon, 6 Mar 2000, caramaith wrote:
> I get this when just doing the normal
>
> gcc -o CppLibTest.exe CppLibTest.cpp
This is wrong. Try this:
gcc -o CppLibTest.exe CppLibTest.cpp CppLib.o
You *must* submit all the relevant source/object files to GCC,
otherwise how do you expect the linker to find code you put into
CppLib.cpp?
> He said I had to state every source file... even the
> CppLib.cpp (which is the object-file to CppLib.h, the header-file
> naturally enclosed in CppLibTest.cpp).
The header files doesn't include anything except the text that you see
inside that header file. It does NOT magically pull in the code of
CppLib.cpp, because that's a different file.
> Is this really the case???
Yes, that's the case.
- Raw text -