wxbase29u.lib expected in wx313 project 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
Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 223
Joined: Thu Aug 03, 2017 12:20 pm

wxbase29u.lib expected in wx313 project

Post by Natulux » Tue Mar 10, 2020 1:11 pm

Hey

I have an obscure problem. I try to port a very old project from 2.9.2/vs2008 to 3.1.3/vs2019
With the help of utelle I already set up an working enviroment with wxWidgets_313/wxSqlite3_451 static and dynmaic / Debug and Release (I checked with minimal samples).
(Windows10x64, build x86)

The project I want to port is rather big, also uses chilkat 9.5.0 and asio standlone 1.13.0

I copied my project into my project dir of wxW313, because I use relative paths to the includes/libraries.
But after compiling I get exactly one error:
LNK 1104 cannot open file "wxbase29u.lib"

Mind you, not missing it, but cannot open it. Im not familiar with this problem at all:
1. Why does my project try to open a base29u, when it should only use base31u? I searched all files in my wxW313 dir for the term base29u and deleted/replaced all the old crap that I could find. Still the same.

2. If it really tried to open base29u, why can't it do so? I wouldn't even know how to block it if I wanted to... there are no other opened projects or processes that I am aware of reading or writing to it.

-> The only connection to it could be the global "WXWIN" windows variable, which points to my wxWidgets-2.9.2 installation, which of course has a base29u. But manually I avoid WXWIN, so it can't be an include from myself from inside the IDE.

Is there something like ressources or manifests that could try to include base29u via WXWIN variable? (not in the .rc that I am including, though)

[EDIT:] Changing WXWIN to my wxW313 installation doesn't change anything. Now I have no clue at all, why it tries and fails to open that old library.
And yes, I turned it off and on again.

[EDIT2:] Ok, I managed to get other projects for this enviroment. Every project has the same error.
So my testing with the sample projects didn't suffice. My problem is that I tried to use only one wxWidgets installation for alle the builds, devided only by the library folder:

/libs/vc_MT_lib/ with all the XXu.lib and XXud.lib files <-- static release and debug
/libs/vc_MD_lib/ with all the XXu.lib and XXud.lib files <-- dynamic release and debug

That doesn't work for my projects though. Can you share your experiences, do you have several different wxWidget builds and how do you seperate them?

Thanks
Natu

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2437
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxbase29u.lib expected in wx313 project

Post by PB » Tue Mar 10, 2020 1:58 pm

It probably is somewhere in the project linker settings for given configuration: Grep your .vcxproj files to check.

If you will not find anything there, it could be #pragma(comment, wxbase29u.lib) somewhere in the source files but that is hopefully not very likely...

Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 223
Joined: Thu Aug 03, 2017 12:20 pm

Re: wxbase29u.lib expected in wx313 project

Post by Natulux » Tue Mar 10, 2020 2:12 pm

PB wrote:
Tue Mar 10, 2020 1:58 pm
It probably is somewhere in the project linker settings for given configuration: Grep your .vcxproj files to check.

If you will not find anything there, it could be #pragma(comment, wxbase29u.lib) somewhere in the source files but that is hopefully not very likely...
Nothing so easy I fear. I searched the whole wxW313 + my project directory and all file names + content for the term "base29u" and eliminated/replaced them all. That includes the linker settings and pragmas which link against base29u explicitly.
As it seems it is some error built in the libraries at compile time that I cant understand. Atm I make two directories, one for static compilation, one for dynamic. Lets see if that changes things.

Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 223
Joined: Thu Aug 03, 2017 12:20 pm

Re: wxbase29u.lib expected in wx313 project

Post by Natulux » Tue Mar 10, 2020 2:26 pm

ok it compiled.

Conclusion: Never try to get static/dynamic compilations of wxWidgets in one directory - seperate the whole thing.
What works for me:

C:/wxWidgets-3.1.3_MD_2019/ (dynamic debug and release)
C:/wxWidgets-3.1.3_MT_2019/ (static debug and release)

