Nearly compiled 2.47 with Microsoft VC++ 2008

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
spamagnet
Posts: 0
Joined: Tue Jul 01, 2008 3:28 am

Nearly compiled 2.47 with Microsoft VC++ 2008

Post by spamagnet » Sun Aug 24, 2008 10:51 pm

Hey all, I know this is a n00b question, but it's been a while since I worked much in C/C++. I got the 2.47 branch source code and got all the dependencies compiled successfully. When I do the final link, though, I get this error:

Code: Select all

------ Build started: Project: blender, Configuration: Blender Release Win32 ------
Linking...
libguardedalloc.lib(mallocn.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
   Creating library ..\..\bin\blender.lib and object ..\..\bin\blender.exp
Iex.lib(IexThrowErrnoExc.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
IlmImf.lib(ImfHuf.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
IlmThread.lib(IlmThreadSemaphoreWin32.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
IlmThread.lib(IlmThreadPool.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
IlmThread.lib(IlmThreadWin32.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
... snipped a bunch more ...
IlmImf.lib(ImfChannelList.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::ios_base::_Addstd(void)" (?_Addstd@ios_base@std@@QAEXXZ)
..\..\bin\blender.exe : fatal error LNK1120: 3 unresolved externals
Build log was saved at "file://k:\SoftwareDev\Blender\build\msvc_7\source\blender\BuildLog.htm"
blender - 71 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 33 up-to-date, 0 skipped ==========
It appears to be a standard template library issue of some sort. Any pointers about how to go about troubleshooting it?

Thanks!

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Mon Aug 25, 2008 1:31 am

You need to make sure that you're linking against the openexr libs that are in the lib_vs2008 folder in lib/windows/openexr.

/Nathan

ps. you can also build using scons + msvc

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Mon Aug 25, 2008 6:41 am

std::_String_base::_Xran(void)const
That looks like the Standard C++ library is missing. In Unixy Land, that would be libstdc++, though Bog knows what it is called in the Windows world.

Stukfruit
Posts: 0
Joined: Sun Nov 04, 2007 8:56 am

Post by Stukfruit » Tue Aug 26, 2008 4:37 am

It's got something to do with the MT/MD options for choosing what runtime (indeed, the standard library) to use. Make sure you're using the same option for all libraries and Blender itself.

Can't say much more useful about it, but I can tell you that OpenEXR (that's what the Ilm libraries are from) is a bitch to build and link correctly.

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Tue Aug 26, 2008 6:44 am

It's pretty simple. The projectfiles in SVN are for msvs 2005, and you're building with 2008.

As I told you, you have to make sure you link to the right libraries (the ones in lib_vs2008 -> https://svn.blender.org/svnroot/bf-blen ... ib_vs2008/ ). You'll have to change the libpaths for the proper projects to point to this directory.

/Nathan

spamagnet
Posts: 0
Joined: Tue Jul 01, 2008 3:28 am

Post by spamagnet » Tue Aug 26, 2008 1:19 pm

jesterKing wrote:As I told you, you have to make sure you link to the right libraries (the ones in lib_vs2008 -> https://svn.blender.org/svnroot/bf-blen ... ib_vs2008/ ).
Thanks, Nathan! Looks like that did it!

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Tue Aug 26, 2008 1:54 pm

w00t :)

/Nathan

Post Reply