alanxz / SimpleAmqpClient

Simple C++ Interface to rabbitmq-c
MIT License
405 stars 213 forks source link

Linker error when building DLL on Windows 11 #349

Open Harters opened 5 months ago

Harters commented 5 months ago

Hi,

I'm trying to build SimpleAmqpClient on a Windows 11 box using MS Visual Studio Community 2022. The invocation I'm using is this:

cmake -G "Visual Studio 17 2022" -A x64 -DBoost_INCLUDE_DIR="C:/boost/1.77.0/lib/native/include" -DBOOST_ROOT="C:/boost/1.77.0" -DBOOST_LIBRARYDIR="C:/boost/1.77.0/lib/native" -DRabbitmqc_INCLUDE_DIR="C:/rabbitmq-c/include" -DRabbitmqc_LIBRARY="C:/rabbitmq-c/lib/rabbitmq.4.lib" -DBoost_ADDITIONAL_VERSIONS="1.77 1.77.0" -DBoost_USE_STATIC_LIBS=ON -DBUILD_STATIC_LIBS=ON -DENABLE_SSL_SUPPORT=OFF ..

and to make, this:

cmake --build . --config Release

Compilation seems to occur but I get this link error. Any ideas please?


Generating Code... Creating library C:/SimpleAmqpClient/build/Release/SimpleAmqpClient.7.lib and object C:/SimpleAmqpClient/build/Release/SimpleAmqpClient.7.exp TableImpl.obj : error LNK2019: unresolved external symbol amqp_empty_table referenced in function "public: static struct amqp_tablet __cdecl AmqpClient::Detail::TableValueImpl::CopyTable(struct amqp_tablet const &,class boost::shared_ptr &)" (?CopyTable@TableValueImpl@Detail@AmqpClient@@SA?AUamqp_tablet@@AEBU4@AEAV?$shared_ptr@Uamqp_poolt@@@boost@@@Z) [C:\SimpleAmqpClient\build\Simple AmqpClient.vcxproj] C:\SimpleAmqpClient\build\Release\SimpleAmqpClient.7.dll : fatal error LNK1120: 1 unresolved externals [C:\SimpleAmqpClient\build\SimpleAmqpClient.vcxproj]

If I use the sln file I get: Error LNK2001 unresolved external symbol amqp_empty_table SimpleAmqpClient C:\SimpleAmqpClient\build\TableImpl.obj 1

guntern commented 2 weeks ago

I run into a similar issue, when trying to compile a program using the SimpleAmqpClient library. Do you get the error when compiling the library or your actual application? Have you maybe solved the issue? I guess you already took a look at #112 .