Results 1 to 4 of 4

Thread: SECMultiMonitor / nafxcwd.lib LINKER conflicts

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    3

    Unhappy SECMultiMonitor / nafxcwd.lib LINKER conflicts

    When I link my OT10.1 project (VS2005SP1), a list of duplicate definition errors is thrown by the linker from module (SECMultiMonitor.obj):

    Error 22 error LNK2005: _g_pfnGetSystemMetrics already defined in ot1101d.lib(SECMultiMonitor.obj) nafxcwd.lib
    ...etc.

    What is causing this and how do I resolve it?
    I don't need multi-monitor support - is there a way to remove this module from the OT1101d.lib library?

    Thanks for any help!

  2. #2
    Junior Member
    Join Date
    Mar 2009
    Posts
    3
    A follow up...

    I went ahead and hand-edited the bldback80.mak file to remove the SECMultiMonitors module and I can now link my application successfully.

    Is there a way to control this in the build wizard, I wonder... (I could not find a checkbox to turn off "Multi Monitor" support.)

  3. #3
    Administrator
    Join Date
    Mar 2008
    Posts
    25
    Thanks for posting your workaround. No, the BuildWizard does not provide for excluding multimonitor support, so as long as you don't need this, your approach is probably best.

    I would be interested to find the underlying cause of this. If you could submit a support incident, we could investigate this further.

  4. #4
    Junior Member
    Join Date
    Mar 2009
    Posts
    3

    Red face

    The link error seems to point to the fact that a module within MFC's nafxcwd.lib
    must already be defining the globals that SECMultiMonitor.cpp is trying to define with the COMPILE_MULTIMON_STUBS macro.
    (Maybe an earlier version of Visual Studio needed this?)

    So, I suspect that removing SECMultiMon.obj from my ot library build would still allow use of the multiple monitor support, although I don't actually use it.

    I'll try to get time to post an incident... But for now, I was able to complete my migration from OT 6 to OT 10.1 with Visual Studio 2005SP1 making only these changes:

    1. Changed the DECLARE_BUTTON macro:
    class CMyComboBtn : public SECComboBtn
    {
    #if 1 // new OT v10.1 macro name
    TOOLKIT_DECLARE_BUTTON(CMyComboBtn)
    #else // old OT 6 macro name
    DECLARE_BUTTON(CMyComboBtn)
    #endif

    2. Removed the 'boolean' typedef in jconfig.h, because it is already defined in the Windows header rpcnhdr.h:
    #if 0
    typedef unsigned char boolean;;
    #endif

    3. Removed the SECMultiMonitors.obj module from my OT library to fix the link error, as described above.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •