Re: Linker error for Win32 app with MSVS2026

Richard <[email protected]> Fri, 10 Jul 2026 08:18:14 -0600
Newsgroups gmane.comp.lib.wxwindows.general
Organization multi-cellular, biological
Message-ID <[email protected]>
In article <AS4PR10MB6110B236328ACF072C56B7659EFD2@AS4PR10MB6110.EURPRD10.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 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

====== 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"
        }
      ]
    }
  ]
}
====== CMakeUserPresets.json

--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
            The Terminals Wiki <http://terminals-wiki.org>
     The Computer Graphics Museum <http://computergraphicsmuseum.org>
  Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm 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 to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/wx-users/E1wiC3S-000000001F9-34MJ%40shell.xmission.com.