Results 1 to 3 of 3

Thread: Problem compiling Examples on GNU/Linux

  1. #1

    Default Problem compiling Examples on GNU/Linux

    Hi!
    I downloaded the SVN version of ClanLib 0.9 and compiled and installed fine. But then when i tried to compile any of the examples that use libclanCore.so (most of them) i get some errors of undefined reference.
    Here is my log:

    spartan:/downloads/files/svn/clanlib-0.9/Examples/Basic2D # make -j 4
    g++ `pkg-config --cflags clanApp-0.9 clanDisplay-0.9 clanCore-0.9 clanGL-0.9` basic2d.o -o basic2d `pkg-config --libs clanApp-0.9 clanDisplay-0.9 clanCore-0.9 clanGL-0.9`
    /usr/local/lib/libclanCore.so: undefined reference to `pthread_mutexattr_destroy'
    /usr/local/lib/libclanCore.so: undefined reference to `pthread_create'
    /usr/local/lib/libclanCore.so: undefined reference to `pthread_mutexattr_setkind_np'
    /usr/local/lib/libclanCore.so: undefined reference to `pthread_join'
    /usr/local/lib/libclanCore.so: undefined reference to `pthread_detach'
    /usr/local/lib/libclanCore.so: undefined reference to `pthread_mutexattr_init'
    collect2: ld returned 1 exit status
    make: *** [basic2d] Error 1

    I don't know how to fix this, if libclanCore.so compiled fine, i don't understand why give this error.

    Thanks in advance.

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    That is strange.

    Try adding "-pthread" to:
    g++ `pkg-config --cflags clanApp-0.9 clanDisplay-0.9 clanCore-0.9 clanGL-0.9` basic2d.o -o basic2d `pkg-config --libs clanApp-0.9 clanDisplay-0.9 clanCore-0.9 clanGL-0.9`

    i.e.

    g++ `pkg-config --cflags clanApp-0.9 clanDisplay-0.9 clanCore-0.9 clanGL-0.9` basic2d.o -o basic2d `pkg-config --libs clanApp-0.9 clanDisplay-0.9 clanCore-0.9 clanGL-0.9` -pthread

    or try "-lpthread" with an "l"
    Last edited by rombust; 02-25-2009 at 08:15 AM. Reason: try -lpthread or -pthread

  3. #3

    Default

    Thanks for the reply.
    I tried that before posting, but didn't work, because the error is given by the compiled library, i'll see what i can do.

Similar Threads

  1. VC++ 2005 compiling problem
    By LaDoncella in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 12-11-2008, 07:49 PM
  2. Problem compiling ClanLib 0.8 in MAC OS X (10.3.9)
    By jplaza in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 07-08-2008, 09:58 PM
  3. Problem making linux novashell
    By rboehme in forum Novashell Game Creation System
    Replies: 11
    Last Post: 07-01-2008, 06:15 AM
  4. Error in compiling Examples
    By Nikitto46 in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 10-16-2007, 02:07 PM
  5. can't execute examples
    By Krux in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 08-18-2007, 09:12 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •