LINK : fatal error LNK1181: cannot open input file 'wxbase31u.lib' 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
almonj
Earned a small fee
Earned a small fee
Posts: 16
Joined: Fri Dec 09, 2016 5:41 pm

LINK : fatal error LNK1181: cannot open input file 'wxbase31u.lib'

Post by almonj »

VS2017 is giving me error LINK : fatal error LNK1181: cannot open input file 'wxbase31u.lib' when I try to build. I know the project works in code blocks when complied with tdm-gcc64.

I build the library using VS2017 developer command prompt command in build/msw:
nmake /f makefile.vc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1

set to release build

include directories:
$WXWIN\include\msvc;$WXWIN\include in ("Properties|C++|General|Additional Include Directories")
$WXWIN\lib\vc_dll in ("Properties|Linker|Additional Library Directories")

linker additional dependencies:
wxmsw31u.lib
wxmsw31u_gl.lib
opengl32.lib
gdi32.lib
glew32.lib

preprocessor:
__WXMSW__
WXUSINGDLL
_UNICODE
_CRT_SECURE_NO_WARNINGS
wxUSE_GLCANVAS

Am I forgetting something in the settings? Not sure what is going on here.
Last edited by almonj on Wed Feb 07, 2018 4:54 pm, edited 1 time in total.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: LINK : fatal error LNK1181: cannot open input file 'wxbase31u.lib'

Post by PB »

I believe that in the monolithic build, there is no base/core library, wxmsw31u[d].lib contains the wx libraries except the third party ones (and perhaps OpenGL one).

The shared libraries should be in vc_dll and not vc_lib.

Additionally, you are including the MSVC-specific setup.h, so the wx libraries should be autolinked and therefore you so do need to list them.
Last edited by PB on Wed Feb 07, 2018 3:49 pm, edited 1 time in total.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: LINK : fatal error LNK1181: cannot open input file 'wxbase31u.lib'

Post by ONEEYEMAN »

Hi,
Why do you use MONOLITHIC build?
There is no gain in using it vs. MULTI-LIB solution other than more problems in the long run.

Just rebuild the library without this option and you should be good to go.

Also "UNICODE=1" is set to default starting from the 3.0 so you can safely get rid of this as well.

And finally building the library with "SHARED=1" option on Windows with MSVC is a little weird. Do you have another libraries that you developed with wx to do such a build?

Thank you.
almonj
Earned a small fee
Earned a small fee
Posts: 16
Joined: Fri Dec 09, 2016 5:41 pm

Re: LINK : fatal error LNK1181: cannot open input file 'wxbase31u.lib'

Post by almonj »

PB wrote:I believe that in the monolithic build, there is no base/core library, wxmsw31u[d].lib contains the wx libraries except the third party ones (and perhaps OpenGL one).

The shared libraries should be in vc_dll and not vc_lib.

Additionally, you are including the MSVC-specific setup.h, so the wx libraries should be autolinked and therefore you so do need to list them.
oops, I actually copied that wrong, I did have the vc_dll folder in the linker.
ONEEYEMAN wrote:Hi,
Why do you use MONOLITHIC build?
There is no gain in using it vs. MULTI-LIB solution other than more problems in the long run.

Just rebuild the library without this option and you should be good to go.

Also "UNICODE=1" is set to default starting from the 3.0 so you can safely get rid of this as well.

And finally building the library with "SHARED=1" option on Windows with MSVC is a little weird. Do you have another libraries that you developed with wx to do such a build?

Thank you.
Ok, I will try that. I am used to using TDM-gcc to build wx, those were the settings I used with that compiler. I don't have any special need for the shared option. I'm not experienced with MSVC. Thanks for the help
almonj
Earned a small fee
Earned a small fee
Posts: 16
Joined: Fri Dec 09, 2016 5:41 pm

Re: LINK : fatal error LNK1181: cannot open input file 'wxbase31u.lib'

Post by almonj »

Looks like it worked. Thanks all :)
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: LINK : fatal error LNK1181: cannot open input file 'wxbase31u.lib'

Post by ONEEYEMAN »

Hi,
Moreover, to simplify the build you can open an appropriate solution from build\msw and do: "Build ->Batch Buiuld... -> Select All -> Build".

Then it will build all possible configuration and all you will need is to just compile and link appropriate configuration that can be picked up from the minimal sample solution.

Thank you.
Post Reply