It needs more disc space that way, but it works.

Cheers
Natu

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4175
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxbase29u.lib expected in wx313 project

Post by ONEEYEMAN » Tue Mar 10, 2020 2:39 pm

Hi,
If you are working with the defqault downloads of wxWidgets, compilation will produce the results inside:

lib\vc_dll - for dynamic build
lib\vc_lib - for static build

No need to keep 2 directories with the source code.

Thank you.

Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 223
Joined: Thu Aug 03, 2017 12:20 pm

Re: wxbase29u.lib expected in wx313 project

Post by Natulux » Tue Mar 10, 2020 3:25 pm

This has always been a little confusing for me, but I don't talk about using a DLL build, but rather about the microsoft runtime libraries.

As a default, wxWidgets is compiled with the Visual Studio compiler setting "Multithreaded-DLL (/MD)" (windows only I believe) which means that the microsoft dynamic runtime libraries are beeing used.
Optionally, I can change the runtime libraries to "Multithreaded (/MT)", microsoft static runtime. For this I don't change the wxWidgets compile mode - I always use Release or Debug.
MT and MD must not mix, every project I want to include needs to be built with the same runtime.

In combination with for example wxSqlite, static (MT) means that the sqlite3.dll is built into the app, and dynamic (MD) needs the sqlite3.dll in order to work. That was why I switched to MT in the first place.

If I used wxWidgets DLL Release would I get wxWidget DLLs for my project in order to run? Seems only logical ;-)

But back to the point: Having two builds with one beeing microsoft static runtime and the other microsoft dynamic runtime, those dont mix well in one directory. At least not for me...

Cheers
Natu

utelle
Moderator
Moderator
Posts: 940
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxbase29u.lib expected in wx313 project

Post by utelle » Tue Mar 10, 2020 3:52 pm

Natulux wrote:
Tue Mar 10, 2020 3:25 pm
This has always been a little confusing for me, but I don't talk about using a DLL build, but rather about the microsoft runtime libraries.
I have the impression that the terms static and shared/DLL are a bit mixed up in this discussion. On the one hand, you can use static or shared/DLL C runtime libraries (compiler switch /MT vs /MD), and on the other hand you can build wxWidgets (and other components) as static or shared/DLL.

If you build wxWidgets (and other components) as DLLs you should really avoid using the static C runtime libraries, because in C++ applications this usually means calling for trouble (due to separate memory management per DLL).

Using the static C runtime libraries makes only sense in combination with static libraries and for application that need to be self-contained.
Natulux wrote:
Tue Mar 10, 2020 3:25 pm
As a default, wxWidgets is compiled with the Visual Studio compiler setting "Multithreaded-DLL (/MD)" (windows only I believe) which means that the microsoft dynamic runtime libraries are beeing used.
Correct.
Natulux wrote:
Tue Mar 10, 2020 3:25 pm
Optionally, I can change the runtime libraries to "Multithreaded (/MT)", microsoft static runtime. For this I don't change the wxWidgets compile mode - I always use Release or Debug.
MT and MD must not mix, every project I want to include needs to be built with the same runtime.
This is also correct.
Natulux wrote:
Tue Mar 10, 2020 3:25 pm
In combination with for example wxSqlite, static (MT) means that the sqlite3.dll is built into the app, and dynamic (MD) needs the sqlite3.dll in order to work. That was why I switched to MT in the first place.
No, this is not true. Since version 3.5.0 of wxSQLite3 the SQLite library is an integrated part of wxSQLite3. This avoids version conflicts. That is, for recent versions of wxSQLite3 you definitely don't have a sqlite3.dll file. And if you build wxSQLite3 as a static library, it can be linked statically into your application. Whether you use static or shared/DLL C runtime libraries is a completely independent decision. That is, you can build wxSQLite3 as a static library, but still use the shared/DLL C runtime libraries.

