Author Topic: Problems linking libraries  (Read 25479 times)

Offline yaustar

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Problems linking libraries
« Reply #15 on: September 17, 2005, 01:38:18 pm »
Whoops... didn't realise that there were already libraries for opengl as *.a.. that fixes the promblems nicely...

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?

Offline squizzz

  • Almost regular
  • **
  • Posts: 132
Re: Problems linking libraries
« Reply #16 on: September 17, 2005, 05:48:51 pm »
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?

It depends. Most of 3rd party libraries comes with precompiled binaries for all major compiler suites. The good news is that GCC/MinGW is one of them. Usually you can download them as separate packages (one for VC++, one for GCC, other for Borland etc).

Btw. many libraries are addictionally released as so called devpaks, you can find huge repository of these at: http://devpaks.org (the site seems to be down ATM...) or download 'em via DevPak plugin. These are dedicated to GCC/MinGW compiler.
« Last Edit: September 17, 2005, 05:50:36 pm by squizzz »
this space is for rent

Offline yaustar

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Problems linking libraries
« Reply #17 on: September 18, 2005, 03:10:45 am »
Thanks for the information. It saves me a lot of running around headless... :)

Joker

  • Guest
Re: Problems linking libraries
« Reply #18 on: October 03, 2005, 02:01:23 pm »
I'm having similar problems, without resolve.

I'm tinkering with OGRE templates, and I am unable to get code::blocks to have it link with the libraries. I've tried .net toolkit 2003 compiler, and the provided mingw. all give similar unresolved errors. Now, in the projects build options, I've set a FULL path to the libraries in question (OgreMain(_d) in this case) with the same result. I've also tried it with the -l gcc option in extra link options in the same dialog, same result.

i can't seem to figure this out. its very strange.. here's some screenshots:

using gcc: (i've tried every possible combo here)
http://img106.imagevenue.com/img.php?loc=loc153&image=82a_linker_gcc.JPG

using vc .net toolkit
http://img15.imagevenue.com/img.php?loc=loc81&image=595_linker_vc.JPG

always getting unresolved ogre symbols.


btw, the code is just unmodified template privided with code::blocks.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Problems linking libraries
« Reply #19 on: October 03, 2005, 02:47:03 pm »
... 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:
...

the screenshots were a good idea : sit back and READ carefully what's written on the screen !
Policy: Use project options only
this means, that all settings from this dialog box are NOT USED to build this target !

set Policy to any of the other possible settings, like "Prepend target options to project options" and try again ;-)

Joker

  • Guest
Re: Problems linking libraries
« Reply #20 on: October 03, 2005, 11:02:43 pm »
if you notice, VC is on the default setting (Append settings to project default). I still get the link errors, reguardless. I was desperate, and its not that :-P

I took the screeny after messing with pretty much every setting trying to get it to work.
« Last Edit: October 03, 2005, 11:06:33 pm by Joker »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Problems linking libraries
« Reply #21 on: October 03, 2005, 11:15:37 pm »
You know, if you 'd post the build log you might get more helpful replies. A simple "I get unresolved ogre symbols" means nothing...
And before posting your build log, go to "Settings->Compiler->[select compiler]->Other" and set "Compiler logging" to full command-line.
Be patient!
This bug will be fixed soon...

Joker

  • Guest
Re: Problems linking libraries
« Reply #22 on: October 03, 2005, 11:25:22 pm »
VC build log:
Quote
Project   : OGRE_Sample
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
 
gcc is basically the same thing. paths are correct, it is passing the proper OgreMain lib to the linker, its just not linking it.
I'm begining to suspect its ogre..

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Problems linking libraries
« Reply #23 on: October 03, 2005, 11:26:52 pm »
Does it happen with the release build too, or only the debug?
Be patient!
This bug will be fixed soon...

Joker

  • Guest
Re: Problems linking libraries
« Reply #24 on: October 03, 2005, 11:27:16 pm »
both, using either compiler.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Problems linking libraries
« Reply #25 on: October 04, 2005, 08:46:01 am »
It was the next thing I was going to suggest, but since there's a thread (at Ogre forums) already explaining it, I thought I 'd just post a link.
Take a look at this.
Be patient!
This bug will be fixed soon...