Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

Hello world example make errors

Hello,

I got follow errors when I typed in the "make -f Makefile“

This is the hellowrold example for OpenCL SDK 13.1.

I think I have set up the correct paths for altera's library. But I'm using the board remotely, so I am not sure if some other libs are missing. Please advise.

Thanks.

make <- 2:58PM

/usr/lib/x86_64-redhat-linux5E/lib64/../lib64/crt1.o: In function `_start':

(.text+0x12): undefined reference to `__libc_csu_fini'

/usr/lib/x86_64-redhat-linux5E/lib64/../lib64/crt1.o: In function `_start':

(.text+0x19): undefined reference to `__libc_csu_init'

/opt/Altera/13.1/hld/linux64/lib/libstdc++.so: undefined reference to `__tls_get_addr'

/opt/Altera/13.1/hld/linux64/lib/libalteracl.so: undefined reference to `pthread_create'

/opt/Altera/13.1/hld/linux64/lib/libalteracl.so: undefined reference to `pthread_detach'

collect2: ld returned 1 exit status

make: *** [bin/hello_world] Error 1

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    /opt/Altera/13.1/hld/linux64/lib/libalteracl.so: undefined reference to `pthread_create'

    /opt/Altera/13.1/hld/linux64/lib/libalteracl.so: undefined reference to `pthread_detach'

    collect2: ld returned 1 exit status

    make: *** [bin/hello_world] Error 1

    --- Quote End ---

    I trimmed off the parts I can not help you with.

    The undefined references above can be fixed with a "-lpthread" added to the link command.

    Gary.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks! Now I am one step closer!

    --- Quote Start ---

    I trimmed off the parts I can not help you with.

    The undefined references above can be fixed with a "-lpthread" added to the link command.

    Gary.

    --- Quote End ---

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hello,

    /usr/lib/x86_64-redhat-linux5E/lib64/../lib64/crt1.o: In function `_start':

    (.text+0x12): undefined reference to `__libc_csu_fini'

    /usr/lib/x86_64-redhat-linux5E/lib64/../lib64/crt1.o: In function `_start':

    (.text+0x19): undefined reference to `__libc_csu_init'

    /opt/Altera/13.1/hld/linux64/lib/libstdc++.so: undefined reference to `__tls_get_addr'

    --- Quote End ---

    if you Google the text shown in red above (three seperate searches), you will find that others (non-OpenCL) have had this problem, and how they fixed it.

    Basically the linker can't find the libraries - not knowing your configuration I can't recommend a direct fix.

    I tried to reply yesterday, but that post never made it to the board.

    Regards,

    Gary.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you, Gary. I googled and manually linked the libs and it works.

    Cheers.

    -Rae

    --- Quote Start ---

    if you Google the text shown in red above (three seperate searches), you will find that others (non-OpenCL) have had this problem, and how they fixed it.

    Basically the linker can't find the libraries - not knowing your configuration I can't recommend a direct fix.

    I tried to reply yesterday, but that post never made it to the board.

    Regards,

    Gary.

    --- Quote End ---