Compiling blender with DDS file support via VC and cmake

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
Kai Kostack
Posts: 0
Joined: Tue Feb 07, 2006 5:24 pm

Compiling blender with DDS file support via VC and cmake

Post by Kai Kostack »

i've tried for several hours now to compile that in by myself but with no success. the official windows release is able to load DDS files but it seems to be disabled in trunk by default.

at the moment i think it's just the missing WITH_DDS var in the cmakelists.txt files. i tried to add it but it worked only as far as i get external symbol not found errors.
56>bf_imbuf.lib(readimage.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_imb_load_dds" in Funktion "_IMB_ibImageFromMemory".
56>bf_imbuf.lib(util.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_imb_is_a_dds" in Funktion "_IMB_ispic_name".
56>C:\BlenderDev\make_kai\bin\Release\blender.exe : fatal error LNK1120: 2 nicht aufgelöste externe Verweise.
if i'm right can anybody add it for me or just tell me how to do it right?
some help would be really appreciated here. thanks.

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

Post by jesterKing »

just FYI, official releases are built with scons+msvc.

/Nathan

Kai Kostack
Posts: 0
Joined: Tue Feb 07, 2006 5:24 pm

Post by Kai Kostack »

oh, indeed i didn't know that. thanks, i will try that way. :)

Kai Kostack
Posts: 0
Joined: Tue Feb 07, 2006 5:24 pm

Post by Kai Kostack »

kent mein has included DDS in cmake now, thanks for that.

i did a lot of testing, i could get scons and mingw to work but not scons with vc. it stops at compiling GHOST_DisplayManagerWin32.cpp without error message. i don't know what's wrong here but i'd really like to know how to solve this problem even if i'm using cmake in the end.

Code: Select all

[...]
Compiling ==> 'GHOST_C-api.cpp'
Linking library ==> 'bf_string.lib'
Compiling ==> 'GHOST_CallbackEventConsumer.cpp'
Compiling ==> 'GHOST_DisplayManager.cpp'
Compiling ==> 'GHOST_DisplayManagerWin32.cpp'
=====

=====
scons: building terminated because of errors.

Code: Select all

scons: warning: The env.Copy() method is deprecated; use the env.Clone() method
instead.
File "C:\BlenderDev\kai\tools\Blender.py", line 412, in BlenderLib
scons: *** [C:\BlenderDev\build\win32-vc\intern\ghost\intern\GHOST_DisplayManage
rWin32.obj] Error 2
apparently the obj file cannot be found because it can't be compiled for some reason, but what's missing? and why it doesn't tell?

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

Post by stiv »

Running scons as
scons BF_QUIET=0
may give you more information.

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

Post by jesterKing »

Without knowing more about your dev environment, I'm guessing that your opengl includes are not found. Check to see if you have all dependencies needed.

If you made changes to the file in question, make sure you have done them in the right way :)

Anyway, I think sirdude committed a fix for DDS when using CMake into trunk not long ago.

/Nathan

Kai Kostack
Posts: 0
Joined: Tue Feb 07, 2006 5:24 pm

Post by Kai Kostack »

ok, with BF_QUIET=0 it shows what's executed. i have compared it to what's being executed for mingw.

Code: Select all

g++ -o C:\BlenderDev\build\win32-mingw\intern\ghost\intern\GHOST_DisplayManagerWin32.o -c -pipe -funsigned-char -fno-strict-aliasing -march=i686 -ffast-math -O2 -Wall -pipe -funsigned-char -fno-strict-aliasing -march=i686 -ffast-math -O2 -Wall -Wno-char-subscripts -Wdeclaration-after-statement -DXP_UNIX -DWIN32 -DFREE_WINDOWS -D_USE_MATH_DEFINES -DGAMEBLENDER=1 -DWITH_BULLET=1 -IC:\BlenderDev\lib\windows\wintab\INCLUDE -IC:\BlenderDev\build\win32-mingw\intern\ghost -Iintern\ghost -IC:\BlenderDev\build\win32-mingw\intern\string -Iintern\string -IC:\mingw\include intern\ghost\intern\GHOST_DisplayManagerWin32.cpp

Code: Select all

cl.exe /FoC:\BlenderDev\build\win32-vc\intern\ghost\intern\GHOST_DisplayManagerWin32.obj /c intern\ghost\intern\GHOST_DisplayManagerWin32.cpp /nologo /Ob1 /J /W3 /Gd /MT /arch:SSE2 /fp:fast -O2 -DNDEBUG /nologo /Ob1 /J /W3 /Gd /MT /arch:SSE2 /fp:fast -O2 -DNDEBUG -DWIN32 -D_CONSOLE -D_LIB -DFTGL_LIBRARY_STATIC -D_CRT_SECURE_NO_DEPRECATE /D_USE_MATH_DEFINES /DGAMEBLENDER=1 /DWITH_BULLET=1 /IC:\BlenderDev\lib\windows\wintab\INCLUDE /IC:\BlenderDev\build\win32-vc\intern\ghost /Iintern\ghost /IC:\BlenderDev\build\win32-vc\intern\string /Iintern\string /IC:\include
i noticed that the last include dir must be wrong, because c:\include doesn't exist. i suspect that windows.h can't be found which is located in "c:\Program Files\Microsoft SDKs\Windows\v6.0A\Include".
now, where comes the c:\include from and how do i change it? there is no environment var with "c:\include".

i did a dirty test by copying the include dir to c:\include and it compiled a bit further, now stopping at intern\guardedalloc\intern\mmap_win.obj, with the same error and without a message like before.

edit: i made no changes to those files.

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

Post by jesterKing »

I'm guessing here that you didn't run vcvars32.bat from visual c++ express or setenv.cmd from the windows sdk (both are needed). Do so in the cmd.exe you use to build in. This is needed to set up the build environment, with opengl and other headers set in the appropriate environment variables. Without that no go.

If you have visual studio 2008 professional, then you need only to start the visual studio command prompt and proceed from there.

/Nathan

Kai Kostack
Posts: 0
Joined: Tue Feb 07, 2006 5:24 pm

Post by Kai Kostack »

ok, the problem was that you need to call the environment batch files each time you want to compile. ugly if you don't know.

edit:
so and now i get this after a while:
[...]
Linking library ==> 'bf_imbuf.lib'
Linking library ==> 'bf_cineon.lib'
Linking program ==> 'makesdna.exe'
..\build\win32-vc\makesdna C:\BlenderDev\build\win32-vc\source\blender\makesdna\
intern\dna.c
scons: *** [C:\BlenderDev\build\win32-vc\source\blender\makesdna\intern\dna.c] E
xception
Traceback (most recent call last):
File "c:\Python25\Scripts\..\Lib\site-packages\scons-1.1.0\SCons\Taskmaster.py
", line 220, in execute
self.targets[0].build()
File "c:\Python25\Scripts\..\Lib\site-packages\scons-1.1.0\SCons\Node\__init__
.py", line 370, in build
apply(self.get_executor(), (self,), kw)
File "c:\Python25\Scripts\..\Lib\site-packages\scons-1.1.0\SCons\Executor.py",
line 145, in __call__
return self.do_execute(target, kw)
File "c:\Python25\Scripts\..\Lib\site-packages\scons-1.1.0\SCons\Executor.py",
line 131, in do_execute
status = apply(act, (self.targets, self.get_sources(), env), kw)
File "c:\Python25\Scripts\..\Lib\site-packages\scons-1.1.0\SCons\Action.py", l
ine 467, in __call__
stat = self.execute(target, source, env)
File "c:\Python25\Scripts\..\Lib\site-packages\scons-1.1.0\SCons\Action.py", l
ine 681, in execute
result = spawn(shell, escape, cmd_line[0], cmd_line, ENV)
File "C:\BlenderDev\kai\tools\btools.py", line 121, in ourspawn
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False)
File "c:\Python25\lib\subprocess.py", line 593, in __init__
errread, errwrite)
File "c:\Python25\lib\subprocess.py", line 793, in _execute_child
startupinfo)
WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden
scons: building terminated because of errors.
note that the same source compiles fine with cmake and mingw. looks like makesdna.exe isn't there.

edit #2:
never mind, just saw the same problem in the other thread and already be answered. the solution is to remove BF_TOOLSET=msvc then it works because msvc is used also by default. but this should really be fixed.

thank you jesterking.

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

Post by jesterKing »

I'm working on cleaning up and fixing the current scons files. It will take N time to complete. I made a start already, last night I committed some stuff to SVN to begin the process.

/Nathan

Post Reply