2014-10-01 01:37 PM
hi every body
in a cpp file i include a header file and want to use header file's functions inside class but it shows a error: lib1.h class class_x{ public: calss_x(); private: }--- lib1.cpp &sharpinclude ''lib1.h'' &sharpinclude ''header1.h'' class_x::class_X() { function_of_header1.h(); }error shows undefine symbol function_of_header1.h()whas matter?WBR #cpp #class2014-10-02 01:46 AM
Hi
''error shows undefine symbol function_of_header1.h() whas matter?'' Have you applied the ''extern c'' to the header?http://stackoverflow.com/questions/1041866/in-c-source-what-is-the-effect-of-extern-c
The same thing needs to be done for C++ code to access C code.