Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 26th, 2005, 11:49 AM   #1
mikaoj
Programmer
 
mikaoj's Avatar
 
Join Date: Aug 2005
Location: Norway
Posts: 56
Rep Power: 0 mikaoj is an unknown quantity at this point
Make my own library.

Hi!

I'm planning to write a little Operative System.
I'm also going to write programs to the OS, so cout, cin and all of this stuff doesn't work on the OS. So I'm need to make my own function that handle that, and transelate directly to ASM.

So I wondered how I can make mye own library without to have the .h file in the directory where the .cpp file.

Anybody that can answer that?
__________________
Heh.
mikaoj is offline   Reply With Quote
Old Oct 26th, 2005, 12:24 PM   #2
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4 Polyphemus_ is on a distinguished road
you mean you don't want to put the .h files in the folder where also your cpp files are, so you don't have to define like this:
#include "iostream.h"
?

You can pass gcc the parameter -i/path/to/different/header/directory, gcc will look in that directory then to find header files.
Polyphemus_ is offline   Reply With Quote
Old Oct 26th, 2005, 12:35 PM   #3
mikaoj
Programmer
 
mikaoj's Avatar
 
Join Date: Aug 2005
Location: Norway
Posts: 56
Rep Power: 0 mikaoj is an unknown quantity at this point
Sorry my english...

Something like this: #include <mylibrary>

Is that possible?

I'm using Windows platform to make the OS.
__________________
Heh.
mikaoj is offline   Reply With Quote
Old Oct 26th, 2005, 12:39 PM   #4
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4 Polyphemus_ is on a distinguished road
That's what I said in the last line of my previous post so it is possible. This works only on gcc - but that's what I recommend for compiling your OS. If you use MS Visual C++, you can add a header file path at options.
Polyphemus_ is offline   Reply With Quote
Old Oct 26th, 2005, 12:41 PM   #5
mikaoj
Programmer
 
mikaoj's Avatar
 
Join Date: Aug 2005
Location: Norway
Posts: 56
Rep Power: 0 mikaoj is an unknown quantity at this point
Ok!

Thanks!

Maybe you'll se the OS when it's finished.

EDIT: Can I use variable names that is declared in C++ to move around with Inline-Assembler?
Example: mov ax, number
__________________
Heh.
mikaoj is offline   Reply With Quote
Old Oct 27th, 2005, 1:22 PM   #6
MrSmiley
Programmer
 
MrSmiley's Avatar
 
Join Date: May 2005
Posts: 41
Rep Power: 0 MrSmiley is on a distinguished road
http://programmingforums.org/forum/s...ead.php?t=6597
MrSmiley is offline   Reply With Quote
Old Oct 27th, 2005, 3:22 PM   #7
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 6 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Quote:
Originally Posted by prog master
EDIT: Can I use variable names that is declared in C++ to move around with Inline-Assembler?
Example: mov ax, number
I believe C variables are prefixed with _ for inline assembly (aka number would be _number).
__________________

tempest is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:49 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC