Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Warning LNK4098

Back to Forum: Tech Off
  • User profile image
    W3bbo

    Very quickly...

     

    I'm working on my first proper C++ project (omgzords, and actually now that I'm used to it, I don't hate it as much as I used to).

     

    Anyway, I'm getting this Linker warning:

     

    warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

     

    Apaprently it means my compiler settings for the CRT doesn't align with that of other libraries I'm using. FWIW here are my Compiler and Linker command-lines:

     

    Compiler:

     

    /Od
    /I "C:\Libraries\QtSerial\QSerialDevice"
    /I "C:\Libraries\Qt\include"
    /I ".\GeneratedFiles\Debug"
    /I "C:\Libraries\Qt\include\qtmain"
    /I "C:\Libraries\Qt\include\QtCore"
    /I ".\\"

    /D "UNICODE"
    /D "WIN32"
    /D "QT_LARGEFILE_SUPPORT"
    /D "QT_THREAD_SUPPORT"
    /D "QT_CORE_LIB"

    /FD
    /EHsc
    /MDd

    /Zc:wchar_t-
    /Yu"StdAfx.h"

    /Fp"Debug\QtConsoleApp.pch"
    /Fo"Debug\\"
    /Fd"Debug\vc90.pdb"

    /nologo
    /c
    /Zi
    /TP
    /errorReport:prompt

     

    ///////////////////////////////////////////////

     

    Linker:

     

    /OUT:"C:\Users\David\Documents\Visual Studio Projects\QtConsoleApp\Debug\QtConsoleApp.exe"

    /NOLOGO
    /LIBPATH:"C:\Libraries\QtSerial\QSerialDevice\build\lib\qintegratedserialdevice\release"
    /LIBPATH:"C:\Libraries\Qt\lib"

    /MANIFEST
    /MANIFESTFILE:"Debug\QtConsoleApp.exe.intermediate.manifest"
    /MANIFESTUAC:"level='asInvoker' uiAccess='false'"
    /DEBUG
    /PDB:"c:\Users\David\Documents\Visual Studio Projects\QtConsoleApp\Debug\QtConsoleApp.pdb"
    /SUBSYSTEM:CONSOLE
    /DYNAMICBASE
    /NXCOMPAT
    /ERRORREPORT:PROMPT

    qtmaind.lib
    QtCored4.lib
    qserialdevice.lib
    QtTest4.lib
    kernel32.lib
    user32.lib
    gdi32.lib
    winspool.lib
    comdlg32.lib
    advapi32.lib
    shell32.lib
    ole32.lib
    oleaut32.lib
    uuid.lib
    odbc32.lib
    odbccp32.lib

     

     

     

    Discuss.

  • User profile image
    Sven Groot

    The most common cause for this is that you are using the debug CRT while linking against a library that uses the release CRT. Does Qt offer debug and release versions of their libraries? If so, make sure you are linking to the debug ones in your own debug builds.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.