Compile WXWIDGETS with MINGW under WinXP

xiaoxiao2021-03-06  21

It is easy to find N more information a few days ago, compile and install wxwidgets, but because of my perfect tendency, in order to be able to use Dialogblock, I'm deleted this has been deleted, trying to use Dialogblock to re-make, intent This will be "more convenient" in the future, but it didn't think about it. The more got it, the more compiled it three times, and it was not compiled, and it was a waste of time to read this DB document. . .

So, it was more important, but the time has passed, and it has been found - I have forgotten how it is. . .

.

Fortunately, after all, I have done it once, and this time I have a lot of time. Considering what kind of stupid thing will be made in the future - no way, learning is going to do more "need to learn" things - so write articles here, it is convenient.

I am using the WinXP system, MingW Msys, WXWidgets 2.5, also installed Borland C Builderx, Eclipse, VC6SP5. My development is to initially adapt to the use of Eclipse to do IDE, partial function, debugging using BCBX, if these two are used without pleasure, use VC. No way, the reason is not what I am not looking for, but it is not easy now. With the present, it seems that Eclipse may have greater developments, and provide the original code, you can personalize more, but now the function is still limited, there is still a touch of CDT; although BCBX is very good, this version Too junior, not easy, and I can get the documents and information, learning is more laborious, but I am looking forward to x2; VC This is "the nose ancestor", but after all, it is an early development, all aspects. It's more troublesome, wxwidgets are not M $'s things, I don't want to be angry with him, then, I am just a good school rookie, and there is not much feelings for VC. Anyway, with my experience, more things are better than in a tree, the rookie - China is good, I am afraid that there is not so much resources abroad, so the Chinese is working - using resources

.

Yes, Dialogblock is ready to use it to help learn WXWIDGETS. This is something similar to RAD, and the function has no real RAD, but it is also very good. Personally feel that WXWIDGETS is the best in various graphical development tools, at least will not be able to learn.

well, let's get back to business.

Mingw, Msys, WXWIDEGTS can get more in SourceForge, there is not much to say. To talk about: New Year's new weather, since January 1, 2005, Chinese Great Firewall has finally opened a door to the website of the major Open Source projects, so that we can successfully access the official website of open source software. The first-hand news and information, not as before, it is very good to be a very profitable country, but it is really poor, learn something, and foreigners don't let you learn To learn English, pay the tuition fee; the Chinese government is also inexplicably unsatisfactory, and the left is reviewed, the right shield is all "politically good, professional xxx". . . I remember the most famous for a while, I don't know that idiot, I don't know what it is, I have given the famous OCW. . . I used to look at Google, I went to complain about Baidu; huh, I thought it was, if I had an OCW, it should be a Tsinghua. . . There is no way, let us wait for Marx and write a "collagen", reveal the "Communist Monopoly Economy for the Practice of Practice". . . . . . Ok, let me talk about it, I am also a good young man in the party, support the people, support the party, and send some complaints, but pay attention to not being used by hostile forces, huh. Install MINGW, there is an exe file, and it will become, then MSYS, also EXE, double-click the installation. Personally suggests that there will be command line tips when installing MSYS, you want you to specify the path of mingw, and specify it. I don't know where I want to find some time. Both MINGW and MSYS do not provide an overall update before the overall update, only the local update of ZIP, so you want to use the latest subroutine, just replace the ZIP package, 7-zip seat Nice.

Then you can compile things, here you should pay attention, you need to set some path PATH. In this regard, if you have any questions, you can look at the article installing Eclipse, C DEV, and I will come directly from elsew. Copy. I also use this.

PATH: C: / mingw / bin;

Library_path: C: / MingW / LIB

C_INCLUDE_PATH: C: / MINGW / INCLUDE

CPLUS_INCLUDE_PATH: C: / MingW / Include / C / 3.2.3; C: / Mingw / Include / C / 3.2.3 / MingW32;

C: / mingw / include / c / 3.2.3 / backward; c: / mingw / include

In this way, the compiled instruction / program can be called directly in the command line. Ok, start building WXWIDGETS. WX supports two ways to set the file properties of the variation, one is to use Makefile directly to build compilation under the command line cmd.exe; another, is set in MSYS to set it with configure, then compile. Remember, the former approach allows users to have multiple WX libraries, such as having debug and release versions, as long as they add attributes, they can distinguish (more details); latter, then When compiling your own procedure, it is more convenient to distinguish between the version. After compiling, the lib can install, become the default library, of course, if you want to use the library of other features, you will be in Configure. (Disclaimer: I remember the first time I saw WX, but I didn't know this article, so I didn't guarantee anything. I used Makefile. I also make a semi-solving for Linux. If there is something wrong, please praise the prawn.) The command is as follows: CD E: / cpptools / wxwidgets / build / msw (Installation path E: / cppletools / wxwidgets) mingw32-make -f makefile.gcc build = Debug unicode = 1, wait, about half an hour to an hour, you need more than 700 M space, you can compile it. It is important to note that because I have installed BCBX before I first install Make Program of BCBX (BCB5.6) called Make, so Maken's Make program is now called MingW32-Make, you can change your name, or so Use, but don't mix, this is not a compiler. Yes, in addition, using MingW32-Make in Eclipse CDT is more troublesome, it is inconvenient, especially when you have a make (these two can be in Path, Eclipse is impossible), you can write A BAT file, define a temporary PATH path to block the path of the BCB, then copy a MingW32-Make to change the name Make. The attribute item behind makefile.gcc is written behind the install.txt file, the handsome guys used there to be so common, I am probably here. Basic Options ------------- build = debug compiles the debug version, because the debugging information is added, so the file is relatively large. Builds debug version of the library (default is 'release'). This affects name of the library ( 'd' is appended), __WXDEBUG__ is defined and debug information compiled into object files and the executable.

