Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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:
[code]
/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)'
[/code]
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:
[code]
[u]files_storage.h[/u]
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();
...

[u]files_storage.cpp[/u]

namespace logic
{
files_storage::files_storage(const std::wstring& root_storage_path, files_storage::en_file_storage_type type)
{
}
...
[/code]

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
Sign In or Register to comment.