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:
1 2
|
/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<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > 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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
files_storage.h
namespace logic
{
class files_storage
{
public:
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);
~files_storage();
...
files_storage.cpp
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!!!
Thanks