Page 1 of 1

Eclipse & cygwin

Posted: Tue Aug 12, 2008 6:59 pm
by huxuelei
Hi.
I have been writting my code under linux with eclipse.
But I want to use eclipse and cygwin (or MingW) to develop my os under windows now.I have tried many times, but I failed, I do not know how to config eclipse and cygwin(or MingW) under windows.
Is there any document about this problem?

Re: Eclipse & cygwin

Posted: Wed Aug 13, 2008 2:17 am
by AJ
Hi,

I use eclipse and cygwin for OS development. I know I am from the age of the dinosaurs, but I prefer to have a cygwin bash console open and compile directly from there.

If you wanted to do this by clicking a button in the IDE, right click on your project, click properties and you will see "C/C++ build options". I think that from there you can invoke Cygwin with a custom makefile.

Cheers,
Adam

Re: Eclipse & cygwin

Posted: Wed Aug 13, 2008 2:23 am
by huxuelei
AJ wrote:Hi,

I use eclipse and cygwin for OS development. I know I am from the age of the dinosaurs, but I prefer to have a cygwin bash console open and compile directly from there.

If you wanted to do this by clicking a button in the IDE, right click on your project, click properties and you will see "C/C++ build options". I think that from there you can invoke Cygwin with a custom makefile.

Cheers,
Adam
Hi, I have tried many times by setting "C/C++ build options.",But I always got some error when link.Can you give me some detail information?

Re: Eclipse & cygwin

Posted: Wed Aug 13, 2008 2:47 am
by AJ
Hi,

If you go on to "Settings->Tool Settings", eclipse seems to use G++ for linking by default. There is an area to change this command - perhaps this needs changing to LD? On this page, you can also specify linker command line options which will need updating to reflect this change. If that doesn't work, I'll let someone else jump in and help because as I say, I use a bash shell for compilation.

Cheers,
Adam

Re: Eclipse & cygwin

Posted: Thu Aug 14, 2008 12:27 am
by huxuelei
Hi, AJ.
I tried to change the project setting in eclipse as you said, but I failed again.
I select cygwin gcc as my current toolchain, gnu make builder as my current builder.(Properties->c c+ build->tool chain editor).
I use nasm as my GCC Assembler, with the option -f elf.In Cygwin C++ Compiler setting, I use the following options:

Code: Select all

-c -fmessage-length=0 -nostdlib -fno-exceptions -fno-rtti -nostartfiles
I change the cygin c++ linker to ld, with the option -Tlink.ld.

When I build the project, complier can compile every source correctly, include the source I written with nasm.
But when link, the linker always tell me "undefined reference to ''isr0", which isr0 is a function written with nasm.

These source code can build successfully under linux.

Please give me some help.