C:\KERNEL~1>gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functio
ns -nostdinc -fno-builtin -c sound.c
In file included from <command line>:1:
c:/djgpp/lib/gcc-lib/djgpp/3.1/djgpp.ver:1:25: no include path in which to find
sys/version.h
sound.c: In function `play_sound':
sound.c:25: warning: implicit declaration of function `outb'
sound.c:30: warning: implicit declaration of function `inb'
sound.c:50:1: warning: no newline at end of file
when I don't include this -nostdinc It works fine an generates the .o file.
What I don't get is what this sys/version.h is and why I need it
This is for a kernel so I don't want to include any libraries that depend on anything just me own.
Well, first of all, you did not give an #include for GCC to search for the outb and inb function prototypes.
Secondly, I think you should add the -nostartfiles option, as that should eliminate the sys/version.h stuff.
Thirdly, I don't mean to be mean ( ) or anything, but if you don't know what those options are, you need to study GCC's options, not copy-paste wiki code.
Give a man Linux, you feed the nearest optician ( Been staring at the PC too long again? ).
Give a man OS X, you feed the nearest NVidia outlet ( I need more GPU power!! )
Give a man Windows, you feed the entire Tylenol company ( Self explanatory )
And My problem is I don't know why I need to include this file it is not one of my includes?
And I don't know why the compiler would even complain about this.
Second I know how to include libraries and files using gcc ,...etc that is not my problem....
third of all I cleared up the inb, outb implicity stuff that wasn't my problem
This is
no include path in which to find
sys/version.h
I am sure I can include it but I really don't want to if I don't have to because if it depends on something else I am screwed.
So I must be typing something in wrong but the path is C:\djgpp\include\sys\version.h
but I am in C:\KERNEL~1 if I have to use ..\ before or something
I mean I can get rid of all this be using gcc -c sound.c
however I would like to use the switches -nostdlib ,...etc if possible and just include that one include if I even need it.
Or maybe their is a way to tell djpgg not to need the sys/version
That's because the -I option adds a directory, not a file. Look at the GCC manual!
Plus, look at that version.h file and see what it has in it.
Give a man Linux, you feed the nearest optician ( Been staring at the PC too long again? ).
Give a man OS X, you feed the nearest NVidia outlet ( I need more GPU power!! )
Give a man Windows, you feed the entire Tylenol company ( Self explanatory )
Seriously, get rid of that. That's meant for DOS and that version is nearly a decade old. Use a GCC Cross-Compiler instead.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Well, maybe he's using DOSBox, or something. Why would he do that, I dunno.
But we'll never know if he doesn't tell us, will we?
Give a man Linux, you feed the nearest optician ( Been staring at the PC too long again? ).
Give a man OS X, you feed the nearest NVidia outlet ( I need more GPU power!! )
Give a man Windows, you feed the entire Tylenol company ( Self explanatory )
As you've been told repeatedly, you're using the functions inb/outb() without providing your own implementation.. djgpp generously provides inline versions in that header file.
This is quite obvious, clearly you do not have the required knowledge.. or the ability to apply some common sense.
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
My problem is I cann't get rid of the requirement of sys\version.h
And if I compile with gcc -c sound.c => when I try to link with my linker script I get this truncation error.
So I don't understand 2 thing where in the linker script it is doing truncation and why.
And how to get rid of this header file thing?
Also I don't want to do just gcc -c filename.c because I know it will probably include stuff I cann't use in the kernel.
I am sorry but I am learning and need a little help