读书人

请在devc++里用过wxWidgets的朋友进来

发布时间: 2012-02-06 15:52:44 作者: rapoo

求助:请在devc++里用过wxWidgets的朋友进来帮帮忙,我装不来!
我的操作系统是winXP,我用的编译器是devc++4.9.9.2,安装目录为d:\program\dev-cpp,我最近想试试wxWidgets,就去下载了wxMSW-2.8.0-Setup.exe,有12.4MB,下载后安装在d:\program\wxW,完了我按照d:\program\wxW\docs\msw\install.txt中的提示进行安装,只进行了一点儿,我在文中插了中文说明(前面加了 "// "),文章中关于Cygwin/MinGW的一段为:


Cygwin/MinGW compilation
----------------------------

wxWidgets supports Cygwin (formerly GnuWin32) betas and
releases, and MinGW. Cygwin can be downloaded from:

http://sources.redhat.com/cygwin/

and MinGW from:

http://www.mingw.org/

Both Cygwin and MinGW can be used with configure (assuming you have MSYS
installed in case of MinGW). You will need new enough MinGW version, preferably
MinGW 2.0 (ships with gcc3) or at least 1.0 (gcc-2.95.3). GCC versions older
than 2.95.3 don 't work; you can use wxWidgets 2.4 with them.

NOTE: some notes specific to old Cygwin ( < 1.1.x) are at the end of this
section (see OLD VERSIONS)

There are two methods of compiling wxWidgets, by using the
makefiles provided or by using 'configure '.

Retrieve and install the latest version of Cygwin, or MinGW, as per
the instructions with either of these packages.

If using MinGW, you can download the add-on MSYS package to
provide Unix-like tools that you 'll need to build wxWidgets using configure.

Using makefiles directly
----------------------------

NOTE: The makefile.gcc makefiles are for compilation under MinGW using
Windows command interpreter (command.com/cmd.exe), they won 't work in
other environments (such as UNIX or Unix-like, e.g. MSYS where you have
to use configure instead, see the section below)

Here are the steps required using the provided makefiles:

- If you are using gcc-2.95, edit build\msw\config.gcc and set the GCC_VERSION
variable to "2.95 ".

- Use the makefile.gcc files for compiling wxWidgets and samples,
e.g. to compile a debugging version of wxWidgets:

//从这里开始

> cd c:\wx\build\msw




//注意:这里我实际进行的是
//path=d:\program\dev-cpp\bin\
//cd d:\program\wxW\build\msw


> make -f makefile.gcc BUILD=debug


//注意:这里我实际进行的是
//mingw32-make.exe -f makefile.gcc BUILD=debug UNICODE=1
//这一步进行了一个多钟头,d:\program\wxW\build\msw下多了个叫gcc_mswud的文件夹,里面1000多 //个文件全是.o和.o.d文件,有354MB


> cd c:\wx\samples\minimal



//注意:这里我实际进行的是
//cd d:\program\wxW\samples\minimal



> make -f makefile.gcc BUILD=debug

//注意:这里我实际进行的是
//mingw32-make.exe -f makefile.gcc BUILD=debug UNICODE=1
//这一步完成后也多了个gcc_mswud的文件夹,里面有个叫minimal.exe的文件,还有几个.o和.o.b文件
//我运行minimal.exe结果系统提示“没有找到mingwm10.dll,因此这个应用程序未能启动。重新安装应 //用程序可能会修复此问题。”我搜了一下文件,这个mingwm10.dll在D:\program\Dev-Cpp\bin里

//以下我看不太懂,所以没有进行!
//请问接下来该怎么弄,另外我还想问一下是不是这个库只能在命令行下弄,能不能整合到devc++的 //IDE里?谢谢帮助!


(See below for more options.)

Ignore the warning about the default entry point.

- Use the 'strip ' command to reduce executable/dll size (note that
stripping an executable/dll will remove debug information!).

All targets have 'clean ' targets to allow removal of object files
and other intermediate compiler files.

Using configure
----------------------------

Instead of using the makefiles, you can use the configure
system to generate appropriate makefiles, as used on Unix
and Mac OS X systems.

Change directory to the root of the wxWidgets distribution,
make a build directory, and run configure and make in this directory.

For example:

cd $WXWIN
mkdir build-debug
cd build-debug
../configure --with-msw --enable-debug --enable-debug_gdb --disable-shared
make
make install % This step is optional, see note (6) below.
cd samples/minimal
make
./minimal.exe

Notes:

1. See also the Cygwin/MinGW on the web site or CD-ROM for
further information about using wxWidgets with these compilers.

2. libwx.a is 100 MB or more - but much less if compiled with no


debug info (-g0) and level 4 optimization (-O4).

3. If you get a link error under MinGW 2.95.2 referring to:

EnumDAdvise__11IDataObjectPP13IEnumSTATDATA@8

then you need to edit the file objidl.h at line 663 and add
a missing PURE keyword:

STDMETHOD(EnumDAdvise)(THIS_ IEnumSTATDATA**) PURE;

4. There 's a bug in MinGW headers for some early distributions.

in include/windows32/defines.h, where it says:

#define LPSTR_TEXTCALLBACKA (LPSTR)-1L)

it should say:

#define LPSTR_TEXTCALLBACKA ((LPSTR)-1L)

(a missing bracket).

5. OpenGL support should work with MinGW as-is. However,
if you wish to generate import libraries appropriate either for
the MS OpenGL libraries or the SGI OpenGL libraries, go to
include/wx/msw/gl and use:

dlltool -k -d opengl.def -llibopengl.a

for the SGI DLLs, or

dlltool -k -d opengl32.def -llibopengl32.a

and similarly for glu[32].def.

6. The 'make install ' step is optional, and copies files
as follows:

/usr/local/lib - wxmswXYZd.dll.a and wxmswXYZd.dll
/usr/local/include/wx - wxWidgets header files
/usr/local/bin - wx-config

You may need to do this if using wx-config with the
default root path.

7. With Cygwin, you can invoke gdb --nw myfile.exe to
debug an executable. If there are memory leaks, they will be
flagged when the program quits. You can use Cygwin gdb
to debug MinGW executables.

8. Note that gcc 's precompiled headers do not work on current versions of
Cygwin. If your version of Cygwin is affected you will need to use the
--disable-precomp-headers configure option.

OLD VERSIONS:

- Modify the file wx/src/cygnus.bat (or mingw32.bat or mingegcs.bat)


to set up appropriate variables, if necessary mounting drives.
Run it before compiling.

- For Cygwin, make sure there 's a \tmp directory on your
Windows drive or bison will crash (actually you don 't need
bison for ordinary wxWidgets compilation: a pre-generated .c file is
supplied).

- If using GnuWin32 b18, you will need to copy windres.exe
from e.g. the MinGW distribution, to a directory in your path.

请问接下来该怎么弄,另外我还想问一下是不是这个库只能在命令行下弄,能不能整合到devc++的IDE里?谢谢帮助!

[解决办法]
帮顶
接分!

读书人网 >C++

热点推荐