Search code examples
gitqt-creatoropen-source

How to switch git's branch in Qt Creator correctly?


I'm trying to build Blender application from Source here: git.blender.org/blender.git

For now I can build blender from master branch, and it works fine. But I have troubles with 2.8 branch - it builds, but not run.

I’m using ubuntu 18.04 and Qt Creator. I set up all like it described here.

In menu I select Tools -> git -> local storage -> branches, select 2.8 branch here, when in the menu git -> fetch and git -> pull.

When I build, and it always build with success, but shows a lot of warnings, but I don’t think that is critical, so I just ignore this.

When i try to run blender, and it crashes with error:

terminate called after throwing an instance of 'std::logic_error'
     what():  basic_string::_M_construct null not valid

So, maybe I’m doing something wrong? Maybe, I miss something?


Solution

  • Well, I solved this problem bay creating new folder for the brunch.

    Setup new folder like this

    cd ~/blender-build/blender 
    
    mkdir ~/other-build 
    git worktree add ~/other-build/blender master 
    ln -s ~/blender-build/lib ~/other-build/lib 
    
    cd ~/other-build/blender 
    make
    

    when build Qt project

    cd ~/other-build/build
    python3 ../blender/build_files/cmake/cmake_qtcreator_project.py