Results 1 to 3 of 3

Thread: Problems with pcre-devel-static

  1. #1

    Default Problems with pcre-devel-static

    Hi,

    I'm trying to compile a C program with the -static gcc option, and I'm using the pcre library.

    After installing the pcre-devel-static I got the following message while trying to compile my program:

    Code:
    gcc -pedantic -Wall -static  -pipe -O2 -march=native -mtune=native -fomit-frame-pointer  -o gop.exe atom.o bhmc.o cg.o conquer.o data.o ecn.o energy.o filter.o force.o ga.o input.o info.o interface_aims.o main.o operators.o op_list.o output.o potential.o random.o selection.o bhsa.o mc.o util.o -lm -lpcre
    /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `allocator_grab_lock':
    /home/abuild/rpmbuild/BUILD/pcre-8.30/sljit/sljitUtils.c:87: undefined reference to `pthread_mutex_lock'
    /home/abuild/rpmbuild/BUILD/pcre-8.30/sljit/sljitUtils.c:87: undefined reference to `pthread_mutex_lock'
    /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `allocator_release_lock':
    /home/abuild/rpmbuild/BUILD/pcre-8.30/sljit/sljitUtils.c:92: undefined reference to `pthread_mutex_unlock'
    /home/abuild/rpmbuild/BUILD/pcre-8.30/sljit/sljitUtils.c:92: undefined reference to `pthread_mutex_unlock'
    /home/abuild/rpmbuild/BUILD/pcre-8.30/sljit/sljitUtils.c:92: undefined reference to `pthread_mutex_unlock'
    /usr/lib64/gcc/x86_64-suse-linux/4.7/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__gthread_mutex_lock':
    /home/abuild/rpmbuild/BUILD/gcc-4.7.1-20120723/obj-x86_64-suse-linux/x86_64-suse-linux/libgcc/./gthr-default.h:767: undefined reference to `pthread_mutex_lock'
    /home/abuild/rpmbuild/BUILD/gcc-4.7.1-20120723/obj-x86_64-suse-linux/x86_64-suse-linux/libgcc/./gthr-default.h:767: undefined reference to `pthread_mutex_lock'
    /home/abuild/rpmbuild/BUILD/gcc-4.7.1-20120723/obj-x86_64-suse-linux/x86_64-suse-linux/libgcc/./gthr-default.h:767: undefined reference to `pthread_mutex_lock'
    /usr/lib64/gcc/x86_64-suse-linux/4.7/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__gthread_mutex_unlock':
    /home/abuild/rpmbuild/BUILD/gcc-4.7.1-20120723/obj-x86_64-suse-linux/x86_64-suse-linux/libgcc/./gthr-default.h:797: undefined reference to `pthread_mutex_unlock'
    /usr/lib64/gcc/x86_64-suse-linux/4.7/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__gthread_mutex_lock':
    /home/abuild/rpmbuild/BUILD/gcc-4.7.1-20120723/obj-x86_64-suse-linux/x86_64-suse-linux/libgcc/./gthr-default.h:767: undefined reference to `pthread_mutex_lock'
    /usr/lib64/gcc/x86_64-suse-linux/4.7/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__gthread_mutex_unlock':
    /home/abuild/rpmbuild/BUILD/gcc-4.7.1-20120723/obj-x86_64-suse-linux/x86_64-suse-linux/libgcc/./gthr-default.h:797: undefined reference to `pthread_mutex_unlock'
    /home/abuild/rpmbuild/BUILD/gcc-4.7.1-20120723/obj-x86_64-suse-linux/x86_64-suse-linux/libgcc/./gthr-default.h:797: undefined reference to `pthread_mutex_unlock'
    /home/abuild/rpmbuild/BUILD/gcc-4.7.1-20120723/obj-x86_64-suse-linux/x86_64-suse-linux/libgcc/./gthr-default.h:797: undefined reference to `pthread_mutex_unlock'
    collect2: error: ld returned 1 exit status
    make: ** [gop.exe] Erro 1
    It looks like it's a problem of the pcre package with pthread.

    Any ideas of how can I solve this problem?

    Thanks,
    Henrique.

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,796
    Blog Entries
    15

    Default Re: Problems with pcre-devel-static

    Hi
    Add -lpthread after your prce link.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: Problems with pcre-devel-static

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Add -lpthread after your prce link.
    I used to compile this same program without the pthread library and it used to work (in Ubuntu at least).

    Anyways, thanks for the solution!

    Bye,
    Henrique.

Tags for this Thread

Posting Permissions

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