R: Linker error for Win32 app with MSVS2026

Gatti Gianluca <[email protected]> Fri, 10 Jul 2026 14:26:47 +0000
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <AS4PR10MB61106EE357E0589CD869A3B59EFD2@AS4PR10MB6110.EURPRD10.PROD.OUTLOOK.COM>
--_000_AS4PR10MB61106EE357E0589CD869A3B59EFD2AS4PR10MB6110EURP_
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thank you, but with the MSVS compiler I prefer to use the "Visual Studio" w=
ay to manage the building of the project than the cmake one.
On the other hand, for the x64 platform and the relative wxWidgets pre-buil=
t binary it works; so I don't understand why it couldn't work for the x86 (=
Win32) platform.

=E2=80=82=E2=80=82=E2=80=82=E2=80=82Gianluca
________________________________
Da: [email protected] <[email protected]> per conto di Rich=
ard <[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 <AS4PR10MB6110B236328ACF072C56B7659EFD2@=E2=80=8AAS4PR10MB6110.=
=E2=80=8AEURPRD10.=E2=80=8APROD.=E2=80=8AOUTLOOK.=E2=80=8ACOM> you write: >=
I was trying to build a (simple) wxWidgets application for x86 platform. >T=
herefore, 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]=
ROD.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 LNK2002
>"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 <https://urldefense.com/v3/__htt=
p://tinyurl.com/d3d-pipeline__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-Gnao=
JqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jkizBAyU$>
            The Terminals Wiki <https://urldefense.com/v3/__http://terminal=
s-wiki.org__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy=
2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jVzAfTTU$>
     The Computer Graphics Museum <https://urldefense.com/v3/__http://compu=
tergraphicsmuseum.org__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_W=
SZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jSWLvJSI$>
  Legalize Adulthood! (my blog) <https://urldefense.com/v3/__http://legaliz=
eadulthood.wordpress.com__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-=
W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jjVQsERo$>

--
Please read https://urldefense.com/v3/__https://www.wxwidgets.org/support/m=
lhowto.htm__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy=
2m8GQaHJ_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 e=
mail to [email protected].
To view this discussion visit https://urldefense.com/v3/__https://groups.go=
ogle.com/d/msgid/wx-users/E1wiC3S-000000001F9-34MJ*40shell.xmission.com__;J=
Q!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ct=
lj5DHJEqXphMWUVXTMN1-_BTRwhSl6jZZNFy0k$.

--=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/AS=
4PR10MB61106EE357E0589CD869A3B59EFD2%40AS4PR10MB6110.EURPRD10.PROD.OUTLOOK.=
COM.

--_000_AS4PR10MB61106EE357E0589CD869A3B59EFD2AS4PR10MB6110EURP_
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
Thank you, but with the MSVS compiler I prefer to use the &quot;Visual Stud=
io&quot; way to manage the building of the project than the cmake one.</div=
>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
On the other hand, for the x64 platform and the relative wxWidgets pre-buil=
t 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_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
=E2=80=82=E2=80=82=E2=80=82=E2=80=82Gianluca<br>
</div>
<div id=3D"appendonsend"></div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>Da:</b> [email protected]=
om &lt;[email protected]&gt; per conto di Richard &lt;legalize@xmis=
sion.com&gt;<br>
<b>Inviato:</b> venerd=C3=AC 10 luglio 2026 16:18<br>
<b>A:</b> [email protected] &lt;[email protected]&gt;<br>
<b>Oggetto:</b> Re: Linker error for Win32 app with MSVS2026</font>
<div>&nbsp;</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; overf=
low:hidden">
In article &lt;AS4PR10MB6110B236328ACF072C56B7659EFD2@=E2=80=8AAS4PR10MB611=
0.=E2=80=8AEURPRD10.=E2=80=8APROD.=E2=80=8AOUTLOOK.=E2=80=8ACOM&gt; you wri=
te: &gt;I was trying to build a (simple) wxWidgets application for x86 plat=
form. &gt;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; overf=
low:hidden">
ZjQcmQRYFpfptBannerStart</div>
<div dir=3D"ltr" lang=3D"en" id=3D"x_pfptBanneriaynuv6" style=3D"display:bl=
ock!important; text-align:left!important; margin:0 0 10px 0!important; padd=
ing:7px 16px 8px 16px!important; border-radius:4px!important; min-width:200=
px!important; background-color:#f9d374!important; background-color:#f9d374;=
 border-top:4px solid #beb3a1!important; border-top:4px solid #beb3a1">
