Page 1 of 1

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

Posted: Mon Mar 30, 2020 10:09 pm
by Dawis67
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.

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

Posted: Mon Mar 30, 2020 10:15 pm
by doublemax
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.

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

Posted: Mon Mar 30, 2020 10:25 pm
by Dawis67
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"?

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

Posted: Mon Mar 30, 2020 10:26 pm
by doublemax
Yes, In <wxdir>/samples/minimal/, use the highest version solution file.

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

Posted: Mon Mar 30, 2020 10:34 pm
by Dawis67
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.

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

Posted: Mon Mar 30, 2020 10:38 pm
by doublemax
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.

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

Posted: Mon Mar 30, 2020 10:51 pm
by Dawis67
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

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

Posted: Mon Mar 30, 2020 11:10 pm
by Dawis67
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.

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

Posted: Mon Mar 30, 2020 11:26 pm
by stahta01
What value did you use for the global variable "wxwin"?

Tim S.

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

Posted: Mon Mar 30, 2020 11:44 pm
by doublemax

Code: Select all

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

Code: Select all

$(wxwin)/lib/vc_lib

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

Posted: Tue Mar 31, 2020 1:16 am
by Dawis67
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

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

Posted: Sun Apr 02, 2023 3:14 am
by SahilMirza1100
I try this end up with successful compilation and runing the projects.

wxmsw32ud_core.lib
wxbase32ud.lib
wxtiffd.lib
wxjpegd.lib
wxpngd.lib
wxzlibd.lib
wxregexud.lib
wxexpatd.lib

Add this library to project propertis of linker->input->Additional Dependecies.

Additional Includes should be,
$(WXWIN)\include;$(WXWIN)\include\msvc

Additional Library Directories
$(wxwin)\lib\vc_lib;%(AdditionalLibraryDirectories)

100% gurrenty it would work fine.