Now I know somethings wrong, but I basically just want to split up my huge file into other files, and have it all compile and work together.

So basically, my main.cpp is supposed to gather all other files, and compile it as if it was really in one file. I guess that works?

EDIT:

OK IT NOW COMPILES! But it does NOT show any of my colors!

05-24-2006

whiteflags

Just so you're clear, this is a header file (hpp)

Code:

#include "color.h"// Don't do this either. You do not have to include your custom made header file when you
// define it here:
#ifndef _WIN32_WINNT WINVER
#define _WIN32_WINNT WINVER
#ifdef WIN32
void blue_grey(void);
#endif

EDIT: I beleive the problem is that the program is looking at my color functions as all void, which it is no doing anything because there is nothing to do in color.h. But how do I make it so color.h can do what colorIt.cpp does with the defs.

05-24-2006

whiteflags

Last time I saw an implementation of something like this, you need to pass in a reference to the ostream in all the functions, and use those streams, in order to expect it to work with the ostream at all.

05-24-2006

DarkMortar

What do you mean by pass a reference to ostream?

05-24-2006

whiteflags

I see the best way to learn something like this is to study another implementation, and then get yours to work.

It means that prior to your putting an else case in, it looked like this.

Code:

void blue_grey()
{
}

Nothing there to do anything spectacular.

Have you tried my other suggestion as well, since you seem to be basing this on a macro that you nor anyone else defines.?

05-25-2006

DarkMortar

my colorIt.cpp

has this at top:

Code:

#include "color.h"

#define _WIN32_WINNT WINVER

#ifdef WIN32
#endif

color.h

has just void functions like this, with no declarations:

Code:

// INTERFACE FUNCTIONS:
// font colors>>

void tred();
void tgreen();
void tblue();

//ect...

It's not the functions that dont work, because before, I had this all in my main.cpp file and it worked flawlessly. But my problem is the way I am trying to split up the files.

I tryed your other example and it just gives me errors that it doesnt understand any other the symbols. I will repeat, the functions HAVE worked, but the compiler is not reading them, it seems like it thinks they are voids with nothing in it because of the color.h file.