문제

I'm trying to compile an extension library for CppUnit.

But it gives me the following error while linking:

DatabaseAssert.cp:(.text+0x782): undefined reference to 'CppUnit::DatabaseAssert::getDBConnection(DBAdapter*)'

The included header file has the definition :

static oracle::occi::Connection* getDBConnection(DBAdapter *dbAdapter);

Any clues why I am still getting the undefined reference error?

도움이 되었습니까?

해결책

What you have in the header is the function declaration, not its definition.
The linker is complaining because it cannot find the definition of the function which is probably in the library file which you did not link.

Link the library to your project.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top