caniouff / google-breakpad

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

Undefined reference to pthread_once (Linux) #656

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am attempting to follow the instructions on the Linux Starter Guide page 
(https://code.google.com/p/google-breakpad/wiki/LinuxStarterGuide), but I'm 
having trouble with linking the Breakpad code with the example program on that 
guide page.  I have downloaded, configured, and made the code correctly as far 
as I can tell, and I copied and pasted the example program off the guide page.  
When I try to compile, I get the error: 
/home/slaird/google-breakpad-read-only/src/client/linux/libbreakpad_client.a(gui
d_creator.o): In function `GUIDGenerator::InitOnce()':
/home/slaird/google-breakpad-read-only/src/common/linux/guid_creator.cc:75: 
undefined reference to `pthread_once'
collect2: error: ld returned 1 exit status

My compile command is: g++ -I/home/slaird/google-breakpad-read-only/src/ 
test.cpp -o test -L/home/slaird/google-breakpad-read-only/src/client/linux 
-lbreakpad_client

What steps will reproduce the problem?
1. I checked out the code at the Google Code website with "svn checkout 
http://google-breakpad.googlecode.com/svn/trunk/ google-breakpad-read-only" per 
instructions there.
2. I ran "./configure && make" from the google-breakpad-read-only directory.
3. I created test.cpp in the google-breakpad-read-only directory containing the 
example program on the Linux Starter Guide page.
4. I compiled test.cpp with the above command.

What is the expected output? What do you see instead?
I expected the program to properly compile.  Instead I got the above error 
message.

What version of the product are you using? On what operating system?
Version: revision 1458 (downloaded on 06/15/15)
OS: Debian 7.8.0

Please provide any additional information below.
I looked at guid_creator.cc and it looked like everything was in order.  I 
apologize if I'm overlooking something trivial, but any help would be 
appreciated!

Original issue reported on code.google.com by SLai...@gmail.com on 15 Jun 2015 at 8:11

Attachments:

GoogleCodeExporter commented 9 years ago
You probably need -lpthread ?

Original comment by thestig@chromium.org on 15 Jun 2015 at 8:20

GoogleCodeExporter commented 9 years ago
Yup, that did it.  Thank you!

Original comment by SLai...@gmail.com on 15 Jun 2015 at 8:23

GoogleCodeExporter commented 9 years ago

Original comment by thestig@chromium.org on 15 Jun 2015 at 8:36

GoogleCodeExporter commented 9 years ago
Yup, that did it.  Thank you!

Original comment by SLai...@gmail.com on 16 Jun 2015 at 1:02