aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: compilation error "cannot find -lpthread"  (Read 7953 times)

ch3ch2oh

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 4
compilation error "cannot find -lpthread"
« on: November 24, 2005, 04:09:43 PM »

I'm trying to compile.
After config, everything seems OK.
But make gives the following error :

gcc    -static  -lpthread -o cas  cas-cas.o cas-configfile.o cas-functions.o cas-graphics.o cas-html.o cas-lines.o -L/usr/X11R6/lib -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm -lgd
/usr/bin/ld: cannot find -lpthread
collect2: ld returned 1 exit status
make[5]: *** [cas] Erreur 1
make[5]: Leaving directory `/home/moi/Logiciels/Internet/aMule-2.0.3/src/utils/cas'




./configure  --enable-static --enable-cas --enable-wxcas  --disable-debug
===>

Configured aMule 2.0.3 for 'i686-pc-linux'.

  aMule enabled options:

  **** aMule Core ****
  Prefix where aMule should be installed?                    /usr/local
  Should aMule be compiled with i18n support?                yes
  Should aMule be compiled in debug mode?                    no
  Should aMule be compiled with profiling?                   no
  Should aMule be compiled with optimizations?               no
  Should aMule be compiled with taskbar icon support?        yes
  Should aMule be compiled with old GTK taskbar icon?        yes
  Should aMule be compiled with UTF-8 taskbar icon support?  no
  Should aMule be linked against patched gsocket?            yes
  Should aMule monolithic application be built?              yes
  Should aMule daemon version be built?                      no
  Should aMule remote gui be built? (EXPERIMENTAL)           no
  Crypto++ library/headers style?                            embedded

  **** aMule TextClient ****
  Should aMule Command Line Client be built?                 no
  Should aMule GUI Client be built?                          no

  **** aMule WebServer ****
  Should aMule WebServer be built?                           no
  Should aMule WebServer GUI be built?                       no

  **** aMule ED2K Links Handler ****
  Should aMule ED2K Links Handler be built?                  yes

  **** aMuleLinkCreator ****
  Should aMuleLinkCreator GUI version (alc) be built?        no
  Should aMuleLinkCreator for console (alcc) be built?       no

  **** aMule Statistics ****
  Should C aMule Statistics (CAS) be built?                  yes
  Should aMule GUI Statistics (wxCas) be built?              yes

  **** General Libraries and Tools ****
  Should ccache support be enabled?                          no
  Libraries aMule will use to build:
                                       wxWidgets             2.4.2
                                       crypto++              embedded
                                       libgd                 2.0.33
                                       zlib                  1.2.2.2


Any solution ?
Logged

Gerd78

  • Hero Member
  • *****
  • Karma: 9
  • Offline Offline
  • Posts: 681
RE: compilation error "cannot find -lpthread"
« Reply #1 on: November 24, 2005, 09:01:21 PM »

Quote
Originally posted by ch3ch2oh
./configure  --enable-static --enable-cas --enable-wxcas  --disable-debug
Try:

./configure  --disable-static --enable-cas --enable-wxcas  --disable-debug

Otherwise you need the static version of *all* libraries used by *any* application in the aMule package, and your executables will be *huge*.

If you want to link aMule with static wx libraries, build wx with

./configure --disable-shared

and make sure before building aMule that the /usr/bin/wx-config or /usr/local/bin/wx-config symlink points to a static wx-config script such as /usr/lib/wx/config/gtk2-unicode-release-static-2.7 or similar.

aMule will then pick up the static wx libraries without using ./configure --enable-static and the other libraries will be linked dynamically.
Logged

ch3ch2oh

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 4
Re: compilation error "cannot find -lpthread"
« Reply #2 on: November 25, 2005, 10:46:53 AM »

I've done it.
Now, the error is :

make[5]: Entering directory `/home/moi/Logiciels/Internet/aMule-2.0.3/src/utils/wxCas/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I../../../..    -I/usr/lib/wx/include/base-2.4 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DUSE_EMBEDDED_CRYPTO    -MT wxcas-wxcas.o -MD -MP -MF ".deps/wxcas-wxcas.Tpo" -c -o wxcas-wxcas.o `test -f 'wxcas.cpp' || echo './'`wxcas.cpp; \
then mv -f ".deps/wxcas-wxcas.Tpo" ".deps/wxcas-wxcas.Po"; else rm -f ".deps/wxcas-wxcas.Tpo"; exit 1; fi
wxcas.cpp:51:2: #error You must set wxUSE_PRINTING_ARCHITECTURE to 1 in setup.h to compile wxCas.
In file included from /usr/include/wx/gdicmn.h:29,
                 from /usr/include/wx/image.h:20,
                 from wxcas.cpp:54:
/usr/include/wx/font.h:82: error: expected class-name before '{' token
/usr/include/wx/font.h: In member function `bool wxFontBase::Ok() const':
/usr/include/wx/font.h:104: error: `m_refData' undeclared (first use this function)
/usr/include/wx/font.h:104: error: (Each undeclared identifier is reported only once for each function it appears in.)
/usr/include/wx/font.h: In member function `wxFontRefData* wxFontBase::GetFontData() const':
/usr/include/wx/font.h:156: error: `m_refData' undeclared (first use this function)


and if I remove  "--enable-wxcas" from ./configure :

