Giter Site home page Giter Site logo

Comments (3)

alanxz avatar alanxz commented on July 28, 2024

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.

adambadura avatar adambadura commented on July 28, 2024

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.

leogi22 avatar leogi22 commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.