wxWindows Link Error Fix for DLL Build

wxWindows Link Error Fix for DLL Build

By: Adrian Lanning

Date: 05 / 06 / 03

Email: alanning55@hotmail.com

Motivation

Ok, I recently built wxWindows as a DLL and had major trouble getting my Hello World program to link.
This document describes the solutions to those problems as well as how I found them.

Build Configuration

Visual Studio .NET (7)
wxWindows built as Release DLL

Problem

If you get the following linker errors when compiling wxWindows apps:

Solution

Method 1:
  #Define WXUSINGDLL

Method 2:
  Add WXUSINGDLL to your preprocessor definitions:
    (Right-click on your project, Properties, C/C++, Preprocessor.)

How I Fixed This

After unsuccessfully searching the web for a solution to this problem, I went step-by-step through the widget sample app project properties (which did compile and link properly) until I found the problem. Not the most elegant way to find a solution, but...

Here's the complete preprocessor definitions for the widget project:

NDEBUG,WIN32,_WINDOWS,WINVER=0x400,_MT,
wxUSE_GUI=1,WXUSINGDLL