{"id":507,"date":"2014-12-30T19:43:20","date_gmt":"2014-12-31T00:43:20","guid":{"rendered":"http:\/\/jaewon.hwang.info\/jaewon\/?p=507"},"modified":"2014-12-31T09:13:18","modified_gmt":"2014-12-31T14:13:18","slug":"wxwidgets-compiling-wxwidgets-for-ms-windows","status":"publish","type":"post","link":"https:\/\/jaewon.hwang.info\/jaewon\/2014\/12\/wxwidgets-compiling-wxwidgets-for-ms-windows\/","title":{"rendered":"[wxWidgets] Compiling wxWidgets for MS Windows"},"content":{"rendered":"<p>1. Get the latest source code from <a href=\"https:\/\/www.wxwidgets.org\/downloads\/\" target=\"_blank\">https:\/\/www.wxwidgets.org\/downloads\/<\/a> (ver 3.0.2 as of Dec 30, 2014) and unzip it somewhere.<\/p>\n<p>2. Go to <strong>.\/build\/msw<\/strong><\/p>\n<p>3. Compile<br \/>\n&#8211; For MS Visual Studio, find a solution file for your VS version (e.g., wx_vc12.sln) and build.<br \/>\n&#8211; For MinGW, open a cmd window and set the bin folder of MinGW in the beginning of your PATH environment variable, like the following example.<\/p>\n<pre class=\"brush: bash; toolbar: false;\">set \"PATH = C:\\GNU\\mingw64\\bin;%path%\"<\/pre>\n<p>Then, run the following commands, depending on the version you want to build.<\/p>\n<pre class=\"brush: bash; toolbar: false;\">@ release DLL\r\nmkdir ..\\..\\lib\\gcc_dll\\mswu\\wx\r\nmingw32-make -f makefile.gcc CXXFLAGS=\"-std=gnu++11\" BUILD=release SHARED=1 UNICODE=1 MSLU=0 clean\r\nmingw32-make -f makefile.gcc CXXFLAGS=\"-std=gnu++11\" BUILD=release SHARED=1 UNICODE=1 MSLU=0\r\n\r\n@ debug DLL\r\nmkdir ..\\..\\lib\\gcc_dll\\mswud\\wx\r\nmingw32-make -f makefile.gcc CXXFLAGS=\"-std=gnu++11\" BUILD=debug SHARED=1 UNICODE=1 MSLU=0 clean\r\nmingw32-make -f makefile.gcc CXXFLAGS=\"-std=gnu++11\" BUILD=debug SHARED=1 UNICODE=1 MSLU=0\r\n\r\n@ release static LIB\r\nmkdir ..\\..\\lib\\gcc_lib\\mswu\\wx\r\nmingw32-make -f makefile.gcc CXXFLAGS=\"-std=gnu++11\" BUILD=release SHARED=0 UNICODE=1 MSLU=0 clean\r\nmingw32-make -f makefile.gcc CXXFLAGS=\"-std=gnu++11\" BUILD=release SHARED=0 UNICODE=1 MSLU=0\r\n\r\n@ debug static LIB\r\nmkdir ..\\..\\lib\\gcc_lib\\mswud\\wx\r\nmingw32-make -f makefile.gcc CXXFLAGS=\"-std=gnu++11\" BUILD=debug SHARED=0 UNICODE=1 MSLU=0 clean\r\nmingw32-make -f makefile.gcc CXXFLAGS=\"-std=gnu++11\" BUILD=debug SHARED=0 UNICODE=1 MSLU=0<\/pre>\n<p><!--more--><\/p>\n<p><strong>* Additional tips<\/strong><\/p>\n<p>1. The makefile.gcc included in the 3.0.2 version somehow does not create the destination folder correctly, so I added mkdir to the above build commands.<\/p>\n<p>2. C++11 note: If you want to compile wxWidgets in C++11 mode, you currently have to use -std=gnu++11 switch as -std=c++11 disables some extensions that wxWidgets relies on. I.e. please use CXXFLAGS=&#8221;-std=gnu++11&#8243;.<\/p>\n<p>3. The default value for MSLU is supposed to be 0. Without defining it explicitly, however, the resulting library keeps looking for some functions from MSLU, when compiled with MinGW.<br \/>\nMSLU: MS Layer for Unicode. It is only necessary for Windows 95.<\/p>\n<p>4. When you build an application with the static LIB version of wxWidgets, you may want to add -static to your link option. Otherwise, your application would still ask some DLLs from MinGW, not being completely static.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Get the latest source code from https:\/\/www.wxwidgets.org\/downloads\/ (ver 3.0.2 as of Dec 30, 2014) and unzip it somewhere. 2. Go to .\/build\/msw 3. Compile &#8211; For MS Visual Studio, find a solution file for your VS version (e.g., wx_vc12.sln) and build. &#8211; For MinGW, open a cmd window and set the bin folder of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[90],"class_list":["post-507","post","type-post","status-publish","format-standard","hentry","category-computer","tag-wxwidgets"],"_links":{"self":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/posts\/507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/comments?post=507"}],"version-history":[{"count":0,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/posts\/507\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/media?parent=507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/categories?post=507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/tags?post=507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}