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
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Apr 17, 2018 9:58 am

Problem compiler visual studio 2017,wxwidgets 3.14,error link2001

Post by Valerio » Fri Mar 05, 2021 3:48 pm

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: 5226
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 » Fri Mar 05, 2021 4:40 pm

Hi,
Please compare the auidemo project with yours.

Thank youl.

Valerio
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Apr 17, 2018 9:58 am

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

Post by Valerio » 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.
I compile and compare error linker.
Thanks
Best regards
Vale
Attachments
DLllybrary.JPG
DLllybrary.JPG (67.73 KiB) Viewed 2158 times

Valerio
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Apr 17, 2018 9:58 am

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

Post by Valerio » Tue Mar 09, 2021 9:14 am

Other image with project open
Attachments
WxProject.JPG
WxProject.JPG (31.49 KiB) Viewed 2157 times

User avatar
doublemax@work
Earned some good credits
Earned some good credits
Posts: 110
Joined: Wed Jul 29, 2020 6:06 pm

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

Post by doublemax@work » Tue Mar 09, 2021 9:20 am

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
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Apr 17, 2018 9:58 am

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

Post by Valerio » Tue Mar 09, 2021 10:19 am

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 2148 times
OwnProjects1.JPG
OwnProjects.JPG
OwnProjects.JPG (79.95 KiB) Viewed 2148 times

Valerio
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Apr 17, 2018 9:58 am

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

Post by Valerio » Tue Mar 09, 2021 10:20 am

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: 3063
Joined: Sun Jan 03, 2010 5:45 pm

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

Post by PB » Tue Mar 09, 2021 11:15 am

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 » Fri Mar 12, 2021 1:40 pm

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: 16200
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post by doublemax » Fri Mar 12, 2021 1:49 pm

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 » Fri Mar 12, 2021 2:05 pm

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
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Apr 17, 2018 9:58 am

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

Post by Valerio » Fri Mar 12, 2021 2:27 pm

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 » Fri Mar 12, 2021 4:06 pm

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
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Apr 17, 2018 9:58 am

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

Post by Valerio » Mon Mar 15, 2021 1:07 pm

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 2007 times

Valerio
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Apr 17, 2018 9:58 am

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

Post by Valerio » Mon Mar 15, 2021 1:34 pm

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