Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-27-2009, 12:36 AM   #1
LQ Newbie
Registered: Apr 2009
Posts: 5

Rep: Reputation: 0
Compiling project with threads for ARM

Hi everybody. I'm performing development for AT91SAM9260 microcontroller (ARM926EJ-S core) under RedHat4 virtual machine.
I made a project wich contain one thread. And when I try to compile it with:

arm-none-linux-gnueabi-gcc -l pthread -mcpu=arm926ej-s test.c -o test

compiling is failing with a follow error:

/usr/local/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.0/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/ inside /usr/local/bin/../arm-none-linux-gnueabi/libc

After that I found a "" and pointed a path to this link:

arm-none-linux-gnueabi-gcc -L /usr/local/arm-none-linux-gnueabi/libc/armv4t/lib -l pthread -mcpu=arm926ej-s test.c -o test

And the same error occured again. After that I added "/usr/local/arm-none-linux-gnueabi/libc/armv4t/lib" to the 'PATH' environment variable. And it didn't help to solve this problem.
What else can I do to compile my project?
Old 04-27-2009, 05:00 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,681

Rep: Reputation: 218Reputation: 218Reputation: 218
Please check if the pthread version you have found matches your architecture. Compare readelf result on the library and on one of your running programs. It looks there's something's different. The first check will be to find which libc it links to. Pthread should be in the same directory.

Note that it *seems* to see the library in your 'standard' version (i386), there's full path shown. You may try adding the path to LD_LIBRARY_PATH: PATH doesn't help for libraries:
export LD_LIBRARY_PATH=:/usr/local/arm-none-linux-gnueabi/libc/armv4t/lib:$LD_LIBRARY_PATH


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cross compiling apache-2.0.54 for arm jkeertir Linux - Newbie 3 09-11-2014 02:35 PM
ARM Cross Compiling Issues AuzJ Linux - Newbie 4 04-16-2009 04:47 AM
Error compiling 2.6.26 for ARM zahidul Linux - Kernel 0 11-04-2008 06:20 AM
When do i get "/arm-elf/bin/ld:cannot find -lc" while compiling my project rameshsatyavaram Linux - Newbie 0 09-10-2008 04:31 PM
Cross compiling utftpd for arm SachinTCS Linux - Desktop 1 04-13-2007 03:11 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration