Comments (3)
Did you build Boost as a static library (default on win32 I think) or as a dll? If its static you need to pass Boost_USE_STATIC_LIBS=ON when running CMake. (This is a CMake boost module weirdness. See cmake --help-module FindBoost)
I currently have no way to link two projects together like that with different builds of SimpleAmqpClient picking up different builds of rabbitmq-c. Unfortunately I think your best option would be to manually edit the project config after CMake generates it. Sadly this will get blown away every time CMake runs. You could probably cook something up my modifying the SimpleAmqpClient CmakeLists.txt file
from simpleamqpclient.
Adding -DBoost_USE_STATIC_LIBS=ON
to the above command line did the trick. Thanks!
And also I solved issue of configurations matching. Apparently in this case we can use $(Configuration)
MSBuild macro. In the command line above I use now: -DRabbitmqc_INCLUDE_DIR="C:\Library\rabbitmq-c\$(Configuration)\include" -DRabbitmqc_LIBRARY="C:\Library\rabbitmq-c\$(Configuration)\lib\rabbitmq.1.lib"
.
It does work because CMake just blindly copies those paths to project properties. It wouldn't work if CMake would try to check availability of the library (as it does with Boost for example) since it would not be able to resolve the macro.
from simpleamqpclient.
I am having trouble solving some CRT problems between my exe and the simpleamqpclient2.lib and boost and the rabbitmq.4.lib
I've used cmake/VS 2013 to build to rabbitmq.4.lib, using /MTd and producing a .lib
I then used cmake with the Boost_USE_STATIC_LIBS=ON flag (in cmake gui by adding Entry), then built the simpleamqpclient2.lib by linking against the boost
libboost_chrono-vc120-mt-sgd-1_59.lib and
libboost_system-vc120-mt-sgd-1_59.lib
rabbitmq.4.lib, using the /MTd CRT setting as well
It built fine.
I then linked my exe to the libs
My exe uses the /MTd CRT setting.
I then load the the simpleamqpclient.h and run the exe
1 - AmqpClient::Channel::ptr_t channel = AmqpClient::Channel::Create("localhost");
2 - std::string myqueue("my_queue");
3 - myqueue = channel->DeclareQueue(std::string(""), false, false, false, true);
Every time I get the following error:
dbgheap.c line 1424
Expression pFirstBlock == phead
whenever line 2 is executed and the string is being deleted
which suggest a problem between the heaps. Based on what I could find, it has to do with the exe and the dll using different version of the CRT, which is not the case since everything is compiled using the /MTd option, and the libboost libraries are using statically. I did try different combinations of /MTd and /MDd.
Please help!
Also, I'm new to the cmake utility, It appears that the solution it builds for the simpleamqpclient produces both a simpleamqpclient.lib and a simpleamqpclient.dll, and then I link in the exe to the simpleamqpclient2.lib. Is that correct?
from simpleamqpclient.
Related Issues (20)
- How to quit basicsumemessage when a quit signal coming ?
- when set message HeaderTable, the ReplyTo property Settings have been cleared. HOT 3
- Is This Dead? HOT 3
- Classify Exceptions
- Consumer stops consuming inside Docker container (after some idle period) HOT 1
- fatal error: SimpleAmqpClient/SimpleAmqpClient.h: No such file or directory HOT 1
- Channel::OpenOpts::FromUri results in Access violation reading location 0x0000000000000000. HOT 3
- Version 2.4 compatibility with newer Rabbit servers HOT 4
- Latest NuGet of SimpleAmqpClient HOT 1
- Linking the library on Linux using cmake
- Keep alive for long running connections HOT 3
- App crashes when connection closes HOT 2
- `std::bad_alloc()` when header table is empty
- Handle node failure in RabbitMQ cluster
- Support for Quorum queues
- Bug,Exclusive always true!
- Channel can't open
- Compiling with boost 1.82 generates deprecation warnings
- On the issue of creating channels HOT 7
- Test Mate C++ VSCode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simpleamqpclient.