Building Blender with Visual Studio 2005

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
amy_aimei
Posts: 0
Joined: Sat Feb 19, 2005 9:04 pm

Building Blender with Visual Studio 2005

Post by amy_aimei » Fri Nov 25, 2005 7:03 pm

I have read many posts regarding the problem of building Blender with the Free version of Visual Studio 2005, the Visual Studio 2005 Express. Therefore, I decided to take the challenge. The following notes outline how I did that. BTW, after long compilation with a long list of error. The Blender EXE is created. It is working too. FYI, I've tried to build it with the .sln files, it didn't work.

This notes describe the how to build Blender with Visual Studio 2005 with Scons.

- Get the source from CVS.
- Get Visual C++ 2005 Express
- Get Microsoft Platform SDK
- Get DirectX 9.0 SDK (I have to use the SDK dated December 2004, it is the last version that supports Windows 2000. I'm still using Windows 2000.)
- Get QuickTime SDK (I am using the QuickTime 7 SDK.)
- Get Python 2.4
- Get Scons 0.96
- Modify blender\intern\string\intern\STR_String.cpp; insert a line after line 42: #include <stdlib.h>; add #include <ctype.h>.
- Modify SConstruct; at line 392, remove ", 'libc'"; the line should be 'libcmt'] after modification.
- Modify SConstruct; at line 403, remove "#" prefixed to "'/NODEFAULTLIB:"libc.lib"',".
- Run scons

Notes: libc.lib does not come with Visual C++ 2005 Express, which is not required for Visual C++ 2005 Express.

Burre
Posts: 0
Joined: Tue Nov 22, 2005 1:00 am

Post by Burre » Fri Nov 25, 2005 11:36 pm

I think I have done all the steps except SCons, never used that app before. Will try it tomorrow.

franzrogar
Posts: 0
Joined: Fri Dec 03, 2004 11:02 pm

Impossible....

Post by franzrogar » Sat Nov 26, 2005 11:58 am

It seems i'll never be able to compile it with SCons. I always get this error (no matter what instructions passed to scons):

makesdna.c
cl /nologo /EHsc /J /W3 /Gd /MT /Og /Ot /Ob1 /Op /G6 /DWIN32 /D_CONSOLE /DWITH_Q
UICKTIME /D_LIB /DUSE_OPENAL /DFTGL_LIBRARY_STATIC /DGAMEBLENDER=1 /DUSE_BULLET
/DUSE_SUMO_SOLID /DNDEBUG "/IE:\Mis Textos\bf-blender-2005-11-26\bf-blender\buil
d\win32\intern\guardedalloc" /Iintern\guardedalloc /Iintern\guardedalloc /c inte
rn\guardedalloc\intern\mallocn.c "/FoE:\Mis Textos\bf-blender-2005-11-26\bf-blen
der\build\win32\intern\guardedalloc\intern\mallocn.obj"
mallocn.c
lib /nologo "/OUT:E:\Mis Textos\bf-blender-2005-11-26\bf-blender\build\win32\lib
\blender_guardedalloc.lib" "E:\Mis Textos\bf-blender-2005-11-26\bf-blender\build
\win32\intern\guardedalloc\intern\mallocn.obj"
LINK : fatal error LNK1181: cannot open input file 'Textos\bf-blender-2005-11-26
\bf-blender\build\win32\lib\blender_guardedalloc.lib'
link /nologo /SUBSYSTEM:CONSOLE /MACHINE:IX86 /ENTRY:mainCRTStartup /INCREMENTAL
:NO /NODEFAULTLIB:"msvcprt.lib" /NODEFAULTLIB:"glut32.lib" /NODEFAULTLIB:"libcd.
lib" /NODEFAULTLIB:"libc.lib" /NODEFAULTLIB:"libcpd.lib" /NODEFAULTLIB:"libcp.li
b" /NODEFAULTLIB:"libcmtd.lib" "/OUT:E:\Mis Textos\bf-blender-2005-11-26\bf-blen
der\build\win32\makesdna.exe" "/LIBPATH:E:\Mis Textos\bf-blender-2005-11-26\bf-b
lender\build\win32\lib" /LIBPATH:lib blender_guardedalloc.lib "E:\Mis Textos\bf-
blender-2005-11-26\bf-blender\build\win32\source\blender\makesdna\intern\makesdn
a.obj"
LINK : fatal error LNK1181: cannot open input file 'blender_guardedalloc.lib'
scons: *** [E:\Mis Textos\bf-blender-2005-11-26\bf-blender\build\win32\makesdna.
exe] Error 1181
scons: building terminated because of errors.

