Skip to content

error LNK2001: unresolved external symbol __declspec(dllimport) #194

@MonicaLiu0311

Description

@MonicaLiu0311

Hello, I am the maintainer of vcpkg. In the process of updating to v0.7.1, I found the following error. After investigation, I found that InfluxDB_EXPORTS was not defined during dynamic linking, which caused it to execute __declspec(dllimport).

TCP.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::InfluxDBException::InfluxDBException(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0InfluxDBException@influxdb@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
UnixSocket.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::InfluxDBException::InfluxDBException(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0InfluxDBException@influxdb@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
InfluxDB.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::InfluxDBException::InfluxDBException(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0InfluxDBException@influxdb@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
InfluxDBFactory.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::InfluxDBException::InfluxDBException(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0InfluxDBException@influxdb@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
HTTP.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::InfluxDBException::InfluxDBException(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0InfluxDBException@influxdb@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
UDP.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::InfluxDBException::InfluxDBException(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0InfluxDBException@influxdb@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
InfluxDB.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::Point::~Point(void)" (__imp_??1Point@influxdb@@QEAA@XZ) referenced in function "public: void * __cdecl influxdb::Point::`scalar deleting destructor'(unsigned int)" (??_GPoint@influxdb@@QEAAPEAXI@Z)
BoostSupport.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::Point::~Point(void)" (__imp_??1Point@influxdb@@QEAA@XZ)
InfluxDB.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::Point::Point(class influxdb::Point &&)" (__imp_??0Point@influxdb@@QEAA@$$QEAV01@@Z) referenced in function "public: static void __cdecl std::_Default_allocator_traits<class std::allocator<class influxdb::Point> >::construct<class influxdb::Point,class influxdb::Point>(class std::allocator<class influxdb::Point> &,class influxdb::Point * const,class influxdb::Point &&)" (??$construct@VPoint@influxdb@@V12@@?$_Default_allocator_traits@V?$allocator@VPoint@influxdb@@@std@@@std@@SAXAEAV?$allocator@VPoint@influxdb@@@1@QEAVPoint@influxdb@@$$QEAV34@@Z)
BoostSupport.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::Point::Point(class influxdb::Point &&)" (__imp_??0Point@influxdb@@QEAA@$$QEAV01@@Z)
  Hint on symbols that are defined and could potentially match:
    "__declspec(dllimport) public: __cdecl influxdb::Point::Point(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0Point@influxdb@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
TCP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl influxdb::InfluxDBException::~InfluxDBException(void)" (??1InfluxDBException@influxdb@@UEAA@XZ)
UnixSocket.cxx.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl influxdb::InfluxDBException::~InfluxDBException(void)" (??1InfluxDBException@influxdb@@UEAA@XZ)
InfluxDB.cxx.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl influxdb::InfluxDBException::~InfluxDBException(void)" (??1InfluxDBException@influxdb@@UEAA@XZ)
InfluxDBFactory.cxx.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl influxdb::InfluxDBException::~InfluxDBException(void)" (??1InfluxDBException@influxdb@@UEAA@XZ)
HTTP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl influxdb::InfluxDBException::~InfluxDBException(void)" (??1InfluxDBException@influxdb@@UEAA@XZ)
UDP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl influxdb::InfluxDBException::~InfluxDBException(void)" (??1InfluxDBException@influxdb@@UEAA@XZ)
TCP.cxx.obj : error LNK2001: unresolved external symbol "public: __cdecl influxdb::InfluxDBException::InfluxDBException(class influxdb::InfluxDBException const &)" (??0InfluxDBException@influxdb@@QEAA@AEBV01@@Z)
UnixSocket.cxx.obj : error LNK2001: unresolved external symbol "public: __cdecl influxdb::InfluxDBException::InfluxDBException(class influxdb::InfluxDBException const &)" (??0InfluxDBException@influxdb@@QEAA@AEBV01@@Z)
InfluxDB.cxx.obj : error LNK2001: unresolved external symbol "public: __cdecl influxdb::InfluxDBException::InfluxDBException(class influxdb::InfluxDBException const &)" (??0InfluxDBException@influxdb@@QEAA@AEBV01@@Z)
InfluxDBFactory.cxx.obj : error LNK2001: unresolved external symbol "public: __cdecl influxdb::InfluxDBException::InfluxDBException(class influxdb::InfluxDBException const &)" (??0InfluxDBException@influxdb@@QEAA@AEBV01@@Z)
HTTP.cxx.obj : error LNK2001: unresolved external symbol "public: __cdecl influxdb::InfluxDBException::InfluxDBException(class influxdb::InfluxDBException const &)" (??0InfluxDBException@influxdb@@QEAA@AEBV01@@Z)
UDP.cxx.obj : error LNK2001: unresolved external symbol "public: __cdecl influxdb::InfluxDBException::InfluxDBException(class influxdb::InfluxDBException const &)" (??0InfluxDBException@influxdb@@QEAA@AEBV01@@Z)
Point.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int influxdb::Point::floatsPrecision" (__imp_?floatsPrecision@Point@influxdb@@2HA) referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl influxdb::Point::getFields(void)const " (?getFields@Point@influxdb@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
HTTP.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::Transport::Transport(void)" (__imp_??0Transport@influxdb@@QEAA@XZ) referenced in function "public: __cdecl influxdb::transports::HTTP::HTTP(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0HTTP@transports@influxdb@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
UDP.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::Transport::Transport(void)" (__imp_??0Transport@influxdb@@QEAA@XZ)
TCP.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::Transport::Transport(void)" (__imp_??0Transport@influxdb@@QEAA@XZ)
UnixSocket.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::Transport::Transport(void)" (__imp_??0Transport@influxdb@@QEAA@XZ)
HTTP.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl influxdb::Transport::~Transport(void)" (__imp_??1Transport@influxdb@@UEAA@XZ) referenced in function "int `public: __cdecl influxdb::transports::HTTP::HTTP(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)'::`1'::dtor$0" (?dtor$0@?0???0HTTP@transports@influxdb@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z@4HA)
UDP.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl influxdb::Transport::~Transport(void)" (__imp_??1Transport@influxdb@@UEAA@XZ)
TCP.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl influxdb::Transport::~Transport(void)" (__imp_??1Transport@influxdb@@UEAA@XZ)
UnixSocket.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl influxdb::Transport::~Transport(void)" (__imp_??1Transport@influxdb@@UEAA@XZ)
BoostSupport.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl influxdb::Point::Point(class influxdb::Point const &)" (__imp_??0Point@influxdb@@QEAA@AEBV01@@Z) referenced in function "public: static void __cdecl std::_Default_allocator_traits<class std::allocator<class influxdb::Point> >::construct<class influxdb::Point,class influxdb::Point &>(class std::allocator<class influxdb::Point> &,class influxdb::Point * const,class influxdb::Point &)" (??$construct@VPoint@influxdb@@AEAV12@@?$_Default_allocator_traits@V?$allocator@VPoint@influxdb@@@std@@@std@@SAXAEAV?$allocator@VPoint@influxdb@@@1@QEAVPoint@influxdb@@AEAV34@@Z)
  Hint on symbols that are defined and could potentially match:
    "__declspec(dllimport) public: __cdecl influxdb::Point::Point(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0Point@influxdb@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
UDP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl influxdb::Transport::query(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?query@Transport@influxdb@@UEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z)
TCP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl influxdb::Transport::query(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?query@Transport@influxdb@@UEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z)
UnixSocket.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl influxdb::Transport::query(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?query@Transport@influxdb@@UEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z)
UDP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl influxdb::Transport::execute(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?execute@Transport@influxdb@@UEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z)
TCP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl influxdb::Transport::execute(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?execute@Transport@influxdb@@UEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z)
UnixSocket.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl influxdb::Transport::execute(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?execute@Transport@influxdb@@UEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z)
UDP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl influxdb::Transport::createDatabase(void)" (?createDatabase@Transport@influxdb@@UEAAXXZ)
TCP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl influxdb::Transport::createDatabase(void)" (?createDatabase@Transport@influxdb@@UEAAXXZ)
UnixSocket.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl influxdb::Transport::createDatabase(void)" (?createDatabase@Transport@influxdb@@UEAAXXZ)
UDP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl influxdb::Transport::setProxy(class influxdb::Proxy const &)" (?setProxy@Transport@influxdb@@UEAAXAEBVProxy@2@@Z)
TCP.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl influxdb::Transport::setProxy(class influxdb::Proxy const &)" (?setProxy@Transport@influxdb@@UEAAXAEBVProxy@2@@Z)

UnixSocket.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl influxdb::Transport::setProxy(class influxdb::Proxy const &)" (?setProxy@Transport@influxdb@@UEAAXAEBVProxy@2@@Z)

src\InfluxDB.dll : fatal error LNK1120: 13 unresolved externals

ninja: build stopped: subcommand failed.

For further confirmation, I abandoned vcpkg, built your library separately, and found the same error. See the attachment for details:
error.log

Related PR: microsoft/vcpkg#31145

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions