Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[MOVED] #include <sys/io.h> file not found

Status
Not open for further replies.

shaswat

Advanced Member level 4
Joined
Jul 2, 2013
Messages
115
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
963
Hi all,

I am working on writing my device driver code. This time I write code for my DB-25 parallel port, but for this I have to use
Code:
sys/io.h
header file. As per my compiler error, its not found in directory. For this, I download the header file and insert in the directory. But still error found.
What now I have to do? Is there any other header file for low level port input output ???

Thanks.....
 

dpaul

Advanced Member level 5
Joined
Jan 16, 2008
Messages
1,527
Helped
307
Reputation
614
Reaction score
307
Trophy points
1,373
Location
Germany
Activity points
11,386
Re: #include <sys/io.h> file not found

Perhaps u'll get better answers in the "PC Programming and Interfacing" or "Embedded Systems and Real-Time OS
" forums.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,908
Helped
14,332
Reputation
28,927
Reaction score
13,077
Trophy points
1,393
Location
Bochum, Germany
Activity points
282,214
Do you understand to which directory #include <sys/xxx> refers? It's the compiler's include/sys directory, not the application dir. Apparently your compiler isn't a regular PC or embedded compiler, otherwise io.sys would be already in place. You can of course change the #include statement to any place where io.sys can be found, e.g. "io.sys" for the application dir. But makes the content of io.sys sense for this compiler?
 

arnobert

Newbie level 1
Joined
Feb 9, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
4
Hello,

please post the command you are compiling with, e.g. gcc -foo -bar.

Arnobert
 

shaswat

Advanced Member level 4
Joined
Jul 2, 2013
Messages
115
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
963
Re: [MOVED] #include &lt;sys/io.h&gt; file not found

Hello,

please post the command you are compiling with, e.g. gcc -foo -bar.

Arnobert

I am using "make" command to compile my code.

- - - Updated - - -

Do you understand to which directory #include <sys/xxx> refers? It's the compiler's include/sys directory, not the application dir. Apparently your compiler isn't a regular PC or embedded compiler, otherwise io.sys would be already in place. You can of course change the #include statement to any place where io.sys can be found, e.g. "io.sys" for the application dir. But makes the content of io.sys sense for this compiler?

Please can you elaborate or put some light on your comment
it's the compiler's include/sys directory, not the application dir.
. And of course I use "io/sys.h" in my running directory. But that also not helps.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,908
Helped
14,332
Reputation
28,927
Reaction score
13,077
Trophy points
1,393
Location
Bochum, Germany
Activity points
282,214
I meaned you need to understand what's the difference between
Code:
#include <sys/io.h>
and
Code:
#include "io.h"

And should use the correct #include syntax for actual file location.
 

shaswat

Advanced Member level 4
Joined
Jul 2, 2013
Messages
115
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
963
I meaned you need to understand what's the difference between
Code:
#include <sys/io.h>
and
Code:
#include "io.h"

And should use the correct #include syntax for actual file location.

I also tried with
Code:
#include "io.h"
but that header file include another header file names
Code:
features.h
. This time again I download it, saved in my current working directory. Now, I have an error with message
Code:
#include <sys/cdefs.h> 
No such file or directory
.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,908
Helped
14,332
Reputation
28,927
Reaction score
13,077
Trophy points
1,393
Location
Bochum, Germany
Activity points
282,214
io.h has the definition of low-level runtime functions, some compilers have it in the general include directory <io.h>, some have it under <sys/io.h>. It's ususally referencing other include files. Copying io.h from a different compiler doesn't necessarily work, instead you should find out how the respective functions are provided by your compiler, if it has io.h and where it is located. It may be necessary to modify also the code itself, write wrapper functions or at least some #defines.

This are necesary steps when porting C code between different computer platforms or compilers.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top