[SOLVED] Cannot open file "wxbase31ud.lib" LNK1104 error 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
Dawis67
In need of some credit
In need of some credit
Posts: 6
Joined: Mon Mar 30, 2020 10:01 pm

[SOLVED] Cannot open file "wxbase31ud.lib" LNK1104 error

Post by Dawis67 » Mon Mar 30, 2020 10:09 pm

Hi.
I was looking to get started building GUI to one of my programms, and i have never done GUIs before. I went with the OneLoneCoder's tutorial on GUIs on YT. I followed his instructions and created the same files, and did the same configuration, but i cannot get my file to build.

Once i try to build i get LNK1104 error and the error message says that it cannot open wxbase31ud.lib. I searched the /lib/vc_lib folder and the file wxbase31ud.lib is there.

Im using Visual Studio 2019. To install wxWidgets i downloaded the latest 3.1.3 wxWidgets.zip file and extracted all files into a location. Then proceeded to build it manually by opening build/msw/wx_vc16.sln as i didnt find any higher versions. I used the batch build and used select all option, so im guessing i have built everything there is to build.

I also tried to build using vc15.sln afterwards, but the same error persisted.

Im hoping somebody here has a solution as i cant seem to find any elsewhere.

Thans.
Last edited by Dawis67 on Tue Mar 31, 2020 1:17 am, edited 1 time in total.

User avatar
doublemax
Moderator
Moderator
Posts: 14952
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Cannot open file "wxbase31ud.lib" LNK1104 error

Post by doublemax » Mon Mar 30, 2020 10:15 pm

Then proceeded to build it manually by opening build/msw/wx_vc16.sln as i didnt find any higher versions. I used the batch build and used select all option, so im guessing i have built everything there is to build.
So building the wxWidgets libraries was successful?

If yes, then the next step should be to build the "minimal" sample that comes with wxWidgets through the VS project files.
Use the source, Luke!

Dawis67
In need of some credit
In need of some credit
Posts: 6
Joined: Mon Mar 30, 2020 10:01 pm

Re: Cannot open file "wxbase31ud.lib" LNK1104 error

Post by Dawis67 » Mon Mar 30, 2020 10:25 pm

doublemax wrote:
Mon Mar 30, 2020 10:15 pm
Then proceeded to build it manually by opening build/msw/wx_vc16.sln as i didnt find any higher versions. I used the batch build and used select all option, so im guessing i have built everything there is to build.
So building the wxWidgets libraries was successful?

If yes, then the next step should be to build the "minimal" sample that comes with wxWidgets through the VS project files.
What do you mean by the "minimal" sample? Is it just opening the vs16.sln and just clicking "Build solution"?

User avatar
doublemax
Moderator
Moderator
Posts: 14952
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Cannot open file "wxbase31ud.lib" LNK1104 error

Post by doublemax » Mon Mar 30, 2020 10:26 pm

Yes, In <wxdir>/samples/minimal/, use the highest version solution file.
Use the source, Luke!

Dawis67
In need of some credit
In need of some credit
Posts: 6
Joined: Mon Mar 30, 2020 10:01 pm

Re: Cannot open file "wxbase31ud.lib" LNK1104 error

Post by Dawis67 » Mon Mar 30, 2020 10:34 pm

doublemax wrote:
Mon Mar 30, 2020 10:26 pm
Yes, In <wxdir>/samples/minimal/, use the highest version solution file.
Ok, i opened /samples/minimal/minimal_vc15.sln (the highest i found) and built it with "Build Solution". This however does not seem to change the error in my original GUI sln. It still throws the same linking error.

User avatar
doublemax
Moderator
Moderator
Posts: 14952
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Cannot open file "wxbase31ud.lib" LNK1104 error

Post by doublemax » Mon Mar 30, 2020 10:38 pm

Ok, i opened /samples/minimal/minimal_vc15.sln (the highest i found) and built it with "Build Solution".
Did it compile and did you actually run the sample?

This was all just to confirm that the building of the wxWidgets libraries was successful.

If yes, then it's probably just a matter of wrong linker paths, but as i don't know OneLoneCoder's video, i can't tell you exactly what's wrong. But you should be able to take the settings in the sample for comparison.
Use the source, Luke!

Dawis67
In need of some credit
In need of some credit
Posts: 6
Joined: Mon Mar 30, 2020 10:01 pm

Re: Cannot open file "wxbase31ud.lib" LNK1104 error

Post by Dawis67 » Mon Mar 30, 2020 10:51 pm

doublemax wrote:
Mon Mar 30, 2020 10:38 pm
Ok, i opened /samples/minimal/minimal_vc15.sln (the highest i found) and built it with "Build Solution".
Did it compile and did you actually run the sample?

This was all just to confirm that the building of the wxWidgets libraries was successful.

If yes, then it's probably just a matter of wrong linker paths, but as i don't know OneLoneCoder's video, i can't tell you exactly what's wrong. But you should be able to take the settings in the sample for comparison.

Ok, yes i didnt run it. I just built it. Now i ran it and the it worked just fine. A nice window popped up. I will compare the configs

Dawis67
In need of some credit
In need of some credit
Posts: 6
Joined: Mon Mar 30, 2020 10:01 pm

Re: Cannot open file "wxbase31ud.lib" LNK1104 error

Post by Dawis67 » Mon Mar 30, 2020 11:10 pm

Ok, i looked around and compared the linkers additional library directories. The main difference i think is that the file location for the minimal sample file is in the wxWidgets directory while mine isnt. The video instructed to create global variable "wxwin" and use that so:

I have
C++/General:
$(wxwin)/include/msvc;$(wxwin)/include/;

Linker/General
$(wxwin)/include/lib/vc_lib;

I tried adding %(AdditionalLibraryDirectories) at the end of these two, and i also changed $(wxwin)/include/lib/vc_lib; to $(wxwin)/include/lib; to make it more general. None of these things helped.

If it isnt too much to ask you can look at the video and find what he is/i am doing wrong: https://www.youtube.com/watch?v=FOIbK4bJKS8&t=828s

the installation and config starts at 12:50.

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

Re: Cannot open file "wxbase31ud.lib" LNK1104 error

Post by stahta01 » Mon Mar 30, 2020 11:26 pm

What value did you use for the global variable "wxwin"?

Tim S.
Last edited by stahta01 on Mon Mar 30, 2020 11:46 pm, edited 1 time in total.

User avatar
doublemax
Moderator
Moderator
Posts: 14952
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Cannot open file "wxbase31ud.lib" LNK1104 error

Post by doublemax » Mon Mar 30, 2020 11:44 pm

Code: Select all

$(wxwin)/include/lib/vc_lib
This should be:

Code: Select all

$(wxwin)/lib/vc_lib
Use the source, Luke!

Dawis67
In need of some credit
In need of some credit
Posts: 6
Joined: Mon Mar 30, 2020 10:01 pm

Re: Cannot open file "wxbase31ud.lib" LNK1104 error

Post by Dawis67 » Tue Mar 31, 2020 1:16 am

doublemax wrote:
Mon Mar 30, 2020 11:44 pm

Code: Select all

$(wxwin)/include/lib/vc_lib
This should be:

Code: Select all

$(wxwin)/lib/vc_lib
Thanks. FFS quite embarrassing error to struggle with for hours. I cant believe i didnt see it. Again, thanks a lot

Post Reply