Re: R: Linker error for Win32 app with MSVS2026
Maarten Bent <[email protected]> Fri, 10 Jul 2026 23:21:32 +0200
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --------------VxZ0y0CffpV70MG26iQrrWjM Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable You need to list all the required libraries (like wxmsw33u_core.lib and=20 wxbase33u.liband core) in Linker -> Input -> dependencies. And you need to specify WXUSINGDLL in C/C++ -> Preprocessor -> definitions. You can use "samples\minimal\minimal.vcxproj" as example. CMake will generate a Visual Studio project with all the correct=20 settings automatically. Maarten On 10 Jul 2026 16:26, Gatti Gianluca wrote: > Thank you, but with the MSVS compiler I prefer to use the "Visual=20 > Studio" way to manage the building of the project than the cmake one. > On the other hand, for the x64 platform and the relative wxWidgets=20 > pre-built binary it works; so I don't understand why it couldn't work=20 > for the x86 (Win32) platform. > > =E2=80=82=E2=80=82=E2=80=82=E2=80=82Gianluca > ------------------------------------------------------------------------ > *Da:* [email protected] <[email protected]> per conto=20 > di Richard <[email protected]> > *Inviato:* venerd=C3=AC 10 luglio 2026 16:18 > *A:* [email protected] <[email protected]> > *Oggetto:* Re: Linker error for Win32 app with MSVS2026 > In article=20 > <AS4PR10MB6110B236328ACF072C56B7659EFD2@=E2=80=8AAS4PR10MB6110.=E2=80=8AE= URPRD10.=E2=80=8APROD.=E2=80=8AOUTLOOK.=E2=80=8ACOM>=20 > you write: >I was trying to build a (simple) wxWidgets application for=20 > x86 platform. >Therefore, I built wxWidgets from source: I choose > ZjQcmQRYFpfptBannerStart > This Message Is From an External Sender > This message came from outside your organization. > ZjQcmQRYFpfptBannerEnd > In article<[email protected].= PROD.OUTLOOK.COM> you write: > >I was trying to build a (simple) wxWidgets application for x86 platform. > >Therefore, I built wxWidgets from source: I choose wx_vc18 solution and > >built it as DLL Release - Win32. > >I extracted the wxWidgets source code .zip in the folder C:\wx\source_3.= 3.3 > > > >When compiling my app, I got a lot of linker error, in particular LNK200= 2 > >"unresolved external symbol..." > > It's simpler to just use CMake to generate the project and solution. > > With the below CMakeUserPresets.json file in the wxWidgets source > directory, next to CMakePresets.json, the following builds and links > everything 32-bit with no problem: > > First, configure to generate project/solution files: > > cmake --preset default32 > > Then you can either build from the solution or with cmake: > > cmake --build --preset default32 > > Pay attention to the output from the first command to see where > wxWidgets wants to write the project/solution files by default. I > place them elsewhere, but omitted that customization to keep this > example simple. > > -- Richard > > =3D=3D=3D=3D=3D=3D CMakeUserPresets.json > { > "version": 6, > "cmakeMinimumRequired": { > "major": 3, > "minor": 23, > "patch": 0 > }, > "configurePresets": [ > { > "name": "default32", > "displayName": "Configure with default 32-bit settings", > "inherits": [ > "with_samples", > "with_tests" > ], > "architecture": { > "value": "Win32", > "strategy": "set" > }, > "generator": "Visual Studio 18 2026" > } > > ], > "buildPresets": [ > { > "name": "default32", > "displayName": "Build with default 32-bit settings", > "configurePreset": "default32" > } > > ], > "testPresets": [ > { > "name": "default32", > "displayName": "Test with default 32-bit settings", > "configurePreset": "default32", > "configuration": "Release", > "output": { > "outputOnFailure": true > } > } > ], > "workflowPresets": [ > { > "name": "default32", > "displayName": "Workflow with default 32-bit settings: configure, = build and test", > "steps": [ > { > "type": "configure", > "name": "default32" > }, > { > "type": "build", > "name": "default32" > }, > { > "type": "test", > "name": "default32" > } > ] > } > ] > } > =3D=3D=3D=3D=3D=3D CMakeUserPresets.json > > -- > "The Direct3D Graphics Pipeline" free book <https://urldefense.com/v3/__h= ttp://tinyurl.com/d3d-pipeline__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-Gn= aoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jkizBAyU$> > The Terminals Wiki <https://urldefense.com/v3/__http://termi= nals-wiki.org__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3s= ZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jVzAfTTU$> > The Computer Graphics Museum <https://urldefense.com/v3/__http://co= mputergraphicsmuseum.org__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-= W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jSWLvJSI$> > Legalize Adulthood! (my blog) <https://urldefense.com/v3/__http://lega= lizeadulthood.wordpress.com__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJ= qP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jjVQsERo$> > > --=20 > Please readhttps://urldefense.com/v3/__https://www.wxwidgets.org/support/= mlhowto.htm__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZX= y2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6j7zHESy4$ before posting. > --- > You received this message because you are subscribed to the Google Groups= "wx-users" group. > To unsubscribe from this group and stop receiving emails from it, send an= email [email protected]. > To view this discussion visithttps://urldefense.com/v3/__https://groups.g= oogle.com/d/msgid/wx-users/E1wiC3S-000000001F9-34MJ*40shell.xmission.com__;= JQ!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3C= tlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jZZNFy0k$. > --=20 > Please read https://www.wxwidgets.org/support/mlhowto.htm before posting. > --- > You received this message because you are subscribed to the Google=20 > Groups "wx-users" group. > To unsubscribe from this group and stop receiving emails from it, send=20 > an email to [email protected]. > To view this discussion visit=20 > https://groups.google.com/d/msgid/wx-users/AS4PR10MB61106EE357E0589CD869A= 3B59EFD2%40AS4PR10MB6110.EURPRD10.PROD.OUTLOOK.COM=20 > <https://groups.google.com/d/msgid/wx-users/AS4PR10MB61106EE357E0589CD869= A3B59EFD2%40AS4PR10MB6110.EURPRD10.PROD.OUTLOOK.COM?utm_medium=3Demail&utm_= source=3Dfooter>. --=20 Please read https://www.wxwidgets.org/support/mlhowto.htm before posting. ---=20 You received this message because you are subscribed to the Google Groups "= wx-users" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/wx-users/6a= f31d1f-1716-4cf6-8ac4-4aaca1a0c7b3%40gmail.com. --------------VxZ0y0CffpV70MG26iQrrWjM Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <!DOCTYPE html> <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8= "> </head> <body> You need to list all the required libraries (like wxmsw33u_core.lib and wxbase33u.liband core) in Linker -> Input -> dependencies.<br= > And you need to specify WXUSINGDLL in C/C++ -> Preprocessor -> definitions.<br> You can use "samples\minimal\minimal.vcxproj" as example.<br> <br> CMake will generate a Visual Studio project with all the correct settings automatically.<br> <br> Maarten<br> <br> <br> <div class=3D"moz-cite-prefix">On 10 Jul 2026 16:26, Gatti Gianluca wrote:<br> </div> <blockquote type=3D"cite" cite=3D"mid:[email protected]= ROD.OUTLOOK.COM"> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF= -8"> <style type=3D"text/css" style=3D"display:none;">@scope { P {margin-t= op:0;margin-bottom:0;} }</style> <div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calib= ri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"> Thank you, but with the MSVS compiler I prefer to use the "Visual Studio" way to manage the building of the project than the cmake one.</div> <div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calib= ri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"> On the other hand, for the x64 platform and the relative wxWidgets pre-built binary it works; so I don't understand why it couldn't work for the x86 (Win32) platform.</div> <div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calib= ri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"> <br> </div> <div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calib= ri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"> =E2=80=82=E2=80=82=E2=80=82=E2=80=82Gianluca<br> </div> <hr style=3D"display:inline-block;width:98%" tabindex=3D"-1"> <div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-ser= if" style=3D"font-size:11pt" color=3D"#000000"><b>Da:</b> <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:wx-users@goo= glegroups.com">[email protected]</a> <a class=3D"moz-txt-link-rfc23= 96E" href=3D"mailto:[email protected]"><[email protected]= m></a> per conto di Richard <a class=3D"moz-txt-link-rfc2396E" href=3D"m= ailto:[email protected]"><[email protected]></a><br> <b>Inviato:</b> venerd=C3=AC 10 luglio 2026 16:18<br> <b>A:</b> <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:wx= [email protected]">[email protected]</a> <a class=3D"moz-txt-link-rfc2396E" href=3D"mailto:wx-users@google= groups.com"><[email protected]></a><br> <b>Oggetto:</b> Re: Linker error for Win32 app with MSVS2026</fon= t> <div>=C2=A0</div> </div> <div> <div style=3D"display:none!important; display:none; visibility:hidden; font-size= :1px; color:#ffffff; line-height:1px; max-height:0px; opacity:0; overflow:h= idden"> In article <a class=3D"moz-txt-link-rfc2396E" href=3D"mailto:AS4PR10MB6110B236328ACF07= 2C56B7659EFD2@=E2=80=8AAS4PR10MB6110.=E2=80=8AEURPRD10.=E2=80=8APROD.=E2=80= =8AOUTLOOK.=E2=80=8ACOM"><AS4PR10MB6110B236328ACF072C56B7659EFD2@=E2=80= =8AAS4PR10MB6110.=E2=80=8AEURPRD10.=E2=80=8APROD.=E2=80=8AOUTLOOK.=E2=80=8A= COM></a> you write: >I was trying to build a (simple) wxWidgets application for x86 platform. >Therefore, I built wxWidgets from source: I choose</div> <div style=3D"display:none!important; display:none; visibility:hidden; font-size= :1px; color:#ffffff; line-height:1px; max-height:0px; opacity:0; overflow:h= idden"> ZjQcmQRYFpfptBannerStart</div> <div dir=3D"ltr" lang=3D"en" id=3D"x_pfptBanneriaynuv6" style=3D"display:block!important; text-align:left!important; margin:0 0 10p= x 0!important; padding:7px 16px 8px 16px!important; border-radius:4px!impor= tant; min-width:200px!important; background-color:#f9d374!important; backgr= ound-color:#f9d374; border-top:4px solid #beb3a1!important; border-top:4px = solid #beb3a1"> <div id=3D"x_pfptBanneriaynuv6" style=3D"float:left!important; display:block!important; margin:1px 0 1px 0!= important; max-width:600px!important"> <div id=3D"x_pfptBanneriaynuv6" style=3D"display:block!important; visibility:visible!important; background-= color:#f9d374!important; color:#000000!important; color:#000000; font-famil= y:'Arial',sans-serif!important; font-family:'Arial',sans-serif; font-weight= :bold!important; font-weight:bold; font-size:14px!important; line-height:1.= 29!important; line-height:1.29"> This Message Is From an External Sender </div> <div id=3D"x_pfptBanneriaynuv6" style=3D"display:block!important; visibility:visible!important; background-= color:#f9d374!important; color:#000000!important; color:#000000; font-weigh= t:normal; font-family:'Arial',sans-serif!important; font-family:'Arial',san= s-serif; font-size:12px!important; line-height:1.5!important; line-height:1= .5; margin-top:2px!important"> This message came from outside your organization. </div> </div> <div style=3D"clear:both!important; display:block!important; visibility:hidden!i= mportant; line-height:0!important; font-size:0.01px!important; height:0px"> =C2=A0</div> </div> <div style=3D"display:none!important; display:none; visibility:hidden; font-size= :1px; color:#ffffff; line-height:1px; max-height:0px; opacity:0; overflow:h= idden"> ZjQcmQRYFpfptBannerEnd</div> <style>@scope { #x_pfptBanneriaynuv6 {display:block!important; visibility:visible!important; opacity:1!important; background-color:#f9d374!important; max-width:none!important; max-height:none!important}html:root, html:root > div {display:block!important; visibility:visible!important; opacity:1!important} }</style> <pre style=3D"font-family:sans-serif; font-size:100%; white-space:pre-wrap; word= -wrap:break-word">In article <a class=3D"moz-txt-link-rfc2396E" href=3D"mai= lto:AS4PR10MB6110B236328ACF072C56B7659EFD2@AS4PR10MB6110.EURPRD10.PROD.OUTL= OOK.COM"><[email protected].= PROD.OUTLOOK.COM></a> you write: >I was trying to build a (simple) wxWidgets application for x86 platform= . >Therefore, I built wxWidgets from source: I choose wx_vc18 solution and >built it as DLL Release - Win32. >I extracted the wxWidgets source code .zip in the folder C:\wx\source_3= .3.3 > >When compiling my app, I got a lot of linker error, in particular LNK20= 02 >"unresolved external symbol..." It's simpler to just use CMake to generate the project and solution. With the below CMakeUserPresets.json file in the wxWidgets source directory, next to CMakePresets.json, the following builds and links everything 32-bit with no problem: First, configure to generate project/solution files: cmake --preset default32 Then you can either build from the solution or with cmake: cmake --build --preset default32 Pay attention to the output from the first command to see where wxWidgets wants to write the project/solution files by default. I place them elsewhere, but omitted that customization to keep this example simple. -- Richard =3D=3D=3D=3D=3D=3D CMakeUserPresets.json { "version": 6, "cmakeMinimumRequired": { "major": 3, "minor": 23, "patch": 0 }, "configurePresets": [ { "name": "default32", "displayName": "Configure with default 32-bit settings", "inherits": [ "with_samples", "with_tests" ], "architecture": { "value": "Win32", "strategy": "set" }, "generator": "Visual Studio 18 2026" } ], "buildPresets": [ { "name": "default32", "displayName": "Build with default 32-bit settings", "configurePreset": "default32" } ], "testPresets": [ { "name": "default32", "displayName": "Test with default 32-bit settings", "configurePreset": "default32", "configuration": "Release", "output": { "outputOnFailure": true } } ], "workflowPresets": [ { "name": "default32", "displayName": "Workflow with default 32-bit settings: configure, bui= ld and test", "steps": [ { "type": "configure", "name": "default32" }, { "type": "build", "name": "default32" }, { "type": "test", "name": "default32" } ] } ] } =3D=3D=3D=3D=3D=3D CMakeUserPresets.json -- "The Direct3D Graphics Pipeline" free book <<a href=3D"https://urldefense.com/v3/__http://tinyurl.com/d3d-pipeline__;!!EAv= W5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJ= EqXphMWUVXTMN1-_BTRwhSl6jkizBAyU$" moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">https://ur= ldefense.com/v3/__http://tinyurl.com/d3d-pipeline__;!!EAvW5M_HCdSncw!LpYv-O= QnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BT= RwhSl6jkizBAyU$</a>> The Terminals Wiki <<a href=3D"https://urldefense.com/v3/__http://terminals-wiki.org__;!!EAvW5M_HC= dSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphM= WUVXTMN1-_BTRwhSl6jVzAfTTU$" moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">https://ur= ldefense.com/v3/__http://terminals-wiki.org__;!!EAvW5M_HCdSncw!LpYv-OQnMY-p= BmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6= jVzAfTTU$</a>> The Computer Graphics Museum <<a href=3D"https://urldefense.com/v3/__http://computergraphicsmuseum.org__;!!E= AvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5D= HJEqXphMWUVXTMN1-_BTRwhSl6jSWLvJSI$" moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">https://ur= ldefense.com/v3/__http://computergraphicsmuseum.org__;!!EAvW5M_HCdSncw!LpYv= -OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_= BTRwhSl6jSWLvJSI$</a>> Legalize Adulthood! (my blog) <<a href=3D"https://urldefense.com/v3/__http://legalizeadulthood.wordpress.com_= _;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3C= tlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jjVQsERo$" moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">https://ur= ldefense.com/v3/__http://legalizeadulthood.wordpress.com__;!!EAvW5M_HCdSncw= !LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXT= MN1-_BTRwhSl6jjVQsERo$</a>> --=20 Please read <a href=3D"https://urldefense.com/v3/__https://www.wxwidgets.org/support/mlhow= to.htm__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8G= QaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6j7zHESy4$" moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">https://ur= ldefense.com/v3/__https://www.wxwidgets.org/support/mlhowto.htm__;!!EAvW5M_= HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXp= hMWUVXTMN1-_BTRwhSl6j7zHESy4$</a> before posting. ---=20 You received this message because you are subscribed to the Google Groups "= wx-users" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:wx-users+unsub= [email protected]">[email protected]</a>. To view this discussion visit <a href=3D"https://urldefense.com/v3/__https://groups.google.com/d/msgid/wx-us= ers/E1wiC3S-000000001F9-34MJ*40shell.xmission.com__;JQ!!EAvW5M_HCdSncw!LpYv= -OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_= BTRwhSl6jZZNFy0k$" moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">https://ur= ldefense.com/v3/__https://groups.google.com/d/msgid/wx-users/E1wiC3S-000000= 001F9-34MJ*40shell.xmission.com__;JQ!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn= -GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jZZNFy0k$<= /a>. </pre> </div> -- <br> Please read <a href=3D"https://www.wxwidgets.org/support/mlhowto.htm" moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">https://ww= w.wxwidgets.org/support/mlhowto.htm</a> before posting.<br> --- <br> You received this message because you are subscribed to the Google Groups "wx-users" group.<br> To unsubscribe from this group and stop receiving emails from it, send an email to <a href=3D"mailto:[email protected]" moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">wx-users+u= [email protected]</a>.<br> To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/wx-users/AS4PR10MB61106EE357E0589= CD869A3B59EFD2%40AS4PR10MB6110.EURPRD10.PROD.OUTLOOK.COM?utm_medium=3Demail= &utm_source=3Dfooter" moz-do-not-send=3D"true">https://groups.google.com/d/msgid/wx-users= /AS4PR10MB61106EE357E0589CD869A3B59EFD2%40AS4PR10MB6110.EURPRD10.PROD.OUTLO= OK.COM</a>.<br> </blockquote> <br> </body> </html> <p></p> -- <br /> Please read <a href=3D"https://www.wxwidgets.org/support/mlhowto.htm">https= ://www.wxwidgets.org/support/mlhowto.htm</a> before posting.<br /> --- <br /> You received this message because you are subscribed to the Google Groups &= quot;wx-users" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:[email protected]">wx-users+u= [email protected]</a>.<br /> To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/= wx-users/6af31d1f-1716-4cf6-8ac4-4aaca1a0c7b3%40gmail.com?utm_medium=3Demai= l&utm_source=3Dfooter">https://groups.google.com/d/msgid/wx-users/6af31d1f-= 1716-4cf6-8ac4-4aaca1a0c7b3%40gmail.com</a>.<br /> --------------VxZ0y0CffpV70MG26iQrrWjM--