LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 01-29-2012, 11:30 PM   #1
mashhur
LQ Newbie
 
Registered: Jan 2012
Posts: 14

Rep: Reputation: Disabled
Cross compiler problem...


Hi there,

I am using cross compiler on Fedora 8 and having a problem when i compile the code with include path and library.
example: arm-linux-gcc -I/home/linux-2.3.28/include -o myobj myprog.c -L/home/linux-2.3.28/lib

// myprog.c
#include <linux/ioport.h> //which is located in
//home/linux-2.3.28/include

int main(void)
{
return 0;
} // that's all so far

errors: home/linux-2.3.28/include/ioport.h:19: expected specifier-qualifier-list before 'resource size_t'
.....
.... // all errors are belong to ioport.h.

I strongly believe i should set the links somewhere.
Please tell me how to set.

And also, do i need to use -mcpu=arm_VERSION option?
thanks to all who help me.

Last edited by mashhur; 01-29-2012 at 11:34 PM.
 
Old 01-31-2012, 05:41 AM   #2
gaurav.rustagi
LQ Newbie
 
Registered: Jan 2012
Location: Mumbai, India
Distribution: Red Hat
Posts: 23

Rep: Reputation: Disabled
Quote:
Originally Posted by mashhur View Post
Hi there,

I am using cross compiler on Fedora 8 and having a problem when i compile the code with include path and library.
example: arm-linux-gcc -I/home/linux-2.3.28/include -o myobj myprog.c -L/home/linux-2.3.28/lib

// myprog.c
#include <linux/ioport.h> //which is located in
//home/linux-2.3.28/include

int main(void)
{
return 0;
} // that's all so far

errors: home/linux-2.3.28/include/ioport.h:19: expected specifier-qualifier-list before 'resource size_t'
.....
.... // all errors are belong to ioport.h.

I strongly believe i should set the links somewhere.
Please tell me how to set.

And also, do i need to use -mcpu=arm_VERSION option?
thanks to all who help me.
Have you set the link linux->linux-2.3.28 as you are including a header file which is supposed to be in linux folder ?
Try to create a symbolic link in /home directory as ln -s /home/linux-2.3.38 linux

Thanks,
 
  


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
Problem building gcc 4.4.3 cross-compiler on Fedora 12 sdt Fedora 2 03-28-2010 03:14 PM
cross-compiler problem jiml8 Programming 2 08-15-2008 01:49 PM
Problem installing cross compiler GCC2.96+ in Cygwin??? Jloyd Linux - Software 1 05-19-2007 03:32 PM
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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:43 AM.

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