Try explaining your problem again. A compiler is a rather sophisticated piece of software. It's unclear to me whether you really want to write one or just confusing the word with something..
Writing your own compiler is a very significant undertaking. You'll need to know the C++ standard backwards, and a solid grasp of the interpretations and principle discussions on the standard and the implications thereof would help.
You'll need a likewise very serious understanding of your target processor's machine code or assembly.
These are just the first steps; after that there's the lexical analysis, parsing techniques, translation and data-flow and more and more.
This is a big, big subject. Are you sure you meant that you want to write your own compiler?
@hamsterman: i want to write a script/code on making an executable compiler, the one that compiles your projects into executables... so do you know any tutorials or can you make e one,... thanks...
@Moschops: uhm, yup do you have a tutorial or can you make me one,... thanks...
The tutorial I have to hand is almost 600 pages long. It's called "Principles of Compiler Design", often known as "The Dragon Book".
It's a standard basic introductory text. Writing your own C++ compiler is a very big task. Back in 2005 the GCC ran to almost half a million lines of code.
Again, why do you want to write a compiler? There are many, any fine (and free) compilers available for you to use.
If you just want to be able to have code that writes code, and then compiles it, you can use the compilers in existence. I have written programmes before that do this; they accept information from the user and from text files, and then write some source code, and the last step is using an existing compiler to turn the new source code into an executable.
You said you wanted to make a ga[m]e engine; if that's so, there isn't really any reason for you to go make your own compiler as well. You may as well go program your own OS for your compiler, and and make your own processor to run it on...