#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
Those are libraries you need to link with to build basic OpenGL applications.Ooooookay.... the -lopengl32 and -lglu32 in other linker options worked.... my next question is why and what does it actually do when you do that?
Either add -lopengl32 -lglu32 to "other linker options", or add opengl32 and glu32 to link libraries on the left, or link against opengl32.dll and glu32.dll which are both found inside WINDOWS\system32.
-l is the GCC command to link a library. For some reason adding them to the linker libraries list didn't work in your case.... (weird)
Sorry, I am using the GCC compiler, it's just the source is an example tutorial. I didn't know the #pragma was VC only :POkay, as I understand "-lopengl32 -lglu32" solves your problems, but you want link libraries via GUI interface?
Sorry, I am using the GCC compiler, it's just the source is an example tutorial. I didn't know the #pragma was VC only :POkay, as I understand "-lopengl32 -lglu32" solves your problems, but you want link libraries via GUI interface?
If so, you should add libopengl32.a and libglu32.a (you can locate these in MinGW /lib subdirectory) instead of opengl32.lib & glu32.lib.
It comes to any other lib as well, if you were linking foo.lib in your VC 6.0, you will link libfoo.a while using MinGW compiler.
Now my next problem is using someones elses *.lib for the GCC compiler, would I have to recompiler it to a *.a file or use the *.lib with VC++ compiler?
... I am unable to get code::blocks to have it link with the libraries
... i can't seem to figure this out. its very strange.. here's some screenshots:
...
Project : OGRE_Samplegcc is basically the same thing. paths are correct, it is passing the proper OgreMain lib to the linker, its just not linking it.
Compiler : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : E:\Coding\
--------------------------------------------------------------------------------
Switching to target: Debug
cl.exe /nologo /GX /Zi /DDEBUG /D_DEBUG /IE:\Coding\OgreSDK\include /IE:\Coding\OgreSDK\include\opt /IE:\Coding\OgreSDK\Samples\include /I"C:\Program Files\Microsoft Visual C++ Toolkit 2003\include" /c main.cpp /FoDebug\.objs\main.obj
main.cpp
link.exe /nologo /LIBPATH:E:\Coding\OgreSDK\lib /LIBPATH:E:\Coding\OgreSDK\lib\opt\debug /LIBPATH:"C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib" /out:Debug\ogre_sample.exe user32.lib kernel32.lib gdi32.lib opengl32.lib OgreMain_d.lib Debug\.objs\main.obj
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Ogre::Exception::getFullDescription(void)const " (__imp_?getFullDescription@Exception@Ogre@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function $L130547
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::Root::Root(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0Root@Ogre@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z) referenced in function "protected: virtual bool __thiscall ExampleApplication::setup(void)" (?setup@ExampleApplication@@MAE_NXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Ogre::RenderWindow * __thiscall Ogre::Root::initialise(bool,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?initialise@Root@Ogre@@QAEPAVRenderWindow@2@_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "protected: virtual bool __thiscall ExampleApplication::configure(void)" (?configure@ExampleApplication@@MAE_NXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Ogre::Overlay * __thiscall Ogre::OverlayManager::getByName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?getByName@OverlayManager@Ogre@@QAEPAVOverlay@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: __thiscall ExampleFrameListener::ExampleFrameListener(class Ogre::RenderWindow *,class Ogre::Camera *,bool,bool)" (??0ExampleFrameListener@@QAE@PAVRenderWindow@Ogre@@PAVCamera@2@_N2@Z)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Ogre::StringConverter::toString(class Ogre::Vector3 const &)" (__imp_?toString@StringConverter@Ogre@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVVector3@2@@Z) referenced in function "public: virtual bool __thiscall ExampleFrameListener::processUnbufferedKeyInput(struct Ogre::FrameEvent const &)" (?processUnbufferedKeyInput@ExampleFrameListener@@UAE_NABUFrameEvent@Ogre@@@Z)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Ogre::StringConverter::toString(class Ogre::Quaternion const &)" (__imp_?toString@StringConverter@Ogre@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVQuaternion@2@@Z) referenced in function "public: virtual bool __thiscall ExampleFrameListener::processUnbufferedKeyInput(struct Ogre::FrameEvent const &)" (?processUnbufferedKeyInput@ExampleFrameListener@@UAE_NABUFrameEvent@Ogre@@@Z)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall Ogre::RenderTarget::getDebugText(void)const " (__imp_?getDebugText@RenderTarget@Ogre@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "protected: void __thiscall ExampleFrameListener::updateStats(void)" (?updateStats@ExampleFrameListener@@IAEXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Ogre::StringConverter::toString(unsigned int,unsigned short,char,int)" (__imp_?toString@StringConverter@Ogre@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IGDH@Z) referenced in function "protected: void __thiscall ExampleFrameListener::updateStats(void)" (?updateStats@ExampleFrameListener@@IAEXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Ogre::StringConverter::toString(unsigned long,unsigned short,char,int)" (__imp_?toString@StringConverter@Ogre@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KGDH@Z) referenced in function "protected: void __thiscall ExampleFrameListener::updateStats(void)" (?updateStats@ExampleFrameListener@@IAEXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Ogre::StringConverter::toString(float,unsigned short,unsigned short,char,int)" (__imp_?toString@StringConverter@Ogre@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MGGDH@Z) referenced in function "protected: void __thiscall ExampleFrameListener::updateStats(void)" (?updateStats@ExampleFrameListener@@IAEXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Ogre::OverlayElement * __thiscall Ogre::OverlayManager::getOverlayElement(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (__imp_?getOverlayElement@OverlayManager@Ogre@@QAEPAVOverlayElement@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z) referenced in function "protected: void __thiscall ExampleFrameListener::updateStats(void)" (?updateStats@ExampleFrameListener@@IAEXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::ResourceGroupManager::addResourceLocation(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (__imp_?addResourceLocation@ResourceGroupManager@Ogre@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00_N@Z) referenced in function "protected: virtual void __thiscall ExampleApplication::setupResources(void)" (?setupResources@ExampleApplication@@MAEXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Ogre::MapIterator<class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::multimap<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > *,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::multimap<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > *> > > > __thiscall Ogre::ConfigFile::getSectionIterator(void)" (__imp_?getSectionIterator@ConfigFile@Ogre@@QAE?AV?$MapIterator@V?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAV?$multimap@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@2@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAV?$multimap@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@2@@std@@@2@@std@@@2@XZ) referenced in function "protected: virtual void __thiscall ExampleApplication::setupResources(void)" (?setupResources@ExampleApplication@@MAEXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::ConfigFile::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (__imp_?load@ConfigFile@Ogre@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0_N@Z) referenced in function "protected: virtual void __thiscall ExampleApplication::setupResources(void)" (?setupResources@ExampleApplication@@MAEXXZ)
main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME" (__imp_?DEFAULT_RESOURCE_GROUP_NAME@ResourceGroupManager@Ogre@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
Debug\ogre_sample.exe : fatal error LNK1120: 15 unresolved externals
Process terminated with status 1 (0 minutes, 5 seconds)
16 errors, 0 warnings