<div id=3D"x_pfptBanneriaynuv6" style=3D"float:left!important; display:bloc=
k!important; margin:1px 0 1px 0!important; max-width:600px!important">
<div id=3D"x_pfptBanneriaynuv6" style=3D"display:block!important; visibilit=
y:visible!important; background-color:#f9d374!important; color:#000000!impo=
rtant; color:#000000; font-family:'Arial',sans-serif!important; font-family=
:'Arial',sans-serif; font-weight:bold!important; font-weight:bold; font-siz=
e: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; visibilit=
y:visible!important; background-color:#f9d374!important; color:#000000!impo=
rtant; color:#000000; font-weight:normal; font-family:'Arial',sans-serif!im=
portant; font-family:'Arial',sans-serif; font-size:12px!important; line-hei=
ght: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:hid=
den!important; line-height:0!important; font-size:0.01px!important; height:=
0px">
&nbsp;</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; overf=
low:hidden">
ZjQcmQRYFpfptBannerEnd</div>
<style>
<!--
#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 &lt;AS4PR10MB6110B236328ACF072C56B7659EFD=
[email protected]&gt; you write:
&gt;I was trying to build a (simple) wxWidgets application for x86 platform=
.
&gt;Therefore, I built wxWidgets from source: I choose wx_vc18 solution and
&gt;built it as DLL Release - Win32.
&gt;I extracted the wxWidgets source code .zip in the folder C:\wx\source_3=
.3.3
&gt;
&gt;When compiling my app, I got a lot of linker error, in particular LNK20=
02
&gt;&quot;unresolved external symbol...&quot;

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
{
  &quot;version&quot;: 6,
  &quot;cmakeMinimumRequired&quot;: {
    &quot;major&quot;: 3,
    &quot;minor&quot;: 23,
    &quot;patch&quot;: 0
  },
  &quot;configurePresets&quot;: [
    {
        &quot;name&quot;: &quot;default32&quot;,
        &quot;displayName&quot;: &quot;Configure with default 32-bit settin=
gs&quot;,
        &quot;inherits&quot;: [
            &quot;with_samples&quot;,
            &quot;with_tests&quot;
        ],
        &quot;architecture&quot;: {
          &quot;value&quot;: &quot;Win32&quot;,
          &quot;strategy&quot;: &quot;set&quot;
        },
        &quot;generator&quot;: &quot;Visual Studio 18 2026&quot;
    }

  ],
  &quot;buildPresets&quot;: [
    {
      &quot;name&quot;: &quot;default32&quot;,
      &quot;displayName&quot;: &quot;Build with default 32-bit settings&quo=
t;,
      &quot;configurePreset&quot;: &quot;default32&quot;
    }

  ],
  &quot;testPresets&quot;: [
    {
      &quot;name&quot;: &quot;default32&quot;,
      &quot;displayName&quot;: &quot;Test with default 32-bit settings&quot=
;,
      &quot;configurePreset&quot;: &quot;default32&quot;,
      &quot;configuration&quot;: &quot;Release&quot;,
      &quot;output&quot;: {
        &quot;outputOnFailure&quot;: true
      }
    }
  ],
  &quot;workflowPresets&quot;: [
    {
      &quot;name&quot;: &quot;default32&quot;,
      &quot;displayName&quot;: &quot;Workflow with default 32-bit settings:=
 configure, build and test&quot;,
      &quot;steps&quot;: [
        {
          &quot;type&quot;: &quot;configure&quot;,
          &quot;name&quot;: &quot;default32&quot;
        },
        {
          &quot;type&quot;: &quot;build&quot;,
          &quot;name&quot;: &quot;default32&quot;
        },
        {
          &quot;type&quot;: &quot;test&quot;,
          &quot;name&quot;: &quot;default32&quot;
        }
      ]
    }
  ]
}
=3D=3D=3D=3D=3D=3D CMakeUserPresets.json

