LinuxQuestions.org
Help answer threads with 0 replies.
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 06-02-2013, 01:16 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
Where does gcc look for include files?


I have this source:
Code:
semoi@server:~/z80_p4/juan$ head -n30 p1.c
   /* Compile con 'gcc -O2 [-ggdb] -o setuid setuid.c'.
    
    * PROG APPL: transmit a .z80 file to the z80. File length supposed to
    * be < 65536 bytes.    
    * Se transmite primero la longitud del archivo (2 bytes), que
    * el programa obtiene por su cuenta. Luego el archivo y, 
    * finalmente, dos bytes de checksum que incluyen los dos bytes
    * de la longitud. Al transmitir el archivo, se descartan los
    * 10 primeros bytes, que son el header del z80.
    *
    * NOTA: en una nueva version de monitor, el programa en ROM que
    * contiene el modulo que carga el archivo transmitido en RAM,
    * podria leer el noveno y decimo byte, que contiene la direccion
    * de carga y no habria necesidad de cargarla a mano. 
    */         
    
   

   #define _XOPEN_SOURCE 500   // for usleep
   
   #include <stdlib.h>	      // for EXIT_SUCCESS constant
   #include <stdio.h>
   #include <sys/types.h>
   #include <sys/stat.h>
   #include <unistd.h>        // includes usleep as well
   #include <asm/io.h>        // for outb

   unsigned char msk_data= 0x02;
   unsigned char msk_clock= 0x01;
   unsigned char image;
But I get
Code:
semoi@server:~/z80_p4/juan$ gcc -O2 -o p1 p1.c
p1.c:26:42: fatal error: asm/io.h: No such file or directory
compilation terminated.
This is slackware 14.0 x86_64. Where should asm/io.h be?

Last edited by stf92; 06-02-2013 at 01:29 AM.
 
Old 06-02-2013, 05:08 AM   #2
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
If you have not done so already, you will need to install the Kernel Header Files for your particular kernel. I'm not familiar with Slackware, so I cannot advise you on how to go about doing this.

Typically the asm directory, containing io.h, is located in the following area (again, this may not apply to Slackware):
Code:
/lib/modules/`uname -r`/build/include
P.S. You may also have a link to io.h in /usr/include/sys

Last edited by dwhitney67; 06-02-2013 at 05:10 AM.
 
Old 06-02-2013, 06:04 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Thank you very much. What much disconcerts me is that, in slackware 12.0, locate does not find a single 'asm/io.h' instance. However, the program compiles well there.
 
  


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
[SOLVED] Recursively include headers in include option for gcc kvm1983 Linux - Newbie 5 09-04-2012 03:21 PM
Does gcc with different version include some different default header files? cplus Programming 5 07-10-2011 05:09 AM
[SOLVED] what is gcc include path/ linux include path ghantauke Linux - Newbie 1 03-08-2011 08:34 PM
gcc 4:4.1.1-15 (Debian 4.0 r4a_Etch) cannot find include files. No man pages. somdeb Linux - Newbie 4 05-07-2009 01:20 PM
Where is my other gcc include files ?? DevandeAsk Ubuntu 1 01-30-2006 08:04 AM

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

All times are GMT -5. The time now is 06:25 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