make[3]: Entering directory `/home/moi/Logiciels/Internet/aMule-2.0.3/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I..     -DUSE_EMBEDDED_CRYPTO    -MT ED2KLinkParser.o -MD -MP -MF ".deps/ED2KLinkParser.Tpo" -c -o ED2KLinkParser.o ED2KLinkParser.cpp; \
then mv -f ".deps/ED2KLinkParser.Tpo" ".deps/ED2KLinkParser.Po"; else rm -f ".deps/ED2KLinkParser.Tpo"; exit 1; fi
g++  -DUSE_EMBEDDED_CRYPTO     -lpthread -o ed2k  ED2KLinkParser.o
if g++ -DHAVE_CONFIG_H -I. -I. -I..      -I/usr/lib/wx/include/base-2.4 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES     -DUSE_EMBEDDED_CRYPTO    -MT amule-AddFriend.o -MD -MP -MF ".deps/amule-AddFriend.Tpo" -c -o amule-AddFriend.o `test -f 'AddFriend.cpp' || echo './'`AddFriend.cpp; \
then mv -f ".deps/amule-AddFriend.Tpo" ".deps/amule-AddFriend.Po"; else rm -f ".deps/amule-AddFriend.Tpo"; exit 1; fi
In file included from /usr/include/wx/window.h:27,
                 from /usr/include/wx/toplevel.h:25,
                 from /usr/include/wx/dialog.h:21,
                 from AddFriend.h:33,
                 from AddFriend.cpp:33:
/usr/include/wx/cursor.h: In constructor `wxBusyCursorSuspender::wxBusyCursorSuspender()':
/usr/include/wx/cursor.h:46: error: `wxIsBusy' undeclared (first use this function)
/usr/include/wx/cursor.h:46: error: (Each undeclared identifier is reported only once for each function it appears in.)
/usr/include/wx/cursor.h:48: error: `wxBusyCursor' has not been declared
/usr/include/wx/cursor.h:48: error: `GetStoredCursor' undeclared (first use this function)
/usr/include/wx/cursor.h:48: error: `wxSetCursor' undeclared (first use this function)
/usr/include/wx/cursor.h: In destructor `wxBusyCursorSuspender::~wxBusyCursorSuspender()':
/usr/include/wx/cursor.h:53: error: `wxIsBusy' undeclared (first use this function)
/usr/include/wx/cursor.h:55: error: `wxBusyCursor' has not been declared
/usr/include/wx/cursor.h:55: error: `GetBusyCursor' undeclared (first use this function)
/usr/include/wx/cursor.h:55: error: `wxSetCursor' undeclared (first use this function)

my wx libraries are :
$ rpm -qa |grep wx
wxGTK-devel-2.4.2-1
wxGTK-2.4.2-1
wxBase-devel-2.4.2-1
wxBase-2.4.2-1
Logged

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: compilation error "cannot find -lpthread"
« Reply #3 on: November 25, 2005, 12:43:46 PM »

your links are wrong

post

ls -la /usr/bin/wx*

AND

ls -la /usr/local/bin/wx*


BTW I REALLY recommend you using wxGTK-2.6.1 at least!!!
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

Gerd78

  • Hero Member
  • *****
  • Karma: 9
  • Offline Offline
  • Posts: 681
Re: compilation error "cannot find -lpthread"
« Reply #4 on: November 25, 2005, 03:19:59 PM »

Download wxGTK 2.6.1:

http://ftp://biolpc22.york.ac.uk/pub/2.6.1/wxGTK-2.6.1.tar.bz2

Or wx-cvs:

http://biolpc22.york.ac.uk/pub/CVS_HEAD/wx-cvs-Gtk.tar.bz2

Build it like this:

Code: [Select]
./configure --prefix=/opt/wxGTK --disable-shared --whatever-you-want-to-specify-else
make
make install
Then build aMule as follows:
Code: [Select]
export LD_LIBRARY_PATH=/opt/wxGTK/lib:$LD_LIBRARY_PATH
./configure --with-wx-config=/opt/wxGTK/bin/wx-config --whatever-you-want-to-specify-else
make
make install
This should really work and will produce executables with wxGTK 2.6.1 or wx-cvs compiled in.

If you get further problems, try these aMule packages:

http://www.hirnriss.net/?area=cvs

Some fixes for static wx libraries have been recently added to aMule cvs.
Logged

ch3ch2oh

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 4
Re: compilation error "cannot find -lpthread"
« Reply #5 on: November 26, 2005, 11:14:46 PM »

$ ls -la /usr/bin/wx*
-rwxr-xr-x  1 root root 4865 sep 21  2003 /usr/bin/wxbase-2.4-config*
lrwxrwxrwx  1 root root   17 nov 25 10:30 /usr/bin/wx-config -> wxbase-2.4-config*
-rwxr-xr-x  1 root root 5159 sep 21  2003 /usr/bin/wxgtk-2.4-config*

$ ls -la /usr/local/bin/wx*
ls: /usr/local/bin/wx*: No such file or directory

wxGTK 2.6.1 : I'm lazy, I try to use rpms when they exist.
But if there's no other way...!
Logged

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: compilation error "cannot find -lpthread"
« Reply #6 on: November 27, 2005, 01:07:11 AM »

ln -sf /usr/bin/wxgtk-2.4-config /usr/bin/wx-config
ln -sf /usr/bin/wxbase-2.4-config /usr/bin/wxbase-config

^^
that should fix the compile error, also run

/sbin/ldconfig

afterwars and rerun configure!
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

ch3ch2oh

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 4
Re: compilation error "cannot find -lpthread"
« Reply #7 on: November 27, 2005, 03:50:57 PM »

Great !
It compiles, installs and runs.

I'll come back !

Thanks.
Logged