0

my wxWidgets application has multiple C++ projects (one executable and all the other static libraries). I am using Visual Studio 2022 with a solution having Debug and Release configurations only for x64.

I decided to upgrade the wxWidgets version from 3.1.2 to 3.2.8. The Debug configuration builds without any error. The Release, unfortunately, presents a list of unresolved symbols (LINK2001) and redefinitions (LINK2005).

In all these cases, these errors appear during the linkage of the executable project, and are referencing objects existing only in one of those static libraries:

Error LNK2001 unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXAEBVwxString@@H000@ZEA) wxPgConsole C:\pg\wxPgConsole\wxbase.lib(getTimeString.obj)

According to many posts, the solution for this kind of error is to define the WXUSINGDLL preprocessor symbol.

I have defined this in source code, but I got the same errors.

#define WXUSINGDLL
class wxPgConsole ... {
};

I have set it in the VCXPROJ also, but I got the same errors.

enter image description here

What else can I do to get a working Release build?

genpfault
52.3k12 gold badges94 silver badges153 bronze badges
asked May 26, 2025 at 14:12
4
  • 3
    Where do you define that macro? Please post a minimal reproducible example. Commented May 26, 2025 at 14:18
  • Probably relevant (maybe duplicate): What is an undefined reference/unresolved external symbol error and how do I fix it?. Commented May 26, 2025 at 14:35
  • It's still unclear where you have defined that macro. This is a common error when users define a macro in the Debug project configuration but build Release Commented May 26, 2025 at 14:40
  • Can you build and run minimal sample? Commented May 30, 2025 at 10:50

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.