static library and link errors - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


static library and link errors

Hi Guys

I was doing the porting of my C++ app to linux, when the next error happened. I'm using the Code::Blocks IDE for manage my project.
For ex:
I have one executable project(console application) that uses two static libraries(they contain all application logic).
I have compiled all projects without errors. But i have a problems when linker is working.

for ex, i receive the next error message on linking:
/home/user/projects/logicstor/lib/uDebug/libclient.a(logic_client.o): In function `logic_client::upload_file_action()':
/home/user/projects/logicstor/client/logic_client.cpp:43: undefined reference to `logic::files_storage::files_storage(std::basic_string, std::allocator > const&, logic::files_storage::en_file_storage_type)'
It means that linker couldn't find definition of function "logic::files_storage::files_storage"(in contains in my second library libcommon.a) while it is linking the libclient.a (my first libtary)

i whant to show th? part of code that makes definition and declaration of the "logic::files_storage::files_storage" in libcommon.a:
namespace logic
class files_storage
enum en_file_storage_type { EN_CLIENT_FILE_STORAGE, EN_SERVER_FILE_STORAGE };

files_storage(const std::wstring& root_storage_path, en_file_storage_type type);


namespace logic
files_storage::files_storage(const std::wstring& root_storage_path, files_storage::en_file_storage_type type)

I have checked my libcommon.a with nm tool, it says that the library exports this function

I don't know what to do, Please help me guys!!!
Sign In or Register to comment.