Link error

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Part Of The Furniture
Part Of The Furniture
Posts: 4838
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Link error

Post by ONEEYEMAN » Sun Feb 21, 2021 11:20 pm

In my project I have a static link library which exports couple of inline classes.
It is compiled and links to my main application without any issues.
One f the classes I export uses std::mutex.

However recently I tried to link this to another dynamic library that Im developing.
And out of the blue I start getting the link error:

Code: Select all

error LNK2001: unresolved external symbol "public: static class std::mutex X
I checked and I' am linking against this library in both cases and all standard libraries I link are the same in both cases

What am I missing?

Thank you.

Super wx Problem Solver
Super wx Problem Solver
Posts: 418
Joined: Fri Nov 03, 2006 2:00 pm

Re: Link error

Post by stahta01 » Mon Feb 22, 2021 8:20 pm

With GCC, the order of the libraries matter.
No idea with Visual Studio, with GCC I would add the library a second time at the end of the library list and see if that fixes the issue.
If yes, then very likely an library order issue or circular library depends issue.

Tim S.

Post Reply