Shared = 0 Generates the version of the dynamic link library. The dynamic link library is very useful, especially when using the LGPL development library, it is necessary to become a dynamic library. Build Static Libraries Instead of Dlls. By Default, Dlls Are Built (Shared = 1).

Unicode = 1 I am Chinese, naturally choose this, it is to pay attention to what you should pay attention to, but it is always not used to it. To Build Unicode Versions of the Libraries, add unicode = 1 to make invocation (default is uncode = 0). If you want to be aable to use unicode version on windows9x, you will need to set mslu = 1 as Well.

This Option Affect Name of the library ('u' is appended) and the directory where the library and setup.h area store (ditto).

WXUniv = 1 is not to use Native style using Native, using a unified style - it feels uncomfortable with people, but the post-development is convenient, thinking that there is no need to consider the positioning of various GUI elements. Problem. Build wxuniversal instead of native wxmsw (see http://www.wxwidgets.org/wxuniv.htm for more information).

Advanced Options ------------------

Monolithic = 1 varies all the libraries in a file. Starting with version 2.5.1, wxWidgets has the ability to be built as several smaller libraries instead of single big one as used to be the case in 2.4 and older versions. This is called "multilib build" and is the default behaviour of makefiles. You Can Still Build Single Library ("Monolithic Build") by Setting Monolithic Variable To 1.

Use_gui = 0 Do not use the GUI mode, write the program of the command line. Disable building GUI parts of the library, build only wxBase components used by console applications. Note that if you leave USE_GUI = 1 then both wxBase and GUI libraries are built. If you are building monolithic library, then you should set wxUSE_GUI to 1 in setup .

USE_OPENGL = 1 comes with opengl support Build wxmsw25_gl.lib library with OpenGL integration class wxGLCanvas. You must also modify your setup.h to #define wxUSE_GLCANVAS 1. Note that OpenGL library is always built as additional library, even in monolithic build!

USE_ODBC = 1 comes with odbc support Build two additional libraries in multilib mode, one with database classes and one with wxGrid database support. You must #define wxUSE_ODBC 1 in setup.hUSE_HTML = 0 no html library Do not build wxHTML library. If MONOLITHIC = 1, then you must also #define wxuse_html 1 in setup.h.

USE_XRC = 0 does not need an XRC library. XRC is WX to avoid XML-based user interface tag language provided in different systems on different GUI systems on different GUI systems, to solve problems by defining different XML patterns on different systems, a bit similar to Skin. And XUL is also a bit similar to XAML. Do Not Build Xrc Resources Library. If Monolithic = 1, The You Must Also #define wxuse_html 1 in setup.h.

Runtime_libs = static does not understand. Links static version of C and C runtime libraries into the executable, so that the program does not depend on DLLs provided with the compiler (eg Visual C 's msvcrt.dll or Borland's cc3250mt.dll) Caution:. Do not use static runtime libraries when building DLL (Shared = 1)!

MSlu = 1 Don't worry about people who have a trouble to develop Win98 programs. Enables MSLU (Microsoft Layer for Unicode). This setting makes sense only if used together with UNICODE = 1. If you want to be able to use Unicode version on Windows9x, you will need MSLU (Microsoft Layer for Unicode) runtime DLL and import lib . The former can be downloaded from Microsoft, the latter is part of the latest Platform SDK from Microsoft (see msdn.microsoft.com for details). An alternative implementation of import library can be downloaded from http://libunicows.sourceforge.net - Unlike The Official One, this One Works Worts Other Compilers and Does Not Require 300 MB Platform SDK Update.

DEBUG_FLAG = 0DEBUG_FLAG = 1 If set to 1, define __WXDEBUG__ symbol, append 'd' to library name and do sanity checks at runtime. If set to 0, do not do it. By default, this is governed by BUILD option (if 'debug', DEBUG_FLAG = 1, if 'release' it is 0), but it is sometimes desirable to modify default behaviour and eg define __WXDEBUG__ even in release builds.DEBUG_INFO = 0DEBUG_INFO = 1 Same as DEBUG_FLAG in behaviour, this option affects whether DEBUGGING INCLOTION INCLUDED IN The Executable or Not.

VENDOR = Set this to a short string identifying your company if you are planning to distribute wxWidgets DLLs with your application. Default value is 'custom'. This string is included as part of DLL name. WxWidgets DLLs contain compiler name , version information and vendor name in them. For example wxmsw250_core_bcc_custom.dll is one of DLLs build using Borland C with default settings. If you set VENDOR = mycorp, the name will change to wxmsw250_core_bcc_mycorp.dll.

转载请注明原文地址:https://www.9cbs.com/read-68234.html

New Post(0)