Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

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.
Valerio
Knows some wx things
Knows some wx things
Posts: 42
Joined: Tue Apr 17, 2018 9:58 am

Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Valerio »

Dear all i'm Valerio,i downloaded wixwidgets 3.14,and compiled it in visual studio 2017,i compile as library dinamic DLL,i have much error link2001,i try change subsystem in linker settings,i set subsystem windows,but error link2001 is same.Do you have an idea which is additional dependencies correct?Thanks best regards Vale
Attachments
Impostazioni2.JPG
Impostazioni1.JPG
ErrorLink.JPG
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by ONEEYEMAN »

Hi,
Please compare the auidemo project with yours.

Thank youl.
Valerio
Knows some wx things
Knows some wx things
Posts: 42
Joined: Tue Apr 17, 2018 9:58 am

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Valerio »

Thanks at all for help,i use this project in cartel msw of wxwidgets 3.14,wx_vc16.sln
D:\wxWidgets-3.1.4\build\msw\wx_vc16.sln.
i open wx_vc16.sln with visual studio 17,i set in dll libray in linker.
I compile and compare error linker.
Thanks
Best regards
Vale
Attachments
DLllybrary.JPG
DLllybrary.JPG (67.73 KiB) Viewed 2839 times
Valerio
Knows some wx things
Knows some wx things
Posts: 42
Joined: Tue Apr 17, 2018 9:58 am

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Valerio »

Other image with project open
Attachments
WxProject.JPG
WxProject.JPG (31.49 KiB) Viewed 2838 times
User avatar
doublemax@work
Super wx Problem Solver
Super wx Problem Solver
Posts: 472
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by doublemax@work »

You definitely don't have to change anything in the solution file for wxWidgets. If you did make any changes, revert them, or just start from scratch.

Did you get the linker errors when building wxWidgets or when building your own project?
Valerio
Knows some wx things
Knows some wx things
Posts: 42
Joined: Tue Apr 17, 2018 9:58 am

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Valerio »

Ah ok,reports to the same configuration original,i compile in debug configuration,all ok.Now i try to open my own projects in debug and obtain this error :
1>wxbase31ud.lib(appbase.obj) : error LNK2038: rilevata errata corrispondenza per 'RuntimeLibrary': il valore 'MDd_DynamicDebug' non corrisponde al valore 'MTd_StaticDebug' in 16-Bit Flash Programmer.obj
1>wxbase31ud.lib(string.obj) : error LNK2038: rilevata errata corrispondenza per 'RuntimeLibrary': il valore 'MDd_DynamicDebug' non corrisponde al valore 'MTd_StaticDebug' in 16-Bit Flash Programmer.obj
1>wxbase31ud.lib(strconv.obj) : error LNK2038: rilevata errata corrispondenza per 'RuntimeLibrary': il valore 'MDd_DynamicDebug' non corrisponde al valore 'MTd_StaticDebug' in 16-Bit Flash Programmer.obj
1>wxbase31ud.lib(unichar.obj) : error LNK2038: rilevata errata corrispondenza per 'RuntimeLibrary': il valore 'MDd_DynamicDebug' non corrisponde al valore 'MTd_StaticDebug' in 16-Bit Flash Programmer.obj
1>wxbase31ud.lib(strvararg.obj) : error LNK2038: rilevata errata corrispondenza per 'RuntimeLibrary': il valore 'MDd_DynamicDebug' non corrisponde al valore 'MTd_StaticDebug' in 16-Bit Flash Programmer.obj
1>wxbase31ud.lib(object.obj) : error LNK2038: rilevata errata corrispondenza per 'RuntimeLibrary': il valore 'MDd_DynamicDebug' non corrisponde al valore 'MTd_StaticDebug' in 16-Bit Flash Programmer.obj
1>wxbase31ud.lib(arrstr.obj) : error LNK2038: rilevata errata corrispondenza per 'RuntimeLibrary': il valore 'MDd_DynamicDebug' non corrisponde al valore 'MTd_StaticDebug' in 16-Bit Flash Programmer.obj
Attachments
OwnProjects2.JPG
OwnProjects2.JPG (78.95 KiB) Viewed 2829 times
OwnProjects1.JPG
OwnProjects.JPG
OwnProjects.JPG (79.95 KiB) Viewed 2829 times
Valerio
Knows some wx things
Knows some wx things
Posts: 42
Joined: Tue Apr 17, 2018 9:58 am

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Valerio »

other setup,error linker in compile debug is :

