|
|

楼主 |
发表于 2005-3-5 15:38:00
|
显示全部楼层
Re:OGRE初学者引导
GCC 3.3 Cygwin/MinGW
Use the following if you don't want to have to setup the whole Dev-C++, but would like to have just a pure Cygwin/MinGW environment. Cygwin is used for it's building system, and since it can nicely cross-compile for MinGW, you will have a build that doesn't depend on Cygwin anymore.
Note: This information is ripped from this thread (http://www.ogre3d.org/phpBB2/viewtopic.php?t=6964) in the the Ogre forums. (thx Lt.CYX & wumpus !)
1) Full cygwin install. Might need to add correct path to /etc/profile - it wasn't created on my first install.
2) get OGRE head from CVS (there is a tutorial on how to do it in the CVS Access section (http://www.ogre3d.org/modules.php?op=modload&name=Sections&file=index&req=viewarticle&page=1&arttitle=Getting+Ogre+from+CVS) of OGRE Homepage). I put this on /usr/dev/ogre. This should also work with release version 1.0.0 or later - actually it worked with 1.0.0RC1, I used the linux/OSX version. Didn't try the win32, but it must be not that different.
3) get the MingW/Cygwin OGRE dependencies from the OGRE website. Either extract it to the root (thus creating /mingw) or to another directory and create a symlink /mingw pointing to the correct location (that's what I did).
4) download and install libtool 1.5.12 (or newer). Version 1.5.10 (the one that came with cygwin) generates a few errors we want to avoid.
4.1) download stable version from the libtool website (http://www.gnu.org/software/libtool/libtool.html)
4.2) configure, make and make install it.
4.3) cygwin has a libtool wrapper that automatically selects 1.5.10 or 1.4.3 - we need to make it use our 1.5.12 (or newer) version instead. For that, first we copy the libtool files from /usr/local/bin to /usr/autotool/1.5.x/bin (you'll have to create it), then edit /usr/bin/libtool to use that directory instead of the devel dir. It's just a quick, nasty hack - if someone knows of a better way to get the same results, please feel free to inform. This shouldn't break anything though.
4.4) (optional) go to a directory without configure.ac or configure.in files and do a 'libtool --version' to see if the first version number changed. If so, we can go to the next step.
5) follow the instructions on the beginning of this post (thanks to wumpus), which I modified slightly and reproduce here. This is to be done in the ogrenew directory:
5.1) export PATH="$PATH:/mingw/bin"
5.2) export ACLOCAL_FLAGS="-I /mingw/share/aclocal"
5.3) export PKG_CONFIG_PATH=/mingw/lib/pkgconfig
5.4) ./bootstrap
5.5) CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" CXXFLAGS="-O2 -I/mingw/include" LDFLAGS="-L/mingw/lib -L/lib/w32api" ./configure --with-ft-prefix=/mingw --with-platform=Win32 --with-gl-support=Win32 --disable-static --build="i686-pc-mingw32" --enable-direct3d
5.6) make
5.7) make install
6) set up your development tools.
6.1) passing the arguments "-lOgreMain -Wl,--enable-runtime-pseudo-reloc" to the linker will work.
6.2) as far as library directories go, you can link to cygwin/usr/local/lib and be happy about it.
6.3) include directories: cygwin/usr/local/include, cygwin/usr/local/include/OGRE and ogrenew/Samples/Common/include (if you are using the ExampleApplication class). Where I say cygwin/ I actually mean the cygwin path (such as c:/cygwin), and the same goes for ogrenew/ (c:/cygwin/usr/local/ogre/ogrenew, for example)
6.4) this is not required, but I tend to copy all required DLLs to my build directory: the one where MingW puts my compiled binary on. This way I keep my environment clean, and you can just copy that directory to another computer and run it with its own dlls. This avoids mess.
There you go. You should be able to safely build any post-1.0.0 with this, unless there are some big changes that break the process.
[edit]Anjuta IDE
|
|