alanxz / SimpleAmqpClient

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

Errors while building simpleAmpqClient on Windows 10 ,64bit using Visual studio 17 #213

Open swatinair123 opened 5 years ago

swatinair123 commented 5 years ago

Hi ,I have generated the code using CMAke . i am trying to build the libraries but i am getting so much of errors as below. Can any one tell me if i have missed out on anything . I have added SimpleAmqpClient.2.lib files to the linker files .

Severity Code Description Project File Line Suppression State Error LNK1120 32 unresolved externals SimpleAmqpClient E:\SimpleAmqpClient-master\build\Debug\SimpleAmqpClient.2.dll 1
Error LNK2019 unresolved external symbol amqp_basic_ack referenced in function "public: void cdecl AmqpClient::Channel::BasicAck(struct AmqpClient::Envelope::DeliveryInfo const &,bool)" (?BasicAck@Channel@AmqpClient@@QEAAXAEBUDeliveryInfo@Envelope@2@_N@Z) SimpleAmqpClient E:\SimpleAmqpClient-master\build\Channel.obj 1
Error LNK2019 unresolved external symbol amqp_basic_publish referenced in function "public: void __cdecl AmqpClient::Channel::BasicPublish(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class boost::shared_ptr,bool,bool)" (?BasicPublish@Channel@AmqpClient@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0V?$shared_ptr@VBasicMessage@AmqpClient@@@boost@@_N2@Z) SimpleAmqpClient E:\SimpleAmqpClient-master\build\Channel.obj 1
Error LNK2019 unresolved external symbol amqp_bytes_free referenced in function "public: virtual
cdecl AmqpClient::BasicMessage::~BasicMessage(void)" (??1BasicMessage@AmqpClient@@UEAA@XZ) SimpleAmqpClient E:\SimpleAmqpClient-master\build\BasicMessage.obj 1
Error LNK2019 unresolved external symbol amqp_bytes_malloc referenced in function "public: class boost::shared_ptr cdecl AmqpClient::Detail::ChannelImpl::ReadContent(unsigned short)" (?ReadContent@ChannelImpl@Detail@AmqpClient@@QEAA?AV?$shared_ptr@VBasicMessage@AmqpClient@@@boost@@G@Z) SimpleAmqpClient E:\SimpleAmqpClient-master\build\ChannelImpl.obj 1
Error LNK2019 unresolved external symbol amqp_bytes_malloc_dup referenced in function "public:
cdecl AmqpClient::BasicMessage::BasicMessage(struct amqp_bytest const &,struct amqp_basic_propertiest const *)" (??0BasicMessage@AmqpClient@@QEAA@AEBUamqp_bytest@@PEBUamqp_basic_propertiest@@@Z) SimpleAmqpClient E:\SimpleAmqpClient-master\build\BasicMessage.obj 1
Error LNK2019 unresolved external symbol amqp_connection_close referenced in function "public: virtual cdecl AmqpClient::Channel::~Channel(void)" (??1Channel@AmqpClient@@UEAA@XZ) SimpleAmqpClient E:\SimpleAmqpClient-master\build\Channel.obj 1
Error LNK2001 unresolved external symbol amqp_cstring_bytes SimpleAmqpClient E:\SimpleAmqpClient-master\build\ChannelImpl.obj 1
Error LNK2001 unresolved external symbol amqp_cstring_bytes SimpleAmqpClient E:\SimpleAmqpClient-master\build\BasicMessage.obj 1
Error LNK2019 unresolved external symbol amqp_cstring_bytes referenced in function "public: void
cdecl AmqpClient::Channel::BasicCancel(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?BasicCancel@Channel@AmqpClient@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) SimpleAmqpClient E:\SimpleAmqpClient-master\build\Channel.obj 1

dexception commented 5 years ago

Just add the boost .lib files in your linker path.

czzCreator commented 4 years ago

Hi ,When trying to use cmake on Windows 10 (I want to build all the things below MingGW ) I get the following :

CMake Error at D:/cmake-3.18.4-win64-x64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message): Could NOT find Boost (missing: chrono system) (found suitable version "1.69.0", minimum required is "1.69.0") Call Stack (most recent call first): D:/cmake-3.18.4-win64-x64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:473 (_FPHSA_FAILURE_MESSAGE) D:/cmake-3.18.4-win64-x64/share/cmake-3.18/Modules/FindBoost.cmake:2184 (find_package_handle_standard_args) CMakeLists.txt:63 (find_package)

but i have already compiled boost 1_69_0 and install Lib in F:\boost_1_69_0\czz_install\lib Snipaste_2020-10-23_11-20-43

i compiled with boost 1.69.0 with commands below: build.bat gcc (i want to use mingw to dealed it ,but not supported ) .\bjam --toolset=gcc --with-system --with-chrono --with-timer --prefix=F:\boost_1_69_0\czz_install install

and get below: Snipaste_2020-10-23_11-07-19

so I try to modify the CMakeLists.txt to fix the problem: Snipaste_2020-10-23_11-11-08

then i trying to use cmake command again: but i still got below:

CMake Error at D:/cmake-3.18.4-win64-x64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message): Could NOT find Boost (missing: chrono system) (found suitable version "1.69.0", minimum required is "1.69.0") Call Stack (most recent call first): D:/cmake-3.18.4-win64-x64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:473 (_FPHSA_FAILURE_MESSAGE) D:/cmake-3.18.4-win64-x64/share/cmake-3.18/Modules/FindBoost.cmake:2184 (find_package_handle_standard_args) CMakeLists.txt:63 (find_package)

At last, i have to review the FindBoost.cmake And FindPackageHandleStandardArgs.cmake to see what happened.

i found it's Boost_chrono_FOUND Boost_system_FOUND Not be set to true that cause the error how counld this happened ,i have already include the header file path and the libpath........

i don't know why ,can you help me....

wbfire commented 3 years ago

Have you solved the problem ? swatinair123 @swatinair123