-1

I'm trying to set up PoDoFo for C++ in Eclipse OS - Ubuntu 16.04 LTS
Podofo link - http://podofo.sourceforge.net/download.html

I downloaded the latest version and performed the following stpes

  mkdir podofo-build
  cd podofo-build
  cmake ../podofo
  make
  su
  make install

everything works fine till this point. This create a libpodofo.a file in my /usr/local/lib directory

In Eclipse Under C++ linker I added Library search path(-L) as /usr/local/lib and in Libraries(-l) I added podofo Screenshot for G++ linker in eclipse

Then I ran a Hello world example for podofo Link : http://podofo.sourceforge.net/examplehelloworld_cpp.html

make all Building target: opencvtest Invoking: GCC C++ Linker g++ -L/usr/local/lib -L/lib/x86_64-linux-gnu -o"opencvtest" ./src/opencvtest.o ./src/podofo_test.o -lopencv_imgcodecs -lpodofo -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_flann /usr/bin/ld: /usr/local/lib/libpodofo.a(PdfEncodingFactory.cpp.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line makefile:45: recipe for target 'opencvtest' failed collect2: error: ld returned 1 exit status make: *** [opencvtest] Error 1

Ldconfig -p gives me following : ldconfig -p | grep pthread.so grep: warning: GREP_OPTIONS is deprecated; please use an alias or script libpthread.so.0 (libc6,x86-64, OS ABI: Linux 2.6.32) => /lib/x86_64-linux-gnu/libpthread.so.0 libgpgme-pthread.so.11 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libgpgme-pthread.so.11

Can someone please help me getting rid of this error , what configuration should I add to resolve this, any suggested reads are also welcomed.

Please let me know if any other info is required. Thanks in advance.

saumitra mallick
  • 395
  • 2
  • 11
  • 2
    You either need to build with the `-pthread` flag (including for linking), or explicitly link with the `pthread` library. I'm sure there are multiple duplicates here, something even a simple search should have turned up. – Some programmer dude Jan 01 '18 at 11:43
  • 1
    Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – user0042 Jan 01 '18 at 11:47
  • @Someprogrammerdude I found this answer earlier also , but I'm having a hard time understanding how to this in eclipse (ie setting project properties in eclipse) – saumitra mallick Jan 01 '18 at 11:48

1 Answers1

0

Here is what I was asking exactly. In eclipse go to Project->c/c++ build-> GCC C++ linker -> Libraries

under Libraries (-l) section add your library in my case it was libpthread.so.0 so you'll be adding pthread Screenshot

for anyone having problems with PoDoFo (ie only libpodofo.a file generated ) add the following libs : podofo pthread jpeg z fontconfig freetype

saumitra mallick
  • 395
  • 2
  • 11