hemprasad / gflags

Automatically exported from code.google.com/p/gflags
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Problem with linking gflags library on Mac OS Lion #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm really sorry, if this is a stupid question. But I really don't know what to 
do.

What steps will reproduce the problem?
1. Install gflags
2. Include <gflags/gflag.h> in my project
3. Try to compile

What is the expected output? What do you see instead?
A got an linker error
Undefined symbols for architecture x86_64:
  "google::FlagRegisterer::FlagRegisterer(char const*, char const*, char const*, char const*, void*, void*)", referenced from:
      global constructors keyed to _ZN3fLI13FLAGS_steps_wEin cc1X5zzY.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

What version of the product are you using? On what operating system?
gflags: version 2.0
Mac OS X 10.7.3 (Lion)

Original issue reported on code.google.com by yuri.zem...@gmail.com on 9 Apr 2012 at 9:19

GoogleCodeExporter commented 9 years ago
In your steps to reproduce the problem, I a missing something like "Add library 
gflags to linker arguments". How do you compiler your program ? I.e., do you 
use a self-written Makefile, CMake, automake,... ?

Using g++ for compilation and linking, you need to pass the argument "-lgflags" 
(or similar).

Original comment by andreas....@gmail.com on 9 Apr 2012 at 9:29

GoogleCodeExporter commented 9 years ago
Sorry, my mistake. Thanks for the answer!

Original comment by yuri.zem...@gmail.com on 10 Apr 2012 at 10:06

GoogleCodeExporter commented 9 years ago
Never mind, I am glad you resolved your problem.

Original comment by andreas....@gmail.com on 10 Apr 2012 at 2:36

GoogleCodeExporter commented 9 years ago

Original comment by andreas....@gmail.com on 20 Mar 2014 at 3:36