sdpper / rabbitcpp

Automatically exported from code.google.com/p/rabbitcpp
0 stars 0 forks source link

Library not working on OSX #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've compiled the library on OSX and it compiles (w/warnings) yet when 
installing it to /usr/lib I keep getting unresolved symbols.

Since it wasn't working as a .a, I've taken the additional steps of compiling 
it into a .dylib (including the steps @ 
http://qin.laya.com/tech_coding_help/dylib_linking.html ). The build output 
shows it finds the library (by not failing to find it) yet I get:
=====
Undefined symbols:
  "AMQPExchange::setHeader(char const*, int)", referenced from:
      _main in main.o
  "AMQP::~AMQP()", referenced from:
      _main in main.o
      _main in main.o
  "AMQPExchange::Publish(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, char const*)", referenced from:
      _main in main.o
  "AMQP::createQueue(char const*)", referenced from:
      _main in main.o
  "AMQPQueue::Declare()", referenced from:
      _main in main.o
  "AMQP::AMQP(char const*)", referenced from:
      _main in main.o
  "AMQPQueue::Bind(char const*, char const*)", referenced from:
      _main in main.o
  "AMQPExchange::Declare(char const*, char const*)", referenced from:
      _main in main.o
  "AMQPExchange::setHeader(char const*, char const*)", referenced from:
      _main in main.o
      _main in main.o
  "AMQPExchange::Publish(char const*, char const*)", referenced from:
      _main in main.o
      _main in main.o
  "AMQP::createExchange(char const*)", referenced from:
      _main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Original issue reported on code.google.com by ucnt...@gmail.com on 2 Aug 2010 at 10:13

GoogleCodeExporter commented 8 years ago
try changing order of parameters to compiler - -l should be AFTER filename.
On linux this would look like:
g++ -o output file.cpp -I/usr/include -L/usr/lib -lampqcpp

Original comment by fbo...@gmail.com on 14 Apr 2011 at 12:08