I have written a Makefile which compiles my mini-os with another application. I have to use -nostdioc and -nostdlib to compile them, but the problem is, that application is using stdio/stdlib functions and when I run my Makefile I get the error message that the functions used by my application cannot be found.

I tried to remove the -nostdlib -nostdioc but that did not work.

Here is the Makefile if anyone would like to take a look.

Recommended Answers

All 5 Replies

You probably cannot do it because linking the function implementions are the part of the linker & not the compiler. The functions are implemented in the appropriate headers & when you include them, linker links those definitions..Once the execuatble is prepared, there is no way you can include those headers during the runtime. The best shot that you can do is implement those functions manually in your project file & don't include the headers..

is there any dummy-implementation of c libraries i can use ? i mean those which dont use os streams and such things that i cant handle in my OS .

The exact code I can only provide after knowing the functions that you have used.. Moreover the libc library are all opensource & you can download the sourcecode from here

can i use them directly ? i mean does they use any special streams like for printf ?

printf is implemented using some low level system call and writing the value into some device driver putty which is used for your terminal using some file descriptors and hence its implementation is OS and hardware dependent..hence if you intend to create a OS independent app, my recommendation is to use it..the advice was for somewhat higher level of functions defined in stdlib..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.