LetterRip
Posts: 0
Joined: Thu Mar 25, 2004 7:03 am

Post by LetterRip » Sat Nov 26, 2005 12:34 pm

I seem to recall that having a space in my path name messed up cygwin compiles, not sure if it would be the same for your compiles.

LetterRip

franzrogar
Posts: 0
Joined: Fri Dec 03, 2004 11:02 pm

Post by franzrogar » Sat Nov 26, 2005 1:15 pm

Thanks LetterRip. ;) That worked until a new error was shown :cry: :

"Unable ot find dxguild.lib"....

I've installed the DirectX 9.0c SDK (october 2005)...

As I said: "i'll never be able to compile it with SCons"

amy_aimei
Posts: 0
Joined: Sat Feb 19, 2005 9:04 pm

Post by amy_aimei » Sat Nov 26, 2005 3:17 pm

"Unable ot find dxguild.lib"....

I've installed the DirectX 9.0c SDK (october 2005)...

As I said: "i'll never be able to compile it with SCons"
Don't give up! You just need to add the your Platform SDK and DirectX include and lib directories in INCLUDE and LIB environment variables.

franzrogar
Posts: 0
Joined: Fri Dec 03, 2004 11:02 pm

Post by franzrogar » Sat Nov 26, 2005 4:41 pm

Thanks amy_aimei. I'd added the Platform SDK variable. Dunno why haven't the DirectX one :oops: .

But.... another 'error' :evil: :

LINK: fatal error LNK1158: cannot run 'cvtres.exe'

...

amy_aimei
Posts: 0
Joined: Sat Feb 19, 2005 9:04 pm

Post by amy_aimei » Sat Nov 26, 2005 6:32 pm

LINK: fatal error LNK1158: cannot run 'cvtres.exe'
Did you add the Platform SDK's bin directory to the path?
If not, do it and try again.

franzrogar
Posts: 0
Joined: Fri Dec 03, 2004 11:02 pm

Post by franzrogar » Sat Nov 26, 2005 7:50 pm

Yes. They're added since the begining. Also, that 'cvtres.exe' isn't there... :cry:

amy_aimei
Posts: 0
Joined: Sat Feb 19, 2005 9:04 pm

Post by amy_aimei » Sun Nov 27, 2005 1:39 am

Strange! cvtres.exe should be in your VC bin directory, i.e., C:\Program Files\Microsoft Visual Studio 8\VC\bin, which should be in your path.

franzrogar
Posts: 0
Joined: Fri Dec 03, 2004 11:02 pm

Post by franzrogar » Sun Nov 27, 2005 1:51 am

Thanks, amy_aimei. I've 'fixed' the cvtres.exe issue copying the 64bits version of the Platform SDK over there... (dunno why it's not there... no errors when installing and the environment variables were OK :? )

BUT, again.... a nice error :evil: :

LINK: fatal error LNK1181: cannot open input file 'blender_python.lib'

... Franz Rogar presenting.... the Impossible Way! (No way, SCons hates me for sure...)

amy_aimei
Posts: 0
Joined: Sat Feb 19, 2005 9:04 pm

Post by amy_aimei » Sun Nov 27, 2005 4:40 am

Are you using a 64-bit processor? I don't think VC++ 2005 Express Edition supports 64-bit processor, see http://msdn.microsoft.com/vstudio/produ ... fault.aspx for details.

BTW, I am using 32-bit processor and have the 32-bit version of the Platform SDK installed. FYI, during my test, when I encountered an error or change my environment variables, I deleted the build directory and config.opts in the blender directory, then run scons again. :( That's why it takes a long time to get it done.

:roll: I don't trust scons clean works correctly for Win32. I think we have more members compile Blender in Linux. I used to have Linux and I have built Blender using scons on Linux, it worked perfectly without all these tweaks. Too bad, I have to use Windows now.

franzrogar
Posts: 0
Joined: Fri Dec 03, 2004 11:02 pm

Post by franzrogar » Sun Nov 27, 2005 12:37 pm

I used to have Linux and have to use Windows now too... :cry:

I've see the compare page.... but SCons didn't give any platform related error... :?

BTW, I'll delete the folders and try again. Thanks amy_aimei, I'll post the results.

Post Reply