If your application uses other components which are compiled as DLLs, I would strongly recommend to use the shared/DLL C runtime libraries.
Natulux wrote:
Tue Mar 10, 2020 3:25 pm
If I used wxWidgets DLL Release would I get wxWidget DLLs for my project in order to run? Seems only logical ;-)
Correct.

Regarding wxSQLite3 you have 3 options:

1) static wxSQLite3 library using static wxWidgets libraries
2) static wxSQLite3 library using wxWidgets DLLs
3) wxSQLite3 DLL using wxWidgets DLLs
Natulux wrote:
Tue Mar 10, 2020 3:25 pm
But back to the point: Having two builds with one beeing microsoft static runtime and the other microsoft dynamic runtime, those dont mix well in one directory. At least not for me...
Indeed you should separate the library directories. However, you can use the same wxWidgets source tree.

Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 223
Joined: Thu Aug 03, 2017 12:20 pm

Re: wxbase29u.lib expected in wx313 project

Post by Natulux » Thu Mar 12, 2020 2:02 pm

utelle wrote:
Tue Mar 10, 2020 3:52 pm
I have the impression that the terms static and shared/DLL are a bit mixed up in this discussion. On the one hand, you can use static or shared/DLL C runtime libraries (compiler switch /MT vs /MD), and on the other hand you can build wxWidgets (and other components) as static or shared/DLL.
Yes, it would be easier if they were named differently. At first I didn't even think about wxWidgets DLL build, because I never used it...
utelle wrote:
Tue Mar 10, 2020 3:52 pm
If you build wxWidgets (and other components) as DLLs you should really avoid using the static C runtime libraries, because in C++ applications this usually means calling for trouble (due to separate memory management per DLL).

Using the static C runtime libraries makes only sense in combination with static libraries and for application that need to be self-contained.
I'll keep that in mind, if I ever think having a DLL would be a nice idea. I doubt it, though ;-)
utelle wrote:
Tue Mar 10, 2020 3:52 pm
No, this is not true. Since version 3.5.0 of wxSQLite3 the SQLite library is an integrated part of wxSQLite3. This avoids version conflicts. That is, for recent versions of wxSQLite3 you definitely don't have a sqlite3.dll file. And if you build wxSQLite3 as a static library, it can be linked statically into your application. Whether you use static or shared/DLL C runtime libraries is a completely independent decision. That is, you can build wxSQLite3 as a static library, but still use the shared/DLL C runtime libraries.

If your application uses other components which are compiled as DLLs, I would strongly recommend to use the shared/DLL C runtime libraries.
Not true anymore, you are right. Actually I was talking about a project using wxSqlite-3.0.0 at that time and I never had any reason to change back to MD. Except maybe for those other projects, who are build with MD and now I need MD and MT versions of wxWidgets/wxSqlite ;-)
utelle wrote:
Tue Mar 10, 2020 3:52 pm
Regarding wxSQLite3 you have 3 options:

1) static wxSQLite3 library using static wxWidgets libraries
2) static wxSQLite3 library using wxWidgets DLLs
3) wxSQLite3 DLL using wxWidgets DLLs
Thats a nice summary. Good to know for the future!
utelle wrote:
Tue Mar 10, 2020 3:52 pm
Natulux wrote:
Tue Mar 10, 2020 3:25 pm
But back to the point: Having two builds with one beeing microsoft static runtime and the other microsoft dynamic runtime, those dont mix well in one directory. At least not for me...
Indeed you should separate the library directories. However, you can use the same wxWidgets source tree.
Maybe I messed up when compiling
Static wxW Release / Static wxS Release
Static wxW Debug / Static wxS Debug
Dynamic wxW Release / Dynamic wxS Release
Dynamic wxW Debug / Dynamic wxS Debug

But in the end it didnt work for me, just seperating the library directories of Static / Dynamic.
Debug and Release should be no problem, because all files are explictly named:
u.lib and mswu and wxSqlite3.lib
ud.lib and mswud and wxSqlite3d.lib

I don't know, for now I rather have them devided back to the wxWidgets root dir.

Cheers
Natu

Post Reply