pombreda / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

Mac OSX: Undefined symbols for architecture x86_64 #126

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile glog on OSX x86_64 with ./configure 
--build=x86_64-apple-darwin11.4.0. Seems the default configuration incorrectly 
finds i386-apple-darwin11.4.0. See my OS details below.
2. Compile program with "g++ test_logging.cpp -o foo -Iglog-0.3.2/include" 
(test_logging.cpp below)

What is the expected output? What do you see instead?
Should compile binary, instead I get:
Undefined symbols for architecture x86_64:
  "google::InitGoogleLogging(char const*)", referenced from:
      _main in ccSZOitl.o
  "google::LogMessage::LogMessage(char const*, int)", referenced from:
      _main in ccSZOitl.o
  "google::LogMessage::~LogMessage()", referenced from:
      _main in ccSZOitl.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?
- glog 0.3.2
- Mac OSX 11.7.4:
Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; 
root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64

Please provide any additional information below.

test_loggin.cpp:

#include <string>
#include <glog/logging.h>

using namespace std;

int main(int argc, char* argv[])
{
    google::InitGoogleLogging("foo");

   LOG(INFO) << "foo";
};

Thanks for any help, apologies I'm new to C++.

Original issue reported on code.google.com by bevan.ko...@gmail.com on 3 Jul 2012 at 8:31

GoogleCodeExporter commented 9 years ago
It looks like you need -lglog (or -L/usr/local/lib -lglog) in your command line?

Original comment by shinichi...@gmail.com on 19 Jul 2012 at 7:25