none
Compiler Errors with Boost C++ and Unreal Engine RRS feed

  • Question

  • This is a general question, I believe, if you are unfamiliar with UE4 (unreal engine.)

    I have included and linked the latest Boost C++ library into my build. I tested the library beforehand with sample programs. However, when simply including the header files in a C++ actor class in my Unreal game project, I get errors like:

    Warning Example:

        Error boost/config/stdlib/dinkumware.hpp(99) : warning C4668: '_HAS_NAMESPACE' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'

    Error Examples:
        
        Error boost/intrusive/slist.hpp(1926) : error C4003: not enough actual parameters for macro 'check'

        Error boost/intrusive/slist.hpp(1926) : error C2062: type 'void' unexpected

    It looks like there is some strict/unsupported semantic issues with the compiler that is being used. How do I fix this?

    I am on Windows with VS 2017.

    Sample programs compile fine with just

        cl /EHsc /I boost_1_64_0 test_game.cpp /link /LIBPATH:"F:\boost_1_64_0\stage\lib"

    Why would the compiler not work from within Unreal?



    Saturday, June 10, 2017 11:14 PM

All replies

  • Hi xoftware,

    Thanks for posting here.

    This forum is about the Visual Studio IDE, as your issue is more related to the Boost C++ library, This is out of our support. Please reopen a new thread in the Boost Community.

    If you have some VS IDE questions, please feel free to contact us. We will try our best to give you a solution.

    Thanks for your understanding and cooperation.


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 12, 2017 3:15 AM
  • To solve the C4003 error you should include the headers with two macros provided by Unreal and push out the macro check:

    THIRD_PARTY_INCLUDES_START

    #pragma push_macro("check")

    #undef check

    #include <boost/intrusive/slist.hpp>

    #pragma pop_macro("check")

    THIRD_PARTY_INCLUDES_END




    Wednesday, June 19, 2019 7:25 PM