Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Linker error for vcpkg built package
Qt 6.11 is out! See what's new in the release blog

Linker error for vcpkg built package

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 516 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by Perdrix
    #1

    I'm getting the following linker errors:

    1>SmtpMime.lib(mimecontentformatter.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(mimecontentencoder.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(mimebase64formatter.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(mimeqpformatter.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(mimebase64encoder.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(mimeqpencoder.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(mimepart.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(quotedprintable.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(mimemultipart.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(mocs_compilation.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(emailaddress.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(mimemessage.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(smtpclient.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(mimetext.cpp.obj) : error LNK2001: unresolved external symbol __imp_qt_version_tag_6_9
    1>SmtpMime.lib(smtpclient.cpp.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: char const * __cdecl QMetaEnum::valueToKey(unsigned __int64)const " (__imp_?valueToKey@QMetaEnum@@QEBAPEBD_K@Z) referenced in function "protected: void __cdecl SmtpClient::changeState(enum SmtpClient::ClientState)" (?changeState@SmtpClient@@IEAAXW4ClientState@1@@Z)
    1>SmtpMime.lib(mocs_compilation.cpp.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct QMetaObject const * __cdecl QObjectData::dynamicMetaObject(void)const " (__imp_?dynamicMetaObject@QObjectData@@QEBAPEBUQMetaObject@@XZ) referenced in function "public: virtual struct QMetaObject const * __cdecl MimeContentFormatter::metaObject(void)const " (?metaObject@MimeContentFormatter@@UEBAPEBUQMetaObject@@XZ)
    1>  Hint on symbols that are defined and could potentially match:
    1>    "__declspec(dllimport) public: struct QMetaObject * __cdecl QObjectData::dynamicMetaObject(void)const " (__imp_?dynamicMetaObject@QObjectData@@QEBAPEAUQMetaObject@@XZ)
    1>D:\Github\DSS\x64\Debug\DeepSkyStackerLive.exe : fatal error LNK1120: 3 unresolved externals
    

    the portfile.cmake looks like:

    vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
    
    vcpkg_from_github(
        OUT_SOURCE_PATH SOURCE_PATH
        REPO deepskystacker/SmtpClient-for-Qt
    	REF 79eb946c5be718149847ea0bd015a3cebcbf9f98
        SHA512 00f3e14dd649d46a878b06f9c4a525907fa8f3072d58fc7bcb9e8a3a73c0289049e54c4170f8d024d1c001928e4af7d66a391e297be0b6a9f3cf07bc6ff2f16d
        HEAD_REF V2.0
    	
    )
    set(ENV{QT_DIR} $ENV{QTDIR})
    set(ENV{Qt6_DIR} $ENV{QTDIR})
    set(CMAKE_AUTOMOC ON)
    
    set (options
    	"-DBUILD_SHARED_LIBS=OFF "
    	"-DBUILD_DEMOS=OFF "
    	"-DBUILD_TESTS=OFF "
    )
    
    message ("****************************************************************")
    message ("Setting build options: " ${options})
    message ("****************************************************************")
    
    vcpkg_cmake_configure(
        SOURCE_PATH "${SOURCE_PATH}"
    	OPTIONS ${options}
    )
    
    vcpkg_cmake_install()
    
    vcpkg_copy_pdbs()
    
    vcpkg_fixup_pkgconfig()
    
    vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}") 
    
    file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
    
    file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
    vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
    

    what am I doing wrong please?

    Even stranger - this only happens with an MSBuild build. The CMake build works fine.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved