Page 1 of 2
Getting new Compilers (C/C++)
Posted: Mon Sep 04, 2006 8:37 pm
by REV
I've had it with Watcom and all of its crap. Ive also had it with JLOC and all of its crap.
I was looking at GCC and it looks like a good deal with all of its architectures and a other tools like LD and such.
Im running Windows 2000 *Heart* and Windows NT and I looked at MinGW and Cygwin. The FAQ reccommended against MinGW.
I want a compiler I can just throw onto my HD and command line compile quickly after installing.
Any suggestions?
Re:Getting new Compilers (C/C++)
Posted: Mon Sep 04, 2006 11:25 pm
by Candy
For getting into different trouble, download a binary of something and use it.
For solving your trouble, do what the FAQ says and use either cygwin or mingw to compile a crosscompiler (see cross-compiler).
Re:Getting new Compilers (C/C++)
Posted: Tue Sep 05, 2006 12:45 am
by REV
Great looks like I have to spend another 3 ****ing weeks wasting my time. ****ing hell I've been trying to get a basic kernel working for almost 6 months now. This is just ****ing great.
Why would I need to build a cross compiler though?
Re:Getting new Compilers (C/C++)
Posted: Tue Sep 05, 2006 2:40 am
by bluecode
REV wrote:Why would I need to build a cross compiler though?
Might be surprising, but it's because you don't use Linux. It's just way better for out of the box os development. The other reasons are mentioned in the
OSFAQ. Just have a look.
Re:Getting new Compilers (C/C++)
Posted: Tue Sep 05, 2006 2:54 am
by Pype.Clicker
REV wrote:
Why would I need to build a cross compiler though?
1. keep your **** words on your **** side of the connection, right.
2. As you might have noticed, the FAQ is about OS deving. There are good reasons to build a cross-compiler for OS deving, and especially under windows.
3. If you don't intend to do OS deving, but programming over the Win32 API, you could very well use MingW, or a native cygwin binary.
Re:Getting new Compilers (C/C++)
Posted: Tue Sep 05, 2006 7:34 am
by REV
Alright,
Right now I want to compile to a plain binary for simplicity. Also I want the target platforms to be entire IA32 platforms (i386, i486, etc...).
Is this possible for GCC looking at the cross compiler tutorial?
Re:Getting new Compilers (C/C++)
Posted: Tue Sep 05, 2006 9:08 am
by Midas
For compiling and linking to a flat binary, this is possible with GCC, simply because I've seen other people do it. I personally haven't and therefore can't even start to tell you how - but I'm sure it's no more complex than setting it up to compile to any other target binary.
As for target platforms, that's easy. Following the walkthrough in the FAQ exactly, assuming nobody's changed it, with result in you having a compiler targetting i586-ELF (which you may well want to change). You can change it to target other platforms easily enough.
Re:Getting new Compilers (C/C++)
Posted: Tue Sep 05, 2006 10:39 am
by Pype.Clicker
there are probably things that might be disabled in a specific distro, but
1. producing a flat binary is typically achieved by the linker. Study the output of "ld --help" on your distro to see whether it has output format "binary" supported or not.
2. you can tell gcc to compile code for a specific sub-architecture with -march=<cputype> or -mtune=<cputype>, look for "Intel 386 and AMD x86-64 options" in "info gcc"
Re:Getting new Compilers (C/C++)
Posted: Tue Sep 05, 2006 2:08 pm
by REV
Well thank you. Old Watcom could never do that.
What about other Architectures like Alpha, M68K, PowerPC and such?
Re:Getting new Compilers (C/C++)
Posted: Tue Sep 05, 2006 5:47 pm
by REV
Well im compiling my cross compiler now. I changed all the i586s to i386s.
Are there any enviroment varibles I can use?
Re:Getting new Compilers (C/C++)
Posted: Tue Sep 05, 2006 10:27 pm
by Solar
For what?
(Quality of response is directly proportional to quality of question...)
Re:Getting new Compilers (C/C++)
Posted: Tue Sep 05, 2006 10:34 pm
by REV
Include directories and stuff like that.
Re:Getting new Compilers (C/C++)
Posted: Thu Sep 07, 2006 10:29 pm
by Solar
For environment variables, try chapter
3.19 Environment variables affecting GCC of the GCC manual. For include directories, try chapter
3.14 Options for Directory Search. I don't know about "stuff like that", but you might want to generally
RTFM.
Re:Getting new Compilers (C/C++)
Posted: Fri Sep 08, 2006 1:27 pm
by REV
Are these for Windows? Im building my OS through a batch file.
Re:Getting new Compilers (C/C++)
Posted: Fri Sep 08, 2006 4:41 pm
by Kevin McGuire
@REV:
I assume the goal you have is to write a operating system by the amount of work you do in asking questions. That is a great attitude to have towards goals. It shows you have an amount of motivation, and inspiration for your own personal reason.
If the personal reason is to have something that can provide you with recognition, then this is very easy to attain simply by taking someone elses kernel and showing to your friends, and saying I wrote that thus telling a lie. Forget that telling a lie is wrong and blah blah blah, but it lets you attain the goal you want. So who would not do this is their goal was to gain recognition for writting a operating system?
However, if that
makes you feel bad, is
not the reason, is
only a fraction of the reason, or
not of the reason then you must understand that my assumption here at the end of this message is based on your questions. The assumption is:
"
This guy needs to learn a *whole lot more* then just how to cross-compile GCC for writting a operating system. Now, he should not give up trying to write a operating system, but understand that the amount of information he needs is too great for asking questions in a forum. REV, should instead try to read *all* the links that Solar posted even if he can barely read english. If he got far enough to download a compiler and learn some C/C++ then something is going to stick everytime he reads those links.
"
WHAT HAPPENS AFTER YOU READ THOSE LINKS?
You will actually increase the amount of information in your brain directly relating to an increase in intellegence in dealing with the opposite sex, and this increase in information is can also be called excersing the brain and eyes - since you know over 3/4 of the conversation with the opposite sex is body language so reading will actually increase the connectivity between your eyes and brain allowing faster and more accurate deciphering of complex mental and visual clues to the world around you.