--
&quot;The Direct3D Graphics Pipeline&quot; free book &lt;<a href=3D"https:/=
/urldefense.com/v3/__http://tinyurl.com/d3d-pipeline__;!!EAvW5M_HCdSncw!LpY=
v-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-=
_BTRwhSl6jkizBAyU$">https://urldefense.com/v3/__http://tinyurl.com/d3d-pipe=
line__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQa=
HJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jkizBAyU$</a>&gt;
            The Terminals Wiki &lt;<a href=3D"https://urldefense.com/v3/__h=
ttp://terminals-wiki.org__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-=
W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jVzAfTTU$">https://=
urldefense.com/v3/__http://terminals-wiki.org__;!!EAvW5M_HCdSncw!LpYv-OQnMY=
-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhS=
l6jVzAfTTU$</a>&gt;
     The Computer Graphics Museum &lt;<a href=3D"https://urldefense.com/v3/=
__http://computergraphicsmuseum.org__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYg=
zn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jSWLvJSI=
$">https://urldefense.com/v3/__http://computergraphicsmuseum.org__;!!EAvW5M=
_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqX=
phMWUVXTMN1-_BTRwhSl6jSWLvJSI$</a>&gt;
  Legalize Adulthood! (my blog) &lt;<a href=3D"https://urldefense.com/v3/__=
http://legalizeadulthood.wordpress.com__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGi=
yYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jjVQs=
ERo$">https://urldefense.com/v3/__http://legalizeadulthood.wordpress.com__;=
!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctl=
j5DHJEqXphMWUVXTMN1-_BTRwhSl6jjVQsERo$</a>&gt;

--=20
Please read <a href=3D"https://urldefense.com/v3/__https://www.wxwidgets.or=
g/support/mlhowto.htm__;!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_W=
SZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6j7zHESy4$">https://url=
defense.com/v3/__https://www.wxwidgets.org/support/mlhowto.htm__;!!EAvW5M_H=
CdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXph=
MWUVXTMN1-_BTRwhSl6j7zHESy4$</a> before posting.
---=20
You received this message because you are subscribed to the Google Groups &=
quot;wx-users&quot; group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit <a href=3D"https://urldefense.com/v3/__https:=
//groups.google.com/d/msgid/wx-users/E1wiC3S-000000001F9-34MJ*40shell.xmiss=
ion.com__;JQ!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WSZ8vST3sZXy2=
m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jZZNFy0k$">https://urldefense.com/=
v3/__https://groups.google.com/d/msgid/wx-users/E1wiC3S-000000001F9-34MJ*40=
shell.xmission.com__;JQ!!EAvW5M_HCdSncw!LpYv-OQnMY-pBmOGiyYgzn-GnaoJqP-W_WS=
Z8vST3sZXy2m8GQaHJ_3Ctlj5DHJEqXphMWUVXTMN1-_BTRwhSl6jZZNFy0k$</a>.
</pre>
</div>
</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&quot; 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/AS4PR10MB61106EE357E0589CD869A3B59EFD2%40AS4PR10MB6110.EURPRD10.PR=
OD.OUTLOOK.COM?utm_medium=3Demail&utm_source=3Dfooter">https://groups.googl=
e.com/d/msgid/wx-users/AS4PR10MB61106EE357E0589CD869A3B59EFD2%40AS4PR10MB61=
10.EURPRD10.PROD.OUTLOOK.COM</a>.<br />

--_000_AS4PR10MB61106EE357E0589CD869A3B59EFD2AS4PR10MB6110EURP_--