Compiling with GCC on Windows7

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Locked
User avatar
harmanjeet
Posts: 10
Joined: Sun Feb 06, 2011 7:03 am
Location: India
Contact:

Compiling with GCC on Windows7

Post 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
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Compiling with GCC on Windows7

Post 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
User avatar
harmanjeet
Posts: 10
Joined: Sun Feb 06, 2011 7:03 am
Location: India
Contact:

Re: Compiling with GCC on Windows7

Post by harmanjeet »

Can u send me whole code, along with the compilation instructions...
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Compiling with GCC on Windows7

Post by Combuster »

The link was already posted.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
harmanjeet
Posts: 10
Joined: Sun Feb 06, 2011 7:03 am
Location: India
Contact:

Re: Compiling with GCC on Windows7

Post 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..
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: Compiling with GCC on Windows7

Post 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.
subraX
Posts: 4
Joined: Sun Feb 06, 2011 9:53 pm
Location: County Donegal, Ireland
Contact:

Re: Compiling with GCC on Windows7

Post 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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Compiling with GCC on Windows7

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
harmanjeet
Posts: 10
Joined: Sun Feb 06, 2011 7:03 am
Location: India
Contact:

Re: Compiling with GCC on Windows7

Post 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...!!
Locked