1>wxbase31ud.lib(appbase.obj) : error LNK2038: rilevata errata corrispondenza per 'RuntimeLibrary': il valore 'MDd_DynamicDebug' non corrisponde al valore 'MTd_StaticDebug'

Thanks
best regards
Vale
Attachments
OwnProjects3.JPG
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4183
Joined: Sun Jan 03, 2010 5:45 pm

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by PB »

You have to build both the library and your application with same settings, including the linking of the CRT.

My guess would be that you tried to build wxWidgets linking to the CRT statically but failed. However, while doing that is not recommended it is definitely possible when building wxWidgets as static library. Just make sure you change the setting for ALL projects and use Debug CRT in Debug configurations and Release CRT in release configurations.

You can select multiple projects in a solution at once in MSVS. Open wx_vc15.sln in MSVS, in Solution Explorer click on "adv" project and then <Shift>+click "xrc" project so that all projects are selected, right click any selected project to invoke project properties for all selected projects, and change the setting. After that, rebuild the whole library.
Peter H
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Mar 12, 2021 12:29 pm

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Peter H »

Valerio wrote: Tue Mar 09, 2021 9:13 am Thanks at all for help,i use this project in cartel msw of wxwidgets 3.14,wx_vc16.sln
D:\wxWidgets-3.1.4\build\msw\wx_vc16.sln.
i open wx_vc16.sln with visual studio 17,i set in dll libray in linker.
So far I know, the solution wx_vc16.sln is for VS2019 isnt it?

Edit: I compiled wx_vc15.sln in VS2017 and I choose to compile everything in a batch build and this worked for me.
Meanwhile I use VS2019 and it can also be linked with VS2017 projects, because VS2015 to VS2019 are supposed to be binary link compatible.

However, the solution and project files are probably only upward compatible.
Last edited by Peter H on Fri Mar 12, 2021 3:58 pm, edited 3 times in total.
User avatar
doublemax
Moderator
Moderator
Posts: 19103
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by doublemax »

Peter H wrote: Fri Mar 12, 2021 1:40 pm So far I know, the solution wx_vc16.sln is for VS2019 isnt it?
Technically yes, but fortunately the differences betweens version are not as big as it used to be. So it will work fine. E.g. current VS versions will still happily import and convert the *vc9.vcproj project files from most of the samples.
Use the source, Luke!
Peter H
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Mar 12, 2021 12:29 pm

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Peter H »

This might depend, how the project files are generated.

I generated in Dialog Blocks projects for VS2017 and building them in VS2019 did not work.(Linking errors)
Building in VS2017 did work. Only after VS2017 saved the project it was compatible to VS2019.
(I hope there is a new version of Dialog Blocks soon, I already got a working beta)
If the projects are generated not by VS201x itself, but from a makefile there might be differences in compatibility.

Also see the Edit in my posting above.
Valerio
Knows some wx things
Knows some wx things
Posts: 42
Joined: Tue Apr 17, 2018 9:58 am

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Valerio »

Dear all,thanks in advance,so i try to compile the right solution in vs2017,wx_vc15.sln,i try this solution.
Thanks
Peter H
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Mar 12, 2021 12:29 pm

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Peter H »

Just for clarification:

The number, e.g. 15 refers to the Visual Studio version so far I know.
e.g. VS2019 has version 16.x.x, VS2017 has version 15.x.x
You see the version if you type devenv /? or invoke "About Visual Studio" in the IDE.

Before I recognized this, I had several failures too, there are also tutorials that explain it wrong.
Valerio
Knows some wx things
Knows some wx things
Posts: 42
Joined: Tue Apr 17, 2018 9:58 am

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Valerio »

Dear all,this is version of visual-studio that i used : 15.9.14,
Thanks
Best Regards
Vale
Attachments
VersionVisualStudio.JPG
VersionVisualStudio.JPG (23.15 KiB) Viewed 2688 times
Valerio
Knows some wx things
Knows some wx things
Posts: 42
Joined: Tue Apr 17, 2018 9:58 am

Re: Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Valerio »

Dear All,thanks for help,
now i recompile wxwidgets 3.14,all ok,but when launch my app,compare this error :
error LNK2038: rilevata errata corrispondenza per 'RuntimeLibrary': il valore 'MDd_DynamicDebug' non corrisponde al valore 'MTd_StaticDebug' in 16-Bit Flash Programmer.obj
Which setting in my project do setting?
Thanks
Best regards
Vale
Attachments
LinkError.JPG
Post Reply