Building Blender 2.5 on Windows 7 with MSVC and SCons

I have created a 30-minute screencast in which I briefly show how Blender 2.5 can be compiled using the SCons/msvc toolset. This screencast is as a quick gap-fill until I have written out more detailed notes.

9 Responses to “Building Blender 2.5 on Windows 7 with MSVC and SCons”

  1. Felix said:

    Nov 04, 09 at 14:43

    Hey, I’ve got a Q such as this:

    how can I tell scons where to look for the dependencies,
    even though I checkout the lib/win64 to the apparently right place, it cant locate any of the dep’s. :/

  2. jesterKing said:

    Nov 05, 09 at 01:29

    At the beginning of each default config there is:


    LCGDIR = '#../lib/win64'
    LIBDIR = '${LCGDIR}'

    LCGDIR is actually obsolete, so I should clean our system a bit, but that doesn’t matter right now.

    Then if you look at ie. the OpenAL related settings:

    BF_OPENAL = LIBDIR + '/openal'
    BF_OPENAL_INC = '${BF_OPENAL}/include '
    BF_OPENAL_LIB = 'wrap_oal'
    BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'

    You can see that the base directory for the OpenAL dependency is constructed from the LIBDIR setting and the location of the ‘topdir’ for that dependency in the lib/win64 module. The include directory and the path to the libraries are constructed then using the dependency base path.

    This is how all dependencies are configured. Essentially also for Linux and OSX systems, albeit that the LIBDIR often is set to point to /usr/lib, so that system wide (native) libraries are used.

    Of course, to be able to build with a certain dependency, you’ll need to make sure that it has been actually compiled. Currently at least Jack and sndfile are missing, and FFMPEG too.

  3. Felix said:

    Nov 05, 09 at 09:15

    Thanks, for the explanation! :)

  4. Felix said:

    Nov 06, 09 at 18:23

    \o/
    |
    / \

    it builds! :D

    just checked the build instructions at blender wiki,
    and they seem to have been updated as well, thanks. :)

  5. Felix said:

    Nov 06, 09 at 18:29

    ‘edit:’

    danced too soon. :(

    Linking library ==> ‘bf_elbeem.lib’
    Compiling ==> ‘BSP_CSGMesh.cpp’
    BSP_CSGMesh.cpp
    Compiling ==> ‘BSP_MeshPrimitives.cpp’
    BSP_MeshPrimitives.cpp
    intern\bsp\intern\BSP_CSGMesh.cpp(145) : error C2065: ‘insert_iterator’ : undeclared identifier
    intern\bsp\intern\BSP_CSGMesh.cpp(145) : error C2275: ‘std::vector’ : illegal use of this type as an expression
    with
    [
    _Ty=BSP_VertexInd
    ]
    intern\bsp\intern\BSP_CSGMesh.cpp(145) : error C3861: ‘insert_point': identifier not found
    intern\bsp\intern\BSP_CSGMesh.cpp(146) : error C2065: ‘insert_point’ : undeclared identifier
    scons: building terminated because of errors.

    as per http://www.pasteall.org/8905

  6. testscreenings said:

    Nov 07, 09 at 18:36

    Heiho
    thanks for your walk through.

    I have one question regarding optimizations:
    How does one do it?

    I have looked nearly at every tutorial and tried everything i could come up with but nothing working.
    I tried many different things to set different things at these CCFlags, CXXFLAGS but failed.

    Could you maybe point me in some direction to find out how it is done?
    Would be very much appreciated.

  7. jesterKing said:

    Nov 14, 09 at 05:42

    Hmm, maybe a specific revision that for a while didn’t really compile well? I just did a new build, and it went all fine. IIRC there were some build issues last week.

  8. jesterKing said:

    Nov 14, 09 at 05:47

    I have not really looked into doing optimised builds, as our official releases don’t use optimisation anyway.

    But to try optimisation you should set those CFLAGS, CCFLAGS and CXXFLAGS. You’ll have to check the msvc compiler documentation for the optimisation flags that can be set.

    Just keep in mind that CFLAGS govern the flags for C-compilation, CCFLAGS are flags that go for both C and C++ and CXXFLAGS are solely for C++- compilation.

  9. TwinSnakes said:

    Feb 10, 10 at 14:42

    Jester, thanks for the video. I’m using VS 2010 Beta 2, and my libraries compile fine. But, it blows up when it starts the linking for blender.exe, I get LINK2019 errors:

    I get 83 extern errors in total, here’s a sampling:

    LIBCMT.lib(_file.obj) : error LNK2019: unresolved external symbol __imp_EnterCri
    ticalSection referenced in function _lock_file
    LIBCMT.lib(osfinfo.obj) : error LNK2001: unresolved external symbol __imp_EnterC
    riticalSection
    LIBCMT.lib(stream.obj) : error LNK2001: unresolved external symbol __imp_EnterCr
    iticalSection
    LIBCMT.lib(mlock.obj) : error LNK2001: unresolved external symbol __imp_EnterCri
    ticalSection
    LIBCMT.lib(_file.obj) : error LNK2019: unresolved external symbol __imp_LeaveCri
    ticalSection referenced in function _unlock_file
    LIBCMT.lib(osfinfo.obj) : error LNK2001: unresolved external symbol __imp_LeaveC
    riticalSection


Leave a Reply