Blender under VS2008 - unresolved external symbol

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
Grumlaut
Posts: 0
Joined: Mon Jun 09, 2008 11:03 am

Blender under VS2008 - unresolved external symbol

Post by Grumlaut » Wed Jun 11, 2008 3:07 pm

After following the tutorial here for MSVC - http://www.geneome.net/index.php/tutori ... ing-cmake/ - I have been able to compile Blender fine, but I gt 22 link errors, any idea how I may fix these?

4>Linking...
5> Creating library D:\trunk\make\bin\Debug\blenderplayer.lib and object D:\trunk\make\bin\Debug\blenderplayer.exp
5>libjpeg.lib(jerror.o) : warning LNK4217: locally defined symbol __iob imported in function _output_message
5>libpng_st.lib(pngerror.o) : warning LNK4049: locally defined symbol __iob imported
5>libpng_st.lib(pngwutil.o) : warning LNK4049: locally defined symbol __iob imported
5>libpng_st.lib(pngrutil.o) : warning LNK4049: locally defined symbol __iob imported
5>IlmThread.lib(IlmThreadPool.obj) : error LNK2019: unresolved external symbol __invalid_parameter_noinfo referenced in function "char * __cdecl std::_Allocate<char>(unsigned int,char *)" (??$_Allocate@D@std@@YAPADIPAD@Z)
5>IlmImf.lib(ImfScanLineInputFile.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfPxr24Compressor.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfPizCompressor.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmThread.lib(IlmThreadSemaphoreWin32.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfMisc.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfTileOffsets.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfTiledMisc.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfTiledInputFile.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfStringAttribute.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfStdIO.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfChannelListAttribute.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfOpaqueAttribute.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfChannelList.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfTiledOutputFile.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfInputFile.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfAttribute.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>Half.lib(half.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfHeader.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfOutputFile.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>IlmImf.lib(ImfFrameBuffer.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
5>D:\trunk\make\bin\Debug\blenderplayer.exe : fatal error LNK1120: 1 unresolved externals
4> Creating library D:\trunk\make\bin\Debug\blender.lib and object D:\trunk\make\bin\Debug\blender.exp
4>libjpeg.lib(jerror.o) : warning LNK4217: locally defined symbol __iob imported in function _output_message
4>libpng_st.lib(pngerror.o) : warning LNK4049: locally defined symbol __iob imported
4>libpng_st.lib(pngwutil.o) : warning LNK4049: locally defined symbol __iob imported
4>libpng_st.lib(pngrutil.o) : warning LNK4049: locally defined symbol __iob imported
4>IlmThread.lib(IlmThreadPool.obj) : error LNK2019: unresolved external symbol __invalid_parameter_noinfo referenced in function "char * __cdecl std::_Allocate<char>(unsigned int,char *)" (??$_Allocate@D@std@@YAPADIPAD@Z)
4>IlmImf.lib(ImfScanLineInputFile.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfPxr24Compressor.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfPizCompressor.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmThread.lib(IlmThreadSemaphoreWin32.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfMisc.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfTileOffsets.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfTiledMisc.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfTiledInputFile.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfStringAttribute.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfStdIO.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfChannelListAttribute.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfOpaqueAttribute.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfChannelList.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfTiledOutputFile.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfInputFile.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfAttribute.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>Half.lib(half.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfHeader.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfOutputFile.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>IlmImf.lib(ImfFrameBuffer.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
4>D:\trunk\make\bin\Debug\blender.exe : fatal error LNK1120: 1 unresolved externals
5>Build log was saved at "file://d:\trunk\make\blenderplayer\blenderplayer.dir\Debug\BuildLog.htm"
5>blenderplayer - 22 error(s), 4 warning(s)
4>Build log was saved at "file://d:\trunk\make\source\creator\blender.dir\Debug\BuildLog.htm"
4>blender - 22 error(s), 4 warning(s)
6>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
6>Project not selected to build for this solution configuration
========== Build: 3 succeeded, 2 failed, 56 up-to-date, 1 skipped ==========

malCanDo
Posts: 1
Joined: Mon Oct 21, 2002 1:44 pm
Location: Ireland
Contact:

Post by malCanDo » Thu Jun 12, 2008 3:12 am

Hi there,

I currently don't have the Blender source code checked out on my new laptop, but from what I recall you might want to check in the OpenEXR library folder.

This library contains the IlmBuf functionality, and there is more than one subfolder to choose from when linking ( there seems to have been an issue with how it was precompiled, which introduced incompatibilities with various versions of the VC compilers ).

>IlmThread.lib(IlmThreadPool.obj) : error LNK2019: unresolved external symbol __invalid_parameter_noinfo referenced in function "char * __cdecl std::_Allocate<char>(unsigned int,char *)"

You can see from above that this is the first error that you're getting, the previous ones were just warnings.

If you select the correct folder for the Blender project to link with for VS 2008, you should then ( hopefully ) be able to link.

Mal

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

Post by jesterKing » Thu Jun 12, 2008 4:31 pm

I don't think CMake is currently too actively maintained. You might want to try scons/msvc to build blender.

/Nathan

tamerlan3d
Posts: 0
Joined: Wed Sep 03, 2008 6:13 pm

Post by tamerlan3d » Wed Sep 03, 2008 6:18 pm

I had the exact same issue building with Visual Studio 2005.

If you look the /lib/windows/openexr folder there are actually 4 different lib subfolders, lib, lib_msvc, lib_vs2005 and lib_vs2008.

To fix my issue I just changed my Additional Library Directories in the blender project to lib_vs2005.

I guess you'll have to do something similar to get it working.

qurui721
Posts: 0
Joined: Fri Sep 19, 2008 4:57 am

Post by qurui721 » Thu Oct 02, 2008 7:27 am

I have the same problem. :cry:
I have tried to link it with vc2008, and selected the directory:lib_vs2008....

EvilEngel
Posts: 6
Joined: Wed Oct 16, 2002 1:09 am

Same problem, any solution?

Post by EvilEngel » Sat Oct 04, 2008 2:38 am

I also have exactly the same problem. I'm using VC 2005 and my library directory is set to 2005 (I tried all of the other options just in case, but they're obviously worse). Was anyone able to work around this?

EvilEngel
Posts: 6
Joined: Wed Oct 16, 2002 1:09 am

fixed for me: python VS version

Post by EvilEngel » Sat Oct 04, 2008 4:25 am

My issue was resolved in a similar way as the posts above, but with a different library. I'm building with cmake and visual studion 2005 in debug mode. I had to tweak my cmakelists.txt to link against the python25_d library from the lib25_vs2005 sub folder. Also tweaked the post build command for the blender project to copy the right dll. This thing of having to match all of these different versions of libraries with the MS compilers is painful, painful.

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

Post by jesterKing » Sat Oct 04, 2008 8:38 pm

The best out-of-the-box experience you can get by building blender with the combo scons+msvc (It's how official builds are done).

/Nathan

ab2cd4
Posts: 0
Joined: Sun Oct 12, 2008 11:29 am

Post by ab2cd4 » Sun Oct 12, 2008 11:50 am

The problem here is that openexr is compiled for release.
To make a debug build of Blender with Microsoft VC you'd need to compile the openexr libraries in debug mode.
Here you are mixing release and debug, which won't work with the libraries which are included for windows. They are build as multi-threaded (/MT), but to build a debug version it has to be multi-threaded debug (/MTd).

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

Post by jesterKing » Mon Oct 13, 2008 8:57 am

You should not need to debug the openexr libraries, they are supposed to be black box dependencies. Also, our build process (at least when using scons+msvc) doesn't need the openexr debug libraries to build a debug version of Blender.

/Nathan

berttreb
Posts: 0
Joined: Sat Dec 13, 2008 6:19 pm

Post by berttreb » Sat Dec 13, 2008 7:01 pm

Hi,

I had a similar problem when building 2.48 debug in Visual C++ Express edition 2008. I used cmake to create the project files.

Everything compiled correctly but during linking this error appeared a number of times:
unresolved external symbol __invalid_parameter_noinfo

In openexr_api.cpp I found this code (near the top of the file, line 39)

// The following prevents a linking error in debug mode for MSVC using the libs in CVS
#if defined(WITH_OPENEXR) && defined(_WIN32) && defined(_DEBUG) && !defined(__MINGW32__) && !defined(__CYGWIN__)
_CRTIMP void __cdecl _invalid_parameter_noinfo(void)
{
}
#endif

So I think in my case one or other define constant (eg. _DEBUG) was not set (by cmake ?).

Solution: I commented the #if defined ... and #endif so that the function _invalid_parameter_noinfo is defined.

Now the compilation works and I can step through the code with the debugger in visual express.

Regards

PS. I presume when compiling release the comments will need to be removed.

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

Post by jesterKing » Sun Dec 14, 2008 11:08 am

berttreb wrote:Solution: I commented the #if defined ... and #endif so that the function _invalid_parameter_noinfo is defined.

Now the compilation works and I can step through the code with the debugger in visual express.

Regards

PS. I presume when compiling release the comments will need to be removed.
Of course, a better solution even would be to make sure that the _DEBUG define is created for debug builds.

/Nathan

Fussion289
Posts: 0
Joined: Wed Feb 25, 2009 5:44 pm
Location: Knoxville, TN

Post by Fussion289 » Fri Feb 27, 2009 10:33 pm

berttreb wrote:Hi,

I had a similar problem when building 2.48 debug in Visual C++ Express edition 2008. I used cmake to create the project files.

Everything compiled correctly but during linking this error appeared a number of times:
unresolved external symbol __invalid_parameter_noinfo

In openexr_api.cpp I found this code (near the top of the file, line 39)

// The following prevents a linking error in debug mode for MSVC using the libs in CVS
#if defined(WITH_OPENEXR) && defined(_WIN32) && defined(_DEBUG) && !defined(__MINGW32__) && !defined(__CYGWIN__)
_CRTIMP void __cdecl _invalid_parameter_noinfo(void)
{
}
#endif

So I think in my case one or other define constant (eg. _DEBUG) was not set (by cmake ?).

Solution: I commented the #if defined ... and #endif so that the function _invalid_parameter_noinfo is defined.

Now the compilation works and I can step through the code with the debugger in visual express.

Regards

PS. I presume when compiling release the comments will need to be removed.
Any way of getting a copy paste of exactly what you did to make it more apprent to use noobs?

:lol:
What mean you my engrish no well???

mankatob
Posts: 0
Joined: Tue Apr 21, 2009 6:32 pm

changing my Additional Library Directories

Post by mankatob » Tue Apr 21, 2009 6:40 pm

Okay, I've bought Visual Studio 2005 and 2003 and I've got others but I've added Scons and I suppose I should download whatever microsoft is giving away for free if only because I want to be just like you;} And I've run the scripts and played the games.

Product:

libjpeg.lib(jerror.o) : warning LNK4217: locally defined symbol __iob imported
libpng_st.lib(pngerror.o) : warning LNK4049: locally defined symbol __iob impor
libpng_st.lib(pngwutil.o) : warning LNK4049: locally defined symbol __iob impor
libpng_st.lib(pngrutil.o) : warning LNK4049: locally defined symbol __iob impor
IlmThread.lib(IlmThreadSemaphoreWin32.obj) : error LNK2001: unresolved external
*,class std::basic_string<char,struct std::char_traits<char>,class std::allocat
IlmImf.lib(ImfStdIO.obj) : error LNK2001: unresolved external symbol "public: s
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
IlmImf.lib(ImfOpaqueAttribute.obj) : error LNK2001: unresolved external symbol
*,class std::basic_string<char,struct std::char_traits<char>,class std::allocat
IlmImf.lib(ImfScanLineInputFile.obj) : error LNK2001: unresolved external symbo
*,class std::basic_string<char,struct std::char_traits<char>,class std::allocat


HOW DO I SPECIFY THE COMPILER I AM USING? THERE IS NO config.opts, no user-config.py

"If you look the /lib/windows/openexr folder there are actually 4 different lib subfolders, lib, lib_msvc, lib_vs2005 and lib_vs2008.

To fix my issue I just changed my Additional Library Directories in the blender project to lib_vs2005. " <<_-----HOW DID HE?SHE DO THAT?

win32-vc-config.py mentions nothing as does the Sconstruct script.

Post Reply