Thursday, 15 March 2012

c++ - Unable to compile amqpcpp, Make error -



c++ - Unable to compile amqpcpp, Make error -

i have issue compiling amqpcpp on centos virtual machine, works fine on imac.

when running create error:

g++ -wall -i/usr/local/include -l/usr/local/lib -iinclude/ -c -o src/amqpexchange.o src/amqpexchange.cpp src/amqpexchange.cpp: in fellow member function ‘void amqpexchange::senddeclarecommand()’: src/amqpexchange.cpp:73: error: cannot convert ‘amqp_table_t’ ‘amqp_boolean_t’ argument ‘7’ ‘amqp_exchange_declare_ok_t* amqp_exchange_declare(amqp_connection_state_t_*, amqp_channel_t, amqp_bytes_t, amqp_bytes_t, amqp_boolean_t, amqp_boolean_t, amqp_boolean_t, amqp_boolean_t, amqp_table_t)’ make: *** [src/amqpexchange.o] error 1

github issue url

g++ version

g++ --version g++ (gcc) 4.4.7 20120313 (red hat 4.4.7-11)

unfortunately, not know plenty of c++ or create yet understand issue. seems compiler complaining type cast style conversion in code, confusing works fine on mac.

any ideas?

thanks

edit: have downloaded latest version of amqpcpp on both machines , re-compiled them, same results.

edit 2: realised installed librabbitmq-c on mac couple of months ago, i've updated latest version , compains of similar error centos machine, appears amqpcpp not compatible latest changes librabbitmq codebase. seems particular commit causes issue:

commit 2340b039f029f3b8101a164d3bcd547be1106906

i going seek , update amqpcpp codebase apply fix, post link pull request if works. otherwise, using before commit when checking out code should allow work.

thanks

i found cause , 2 (temporary) resolutions.

option one.. pull librabbitmq code before breaking changes:

$ git clone https://github.com/alanxz/rabbitmq-c $ cd rabbitmq-c/ $ git checkout e1746f92585d59364fc48b6305ce25d7fc86c2a4

and compile normal. have tested method , works fine me. maintain eye out future update on amqpcpp github page know when safe update latest version.

option 2 .. update amqpcpp code:

amqpexchange.cpp:

un-comment line 69 reads:

amqp_boolean_t autodelete = (parms & amqp_autodelete) ? 1:0;

change line 73 reads:

amqp_exchange_declare(*cnn, (amqp_channel_t) 1, exchange, exchangetype, passive, durable, autodelete, 0, args );

then should able compile without error. beware: there more changes in librabbitmq code function, why stated temporary fix. amqpcpp project need updated reflect recent changes. prepare works need to, may find other functionality broken.

i decided utilize alternative 1 , it's working expected.

thanks

c++ make amqp

No comments:

Post a Comment