Page 1 of 1
Compiling with GCC on Windows7
Posted: Sun Feb 06, 2011 12:59 pm
by harmanjeet
I m working on a problem since last 3 years. But, not yet able to get out of it.
Compilation with GCC, and then linking it with the Nasm output file, using the linker ld is a mind storming problem for me. I am using using Windows7 (x86). Please suggest, which version of GCC should I use, and how to do all the compilation steps using the GCC and NASM and then how to link them. Please also suggest the code along with all the files, so that my problem get solved...
1. Which version of GCC should I use on Windows7
2. How to compile with GCC
3. How to assemble with NASM
4. How to link them using ld
I searched a lot of websites, but still......
So, Please help me in solving my Problem
Re: Compiling with GCC on Windows7
Posted: Sun Feb 06, 2011 1:11 pm
by AJ
Hi,
I think all of your questions are answered in
GCC Cross-Compiler (and use the version of NASM which you can select when installing Cygwin). Just also use the ELF output format with NASM and you can use ld to link. Works for me.
Cheers,
Adam
Re: Compiling with GCC on Windows7
Posted: Sun Feb 06, 2011 1:13 pm
by harmanjeet
Can u send me whole code, along with the compilation instructions...
Re: Compiling with GCC on Windows7
Posted: Sun Feb 06, 2011 1:58 pm
by Combuster
The link was already posted.
Re: Compiling with GCC on Windows7
Posted: Sun Feb 06, 2011 2:43 pm
by harmanjeet
But, that does not tell the compilation code and abt the linker and the linker script
For a beginner, its a great problem. Hope u understand.
Actually, i want to have the [ gcc code for PMode + nasm code + linker script ] and Compilation code for windows7
So that I would be able to load my C++ kernel afterwards..
Re: Compiling with GCC on Windows7
Posted: Sun Feb 06, 2011 4:53 pm
by Tosi
C++ Bare Bones
Please learn to search the Wiki. If you're a beginner it's doubly so important as it will keep you from asking questions that have already been answered multiple times.
Re: Compiling with GCC on Windows7
Posted: Sun Feb 06, 2011 11:49 pm
by subraX
Hello,
I have been successful in using GCC on Windows 7 x64 via Cygwin on both my development computer and my autobuild server.
It is quite simple to set up. If you have cygwin installed I can send you the built binaries assuming you have an email inbox large enough, but it is an old version GCC 3.2?? NASM latest.
In fact, if you give me a week, i'll have the redistributable toolchain on my server so people can just download and run.
Give us some time and goto
http://www.love2code.org
Basically gcc and any cygwin app is able directly be called within Windows as long as the command line knows the path (which can be set under control panel) and the cygwin dll is present (as far as I know). I'll run some tests and get back to you.
BobbyJo
Re: Compiling with GCC on Windows7
Posted: Mon Feb 07, 2011 2:22 am
by Combuster
Cygwin binaries have a tendency to be host-specific - they may not work on other systems (read: dll hell and dependencies on specific cygwin versions). Besides, running the crosscompiler tutorial is a good check if OS development is within that person's power.
Re: Compiling with GCC on Windows7
Posted: Mon Feb 07, 2011 5:26 pm
by harmanjeet
Thanx to all of you, for your efforts and help. I will try to implement what you said or guided. I will re-read the documentation again so as to correct my errors...!!