HEADER FILES

i created a header file for class, it contains add() function save it as a abc.h.i created abc.cpp file which contains a defination of add function.if i include this abc.h header file in another program,why it is showing add function as a undefined reference..

plz reply soon.......
The function is compiled and exists in the first program/library. When you include abc.h in another program, that tells the compiler that you have a definition somewhere and it will be resolved at link time. But you don't tell the linker where to find it.

This means that the first unit should be a library, and the second unit a might be a program that uses that library.

Here's an example that uses a shared library.
http://www.cplusplus.com/forum/unices/63207/
Topic archived. No new replies allowed.