LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-25-2010, 10:14 AM   #1
habeshkumar
LQ Newbie
 
Registered: Jul 2010
Posts: 3

Rep: Reputation: 0
linux arm cross compiler


i want to cross compile gtk program from linux to arm..
i am using ubuntu10.04.. how can i cross compile it for arm

i have tried this.. but this is my output

root@habesh-laptop:~/habesh/gtk# /root/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc -o trail1 base1.c `pkg-config --cflags --libs gtk+-2.0`
cc1: warning: include location "/usr/include/gtk-2.0" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/atk-1.0" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/cairo" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/pango-1.0" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/gio-unix-2.0/" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/glib-2.0" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/pixman-1" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/freetype2" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/directfb" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/libpng12" is unsafe for cross-compilation
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgtk-x11-2.0
collect2: ld returned 1 exit status
 
Old 07-25-2010, 01:02 PM   #2
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 129Reputation: 129
You need to compile all of the dependencies first (the first level is listed above, the will have to go deeper). Those libraries are x86, they need to be recompiled for arm

*Be sure not to replace the existing one
 
Old 07-26-2010, 01:44 AM   #3
habeshkumar
LQ Newbie
 
Registered: Jul 2010
Posts: 3

Original Poster
Rep: Reputation: 0
gcc cross compile

hi.. good day..
working in ubuntu10.04
initially i created a gtk application..
name of the source base.c

#gcc -o base base.c `pkg-config --cflags --libs gtk+-2.0`

it compiles well and i can run it in ubuntu..

now i need to cross compile it to run for target board ARM926..
can you tell me toolchain for cross compiling it succesfully
 
Old 07-26-2010, 07:24 AM   #4
habeshkumar
LQ Newbie
 
Registered: Jul 2010
Posts: 3

Original Poster
Rep: Reputation: 0
gtk ubuntu ARM

i want to create application in ARM board..
so i used the tool gtk for creating application..

my source file is base.c
root@habesh-laptop:~# cd habesh/gtk/
root@habesh-laptop:~/habesh/gtk# ls
base.c

i compiled it for ubuntu using
root@habesh-laptop:~/habesh/gtk#gcc -o base base.c `pkg-config --cflags --libs gtk+-2.0`

i can compile it for ubuntu and it works...
this is where the toolchain is available...
root@habesh-laptop:/opt/ARTOS_toolchain_1.3/bin# ls
arm-linux-addr2line arm-linux-c++filt arm-linux-gcc-3.4.4 arm-linux-nm arm-linux-readelf ld pam_tally
arm-linux-ar arm-linux-cpp arm-linux-gccbug arm-linux-objcopy arm-linux-size libpng12-config unix_chkpwd
arm-linux-as arm-linux-g++ arm-linux-gcov arm-linux-objdump arm-linux-strings libpng-config
arm-linux-c++ arm-linux-gcc arm-linux-ld arm-linux-ranlib arm-linux-strip mkimage

so i cross compiled for target using
root@habesh-laptop:~/habesh/gtk# /opt/ARTOS_toolchain_1.3/bin/arm-linux-gcc -o trail base.c `pkg-config --cflags --libs gtk+-2.0`
/opt/ARTOS_toolchain_1.3/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld: cannot find -lgtk-x11-2.0
collect2: ld returned 1 exit status

what is the problem..
please help me...
 
Old 07-26-2010, 07:52 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Please read post # 2 again : Everything required for building
your file must be for arm.

Start with glib, atk, cairo, pango for gtk. Then gtk.
Use your cross compiler = 'arm-linux-gcc' etc. for that.

Configure it all for e.g. --prefix=/opt/arm/ , and when glib
has been built to /opt/arm/, the next command is :
export PKG_CONFIG_LIBDIR=/opt/lib/pkgconfig
&& cd atk-<version>/ && ./configure --prefix=/opt/arm/
.. .. etc. etc.

Then you can later use it all with this command :
export LD_LIBRARY_PATH=/opt/arm/lib && <other-command>
..

Last edited by knudfl; 07-27-2010 at 02:23 AM.
 
  


Reply



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
Linux, Cross compiler for ARM problem vishalp Programming 1 05-17-2006 01:43 PM
Linux, Cross compiler for ARM problem vishalp Linux - Software 1 05-16-2006 06:06 AM
How to check ARM Cross-Compiler MKSrivastava Debian 1 02-07-2006 02:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:23 PM.

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