Review: In the previous one, I introduced how to make a package file and create a customized project. Let me introduce the installation of WXWIDGET as follows. This article is suitable for DEV-CPP and MINGW32 compilers.
Chapter 14 WXWIDGET Download and Installation
This chapter I will introduce you how to download the WXWIDGET this GUI development library. First, we must know first, we use wxwidget under Win32. So, we have to download the WXMsw now. MSW I think you know what it means. Until this article wrote that the latest version of WXMsw is 2.5.3. Now you can download from www.sf.net, or download it as follows. Http://umn.dl.sourceforge.net/sourceforge/wxwindows/wxmsw-2.5.3.zip. all the same. I usually like to download with umn.dl.sourceforge.net. Get preferred. Also, wsmsw-2.5.3.zip is a free-installed WX. Another wxmsw-2.5.3-setup.zip is required to install. The difference is not too hit. If you ask me, I prefer wxmsw-2.5.3.zip. Then we create a directory wxwidget-2.5.3 on your drive. And extract the files in the compressed package into this directory. Be careful to decompress all. Of course, if you want to know less, you can solve the following folders and files. However, note that the path cannot be changed. Otherwise, the trouble is big. (That is, the original path is build / msw / makefile.vc you can't use Makfile.vc)
Build / MSW / config.gccbuild / msw / makfile.gcc
INCLUDE / LIB / SRC /
There is also a Contrib to this directory is not very important. At least you will not use it in us. If you need you can unlock, it is usually only compiled when you need it.
This way our library is installed. Of course, if you are a friend of DEV-CPP. You can set the parameters of the project according to the custom project I introduced earlier. Here, we join in the compiler parameters
-I (installation directory) / incrude /
Connector parameters join
-L (installation directory) / lib /
Ok, this chapter is here.
Chapter 15 Compilation and Using WXWIDGET Compiler
Now let's enter build / msw with cmd.com. If you set it in the way I introduced in the first chapter. Initiate
Make -f makefile.gcc
Let Make to compile the program. After a bursary. Even if you have installed wxwidget. This is what we entered the Demo / Bombs / this directory.
Make -f makefile.gcc
You can try the result of our compilation. You can use the compilation parameters of the prompt as the link parameters and compile parameters to use MingW32 to compile their own projects.
Once the compilation is completed, you will see a file Bombs in the Bombs's GCC_Debug directory. When you run, a sweeping mine appears. (I have never played mine, maybe my IQ is not high). Maybe you will see the volume of the file ... Wow! You will find that this program is 12MB so big ... You don't have to be afraid, because this is a commissioned library. So add a lot of debugging content. 12MB should also be.
Ok, now let's compile a small WXWIDGET library. Still, we use a parameter when compiling. We entered in Build / MSW /
Make -f makefile.gcc build = release
Ok, we can get the release library. Similarly, compile Bombs to see. Enter the GCC_RELEASE directory, the program is running, but the volume is small. If compressed, the program will be less than 1MB. However, we have to smaller smaller libraries. Usually, most of the online most of the above two compilation methods are quite good. Usually only the first one. Let me introduce a relatively special compilation method.
If you use MFC, you will know that in fact, MFC uses a dynamic link library, which can increase the utilization of repetition code. If you update the main program, you don't need to update the content of the dynamic library. So, I will introduce how to build WXWIDGET in the dynamic link library. Also we have to enter the build / msw / directory. Also use Make. enter
Make -f makefile.gcc build = release shared = 1
First of all, pay attention, in addition, the Release parameter is necessary, otherwise the terrible dinosaur file will be generated. But the disadvantage is that WXWIDGET cannot be debugged. After a period of compilation, we will get a dynamic link library and library files in lib / gcc_dll. If you want to use long-term use, copy * .dll to ~ / system32 / directory. Or set the PATH value to be the directory. Next, let's compile BMBS test. enter
Make -f makefile.gcc build = release shared = 1
This time we will find Bombs in the GCC_DLL directory. If you are running, you will see an error message. Of course, if you copy the dynamic link library to the / system32 / directory, you won't see it. We will see the program interface after copying Bombs.exe to the lib / gcc_dll / directory. But ... look at the volume ... my day, more than 100 KB. It's enough. We use this development wxwidget ^ _ ^
The following is listed below to create custom projects for the parameters of the compiler and connector.
Compiler parameters: -O2 -DHAVE_W32API_H -D__WXMsw__ -i (wxwidgets) / include -i (wxwidgets) / lib / gcc_dll / msw -wall -i. -Dwxusingdll -i (wxwidgets) / Samples -DnoPCH
Connection parameter: -mthreads -L (wxWidgets) / lib / gcc_dll -Wl, - subsystem, windows -mwindows -lwxmsw25_core -lwxbase25 -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregex -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 - Lwinspool -Lwinmm -lshell32 -lcomctL32 -LOLE32 -LOLEAUT32 -LUUID -LRPCRT4 -LADVAPI32 -LWSOCK32 -LODBC32
Where wxWidgets represent you install WXWIDGET.
Ok, this trip to the wxwidget is here. I hope that you can success since the third step.
Textual sound: In fact, I have long like to use wxwidget, but the generated file is really scary. So it is too late to use it. Later, it turned with GTK. However, I also study how the wxwidget is shrunk. So, this time I thoroughly narrowed the volume of the file. It's a great blessing. However, if you find any questions when compiling. It is best to leave your email address after my Blog response file, so I can reply you at the fastest speed. At the same time, I hope you can pay attention to my article. http://blog.9cbs.net/visioncat/. Of course, this series has not yet ended yet. Still in complement. Because it is very busy in the previous period, there is no update in a few months to cause someone to think that my article is over. Ha, sorry. Supplement: From the reader's reply, it is not very clear that it is still not very clear. So do a small supplement here. The reader proposed to give an example of a simpler WXWidget. So, I give a simple makefile file here and a main.cpp file to you. # Makefile.txt # This makefile is a wxwidget with DLL to use the WXPATH parameters. -I $ (wxpath) / lib / gcc_dll / msw -wall -i. -Dwxusingdll -i $ (wxpath) / samples -dnopch lf = -mthreads -l $ (wxath) / lib / gcc_dll -wl, - subsystem, windows -mwindows -lwxmsw25_core -lwxbase25 -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregex -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 # Makefile End //main.cpp// This file is a main program using DLL's wxwidget, is a window (blank) #include
Studio Software Development Group (SDT) Studio Development Team Beidou Star (Huang Yuxi)