I can't compile BRX without MFC. What do i need ?

fatal error C1189: #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]


Comments

  • Hi Oleg,

    As with WxWidgets, you have to compile and link against the same MFC library version and build settings used by BricsCAD. The error indicates a mismatch. BricsCAD will use the release version of MFC, but it seems you are compiling against the Debug version. You probably defined the preprocessor symbol _DEBUG, which pulls in the debug MFC libraries. For debug builds of your code, you'll need to #undef _DEBUG before including the MFC headers, then reset it after.

    I hope that helps.

  • Just more 2 cents :-)
    There is a sample application shipped with BRX SDK and also with BricsCAD, which shows the handling of _DEBUG symbol
    by StdAfx.h for Debug + Release build ...
    using that StdAfx.h should be fine for you ...
    many greetings !
  • Dear Oleg,

    normally, there is even no need to disable MFC ... as long as your own code does not use MFC, nothing is imported from MFC modules :-)

    Also, WxWidgets + MFC can perfectly coexist in same process, there is no clash (except for that CWinApp problem - more infos will come),
    so there is no need to disable MFC, when intending to do a WxWidgets build.

    But I agree, likely our BRX header set is not yet in perfect shape - likely several declarations miss the
    #ifdef _AFXDLL
    #endif

    backets around MFC related functions ... we will improve that.
    many greetings !
This discussion has been closed.