Unresolved Reference on first Attempt to build Topic is solved

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
kbmatson
In need of some credit
In need of some credit
Posts: 7
Joined: Tue Apr 24, 2018 8:44 pm

Unresolved Reference on first Attempt to build

Post by kbmatson »

Hi - new to C++ and brand new to wxWidgets.

building wxSmith frame form in CodeBlocks.
I followed all instructions for installs and compiling and seemed to have everything going well. Created new wxWidgets project and sure enough a blank form comes up along with all the toolbars and stuff to build my form - GREAT!

Now - I do a build and run before adding anything or changing any code just to see my blank form come up, and here's the problem. I get a ton of errors along the line of:

||=== Build: Debug in VSP (compiler: GNU GCC Compiler) ===|
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp|| undefined reference to `OpenThemeData@8'|
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp|| undefined reference to `GetThemeColor@20'|
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp|| undefined reference to `CloseThemeData@4'|
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp|| undefined reference to `CloseThemeData@4'|
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp|| undefined reference to `CloseThemeData@4'|
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp|| undefined reference to `OpenThemeData@8'|
.....
and a bunch more similar.

Any help appreciated - feeling a bit overwhelmed at the moment.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Unresolved Reference on first Attempt to build

Post by doublemax »

These missing functions are inside Windows libraries that you need to add in the linker settings.
viewtopic.php?p=183294#p183294
Use the source, Luke!
kbmatson
In need of some credit
In need of some credit
Posts: 7
Joined: Tue Apr 24, 2018 8:44 pm

Re: Unresolved Reference on first Attempt to build

Post by kbmatson »

thanks - and soory for being a newbie, but how would I know where the library is?
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Unresolved Reference on first Attempt to build

Post by doublemax »

kbmatson wrote:thanks - and soory for being a newbie, but how would I know where the library is?
It should have come with the compiler, you just have to add the name to the list of libraries in the linker settings.
Use the source, Luke!
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Unresolved Reference on first Attempt to build

Post by New Pagodi »

I just answered a similar question on stack overflow. Here's a screenshot that shows where to add the 2 extra libraries in codeblocks:

Image
kbmatson
In need of some credit
In need of some credit
Posts: 7
Joined: Tue Apr 24, 2018 8:44 pm

Re: Unresolved Reference on first Attempt to build

Post by kbmatson »

cool - that worked. now my form wont close when i click the x - I'll start figuring that out!

THANKS!
Post Reply