Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- helloworld.cpp
- ==============
- 1 #include "irrlicht/irrlicht.h"
- 2
- 3 using namespace irr;
- 4
- 5 using namespace core;
- 6 using namespace scene;
- 7 using namespace video;
- 8 using namespace io;
- 9 using namespace gui;
- 10
- 11 int main() {
- 12 IrrlichtDevice *device =
- 13 createDevice(video::EDT_SOFTWARE, dimension2d<u32>(640,480), 16,
- 14 false, false, false, 0);
- 15
- 16 if (!device) return 1;
- 17
- 18 device->setWindowCaption(L"Hello World! - Irrlicht Engine");
- 19
- 20 IVideoDriver* driver = device->getVideoDriver();
- 21 ISceneManager* smgr = device->getSceneManager();
- 22 IGUIEnvironment* guienv = device->getGUIEnvironment();
- 23
- 24 guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer.", rect<s32>(10, 10,260,22), true);
- 25
- 26 IAnimatedMesh* mesh=smgr->getMesh("sydney.md2");
- 27 if (!mesh) {
- 28 device->drop();
- 29 return 1;
- 30 }
- 31 IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
- 32
- 33 if (node) {
- 34 node->setMaterialFlag(EMF_LIGHTING, false);
- 35 node->setMD2Animation(scene::EMAT_STAND);
- 36 node->setMaterialTexture(0,driver->getTexture("sydney.bmp") );
- 37
- 38 }
- 39
- 40 smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
- 41
- 42 while(device->run() ) {
- 43 driver->beginScene(true,true,SColor(255,100,101,140));
- 44 smgr->drawAll();
- 45 guienv->drawAll();
- 46 driver->endScene();
- 47 }
- 48
- 49 device->drop();
- 50 return 0;
- 51 }
- Invocation (also same output under cmd.exe)
- ==========
- Tarinaky@Mercury /cygdrive/c/src/irrlicht_tutorial
- $ which mingw32-g++.exe
- /cygdrive/c/MinGW/bin/mingw32-g++.exe
- Tarinaky@Mercury /cygdrive/c/src/irrlicht_tutorial
- $ mingw32-g++ -v helloworld.cpp -Llib/Win32-gcc -lIrrlicht
- Using built-in specs.
- COLLECT_GCC=C:\MinGW\bin\mingw32-g++.exe
- COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
- Target: mingw32
- Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
- Thread model: win32
- gcc version 4.6.2 (GCC)
- COLLECT_GCC_OPTIONS='-v' '-Llib/Win32-gcc' '-shared-libgcc' '-mtune=i386' '-march=i386'
- c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/cc1plus.exe -quiet -v -iprefix c:\mingw\bin\../lib/gcc/mingw32/4.6.2/ helloworld.cpp -quiet -dumpbase helloworld.cpp -mtune=i386 -march=i386 -auxbase helloworld -version -o C:\cygwin\tmp\ccLcpVsa.s
- GNU C++ (GCC) version 4.6.2 (mingw32)
- compiled by GNU C version 4.6.2, GMP version 5.0.1, MPFR version 2.4.1, MPC version 0.8.1
- GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
- ignoring nonexistent directory "c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../mingw32/include"
- ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/include/c++"
- ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/include/c++/mingw32"
- ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/include/c++/backward"
- ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/include"
- ignoring duplicate directory "/mingw/lib/gcc/mingw32/4.6.2/../../../../include"
- ignoring duplicate directory "c:/mingw/lib/gcc/../../include"
- ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/include-fixed"
- ignoring nonexistent directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/../../../../mingw32/include"
- ignoring duplicate directory "/mingw/include"
- #include "..." search starts here:
- #include <...> search starts here:
- c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++
- c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/mingw32
- c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/backward
- c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include
- c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include
- c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include-fixed
- End of search list.
- GNU C++ (GCC) version 4.6.2 (mingw32)
- compiled by GNU C version 4.6.2, GMP version 5.0.1, MPFR version 2.4.1, MPC version 0.8.1
- GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
- Compiler executable checksum: f7eb4168c2cf10318cc29da8d23b7f3c
- COLLECT_GCC_OPTIONS='-v' '-Llib/Win32-gcc' '-shared-libgcc' '-mtune=i386' '-march=i386'
- c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/as.exe -o C:\cygwin\tmp\cc6WMDme.o C:\cygwin\tmp\ccLcpVsa.s
- COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/;c:/mingw/bin/../libexec/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/
- LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.6.2/;c:/mingw/bin/../lib/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/lib/;c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../;/mingw/lib/
- COLLECT_GCC_OPTIONS='-v' '-Llib/Win32-gcc' '-shared-libgcc' '-mtune=i386' '-march=i386'
- c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/collect2.exe -Bdynamic -u ___register_frame_info -u ___deregister_frame_info c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/4.6.2/crtbegin.o -Llib/Win32-gcc -Lc:/mingw/bin/../lib/gcc/mingw32/4.6.2 -Lc:/mingw/bin/../lib/gcc -Lc:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../.. -L/mingw/lib C:\cygwin\tmp\cc6WMDme.o -lIrrlicht -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/4.6.2/crtend.o
- Tarinaky@Mercury /cygdrive/c/src/irrlicht_tutorial
- $ gdb a.exe
- GNU gdb (GDB) 7.3.50.20111026-cvs (cygwin-special)
- Copyright (C) 2011 Free Software Foundation, Inc.
- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
- This is free software: you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law. Type "show copying"
- and "show warranty" for details.
- This GDB was configured as "i686-cygwin".
- For bug reporting instructions, please see:
- <http://www.gnu.org/software/gdb/bugs/>...
- Reading symbols from /cygdrive/c/src/irrlicht_tutorial/a.exe...done.
- (gdb) run
- Starting program: /cygdrive/c/src/irrlicht_tutorial/a.exe
- [New Thread 4144.0x898]
- warning: Irrlicht Engine version 1.8.0
- warning: Microsoft Windows 7 Professional Edition Service Pack 1 (Build 7601)
- warning: Resizing window (640 480)
- Program received signal SIGSEGV, Segmentation fault.
- 0x0040144c in main ()
- (gdb) bt
- #0 0x0040144c in main ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement