sudo apt-get install wx-headers libwxbase2.8-0 libwxbase2.8-dev
g++ main.cpp `wx-config --libs` `wx-config --cxxflags`
A record of solutions to when I get stuck on some problem. When I think 'I know I have found the answer to this before' I can just search my blog.
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="utf8_basic"
ProjectGUID="{2FA27B9E-AB18-4225-BF22-3D6042C2D6B6}"
RootNamespace="utf8_basic"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""C:\Server\wxWidgets-2.8.10\include\msvc";"C:\Server\wxWidgets-2.8.10\include""
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WINVER=0x0400;__WXMSW__ ;_WINDOWS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib advapi32.lib wsock32.lib wxbase28ud.lib wxmsw28ud_core.lib"
LinkIncremental="2"
AdditionalLibraryDirectories=""C:\Server\wxWidgets-2.8.10\lib\vc_lib""
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories=""C:\Server\wxWidgets-2.8.10\include\msvc";"C:\Server\wxWidgets-2.8.10\include""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WINVER=0x0400;__WXMSW__ ;_WINDOWS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib advapi32.lib wsock32.lib wxbase28u.lib wxmsw28u_core.lib"
LinkIncremental="1"
AdditionalLibraryDirectories=""C:\Server\wxWidgets-2.8.10\lib\vc_lib""
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\main.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
//Project Properties:
//http://wiki.wxwidgets.org/Microsoft_Visual_CPP_Guide
//General>Charset: Use Unicode Character Set (or ansi:not set)
//Include: "C:\Server\wxWidgets-2.8.10\include\msvc";"C:\Server\wxWidgets-2.8.10\include"
//Library: "C:\Server\wxWidgets-2.8.10\lib\vc_lib"
//[preprocessor defines:] WINVER=0x0400;__WXMSW__ ;_WINDOWS
//[linker system subsystem:] Windows (/SUBSYSTEM:WINDOWS)
//[linker libraries (all ):] comctl32.lib rpcrt4.lib winmm.lib advapi32.lib wsock32.lib
//[linker libraries (debug ):] wxbase28ud.lib wxmsw28ud_core.lib
//[linker libraries (release):] wxbase28u.lib wxmsw28u_core.lib
//File > Advanced Save Options > UTF8 with signature, CRLF
#include <wx/wx.h>
class MyApp : public wxApp
{
public:
virtual bool OnInit();
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
wxFrame *simple = new wxFrame(NULL, wxID_ANY, wxT("你好"), wxDefaultPosition, wxSize(250, 150));
simple->Centre();
simple->Show(true);
return true;
}
[ansi] wxexpatd.lib wxexpat.lib wxjpegd.lib wxjpeg.lib wxpngd.lib wxpng.lib wxtiffd.lib wxtiff.lib wxzlibd.lib wxzlib.lib wxregexd.lib wxregex.lib wxbase28d.lib wxbase28.lib wxbase28d_odbc.lib wxbase28_odbc.lib wxbase28d_net.lib wxbase28_net.lib wxbase28d_xml.lib wxbase28_xml.lib wxmsw28d_adv.lib wxmsw28_adv.lib wxmsw28d_aui.lib wxmsw28_aui.lib wxmsw28d_core.lib wxmsw28_core.lib wxmsw28d_dbgrid.lib wxmsw28_dbgrid.lib wxmsw28d_gl.lib wxmsw28_gl.lib wxmsw28d_html.lib wxmsw28_html.lib wxmsw28d_media.lib wxmsw28_media.lib wxmsw28d_qa.lib wxmsw28_qa.lib wxmsw28d_richtext.lib wxmsw28_richtext.lib wxmsw28d_xrc.lib wxmsw28_xrc.lib [unicode] wxregexud.lib wxregexu.lib wxbase28ud.lib wxbase28u.lib wxbase28ud_odbc.lib wxbase28u_odbc.lib wxbase28ud_net.lib wxbase28u_net.lib wxbase28ud_xml.lib wxbase28u_xml.lib wxmsw28ud_adv.lib wxmsw28u_adv.lib wxmsw28ud_aui.lib wxmsw28u_aui.lib wxmsw28ud_core.lib wxmsw28u_core.lib wxmsw28ud_dbgrid.lib wxmsw28u_dbgrid.lib wxmsw28ud_gl.lib wxmsw28u_gl.lib wxmsw28ud_html.lib wxmsw28u_html.lib wxmsw28ud_media.lib wxmsw28u_media.lib wxmsw28ud_qa.lib wxmsw28u_qa.lib wxmsw28ud_richtext.lib wxmsw28u_richtext.lib wxmsw28ud_xrc.lib wxmsw28u_xrc.lib