Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Please help: makefile for Cygwin
Please help: makefile for Cygwin [message #146402] Thu, 02 June 2005 03:26 Go to next message
Eclipse UserFriend
Originally posted by: fbarsoba.hotmail.com

Hello,

I'm trying to use CDT w/ Cygwin (Platform: Windows + Eclipse). My
HelloWorld.cpp compiles correctly using g++ from Cygwin, but I don't know
how to reference g++ in the make file for Cygwin.

This is the makefile for MinGW..

main : main.o
g++ -o main main.o -L C:/MinGW/lib/gcc-lib/mingw32/3.2.3/lstdc++
main.o : main.cpp
g++ -ggdb -c main.cpp
all :
${MAKE} main
clean :
-del main.o

How do I change it to make it work with Cygwin?

Thanks in advance,

FBM
Re: Please help: makefile for Cygwin [message #146414 is a reply to message #146402] Thu, 02 June 2005 04:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: emiliano.lesende.gmail.com

Fernando B.M wrote:
> Hello,
>
> I'm trying to use CDT w/ Cygwin (Platform: Windows + Eclipse). My
> HelloWorld.cpp compiles correctly using g++ from Cygwin, but I don't
> know how to reference g++ in the make file for Cygwin.
> This is the makefile for MinGW..
>
> main : main.o
> g++ -o main main.o -L C:/MinGW/lib/gcc-lib/mingw32/3.2.3/lstdc++
> main.o : main.cpp
> g++ -ggdb -c main.cpp
> all :
> ${MAKE} main
> clean :
> -del main.o
>
> How do I change it to make it work with Cygwin?
>
> Thanks in advance,
>
> FBM
>

A lot of people get confused about what MinGW and Cygwin are. Let me
breafly explain each so you get a better picture:

Cygwin: Cygwin is a porting technology. It allows Unix programs to be
recompiled as their are on Windows. So, what you have in the end is a
Windows based executable of a Unix program such as GCC, GDB, make, etc.

MSys: MSys is a project a MinGW. Same goals as Cygwin using almost the
same approach.

MinGW: Finally. We have MinGW. MinGW is a package composed of several
items, including GCC, make and other tools and libraries which allows
you compile C/C++, Java and other languages into native Windows
executables. MinGW does NOT use any porting technology. Several
modifications were made into the source code so it will compile natively
on Windows. Also MinGW includes many crucial components such as system
headers, libraries, etc to compile Windows programs succesfully.

Keep in mind that Cygwin ALSO includes MinGW as an optional component
since is the only project I'm aware of that lets you compile Windows
programs on Windows based on GCC.

So, answering your question it should be exactly the SAME. No
modifications should be made to the source code nor the makefile.

Hope this helps.

Regards,
Emiliano
Re: Please help: makefile for Cygwin [message #146420 is a reply to message #146414] Thu, 02 June 2005 05:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: timo.koukkari.insta.fi

Hello!

"Emiliano Lesende" <emiliano.lesende@gmail.com> wrote in message
news:d7m3e4$c6g$1@news.eclipse.org...
> Fernando B.M wrote:
> > Hello,
> >
> > I'm trying to use CDT w/ Cygwin (Platform: Windows + Eclipse). My
> > HelloWorld.cpp compiles correctly using g++ from Cygwin, but I don't
> > know how to reference g++ in the make file for Cygwin.
> > This is the makefile for MinGW..
> >
> > main : main.o
> > g++ -o main main.o -L C:/MinGW/lib/gcc-lib/mingw32/3.2.3/lstdc++

I'm just guessing but should this path be changed to cygwin versio?
Or al least removed so that cygwin can use it's default path?

Timo Koukkari
Re: Please help: makefile for Cygwin [message #146481 is a reply to message #146414] Thu, 02 June 2005 14:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fbarsoba.hotmail.com

Hi,

Thanks a lot for your explanations. All the cross-platform stuff really
confused me...

Thanks also to Timo Koukkari... his comment was also helpful.

I've removed MinGW (and installed gcc and g++ from Cygwin package) and
used as makefile:
main : main.o
g++ -o main main.o -L lstdc++

I'm not an expert on makefiles so.. I'm not sure if that's 100% correct,
but it worked.

I'm going to post another question, but I'd like to throw it here... Is it
possible to compile remotely with Eclipse/CDT? That is, to use
Windows/Eclipse/CDT against a gcc/g++ compiler in a Linux machine in
another network (like University network, for instance)?

Thanks,

FBM
Re: Please help: makefile for Cygwin [message #146500 is a reply to message #146481] Fri, 03 June 2005 07:05 Go to previous messageGo to next message
Andrés Wellmann Jelic is currently offline Andrés Wellmann JelicFriend
Messages: 32
Registered: July 2009
Member
Hi!
just a short additional comment to your makefile, perhaps important for
further
programming stuff.

You should use the -L flag if you want to pass more library search paths
(like e.g.
"-L/usr/local/include/...") to the compiler, your "-L" is obsolete.
Additionally, as far as I know, you don't have to add "-lstdc++", it's
added
automatically.

Related to your last question: I don't know any solution for this task, at
least not
with standard tools.

andrés


Am Thu, 02 Jun 2005 16:16:53 +0200 schrieb Fernando B.M
<fbarsoba@hotmail.com>:

> Hi,
>
> Thanks a lot for your explanations. All the cross-platform stuff really
> confused me...
>
> Thanks also to Timo Koukkari... his comment was also helpful.
>
> I've removed MinGW (and installed gcc and g++ from Cygwin package) and
> used as makefile:
> main : main.o
> g++ -o main main.o -L lstdc++
>
> I'm not an expert on makefiles so.. I'm not sure if that's 100% correct,
> but it worked.
>
> I'm going to post another question, but I'd like to throw it here... Is
> it possible to compile remotely with Eclipse/CDT? That is, to use
> Windows/Eclipse/CDT against a gcc/g++ compiler in a Linux machine in
> another network (like University network, for instance)?
>
> Thanks,
>
> FBM
>



--
Erstellt mit Operas
Re: Please help: makefile for Cygwin [message #146514 is a reply to message #146481] Sun, 05 June 2005 05:14 Go to previous message
Eclipse UserFriend
Originally posted by: emiliano.lesende.gmail.com

Fernando B.M wrote:
> Hi,
>
> Thanks a lot for your explanations. All the cross-platform stuff really
> confused me...
>
> Thanks also to Timo Koukkari... his comment was also helpful.
>
> I've removed MinGW (and installed gcc and g++ from Cygwin package) and
> used as makefile:
> main : main.o
> g++ -o main main.o -L lstdc++
>
> I'm not an expert on makefiles so.. I'm not sure if that's 100% correct,
> but it worked.
>
> I'm going to post another question, but I'd like to throw it here... Is
> it possible to compile remotely with Eclipse/CDT? That is, to use
> Windows/Eclipse/CDT against a gcc/g++ compiler in a Linux machine in
> another network (like University network, for instance)?
>
> Thanks,
>
> FBM
>

I never tried it before. But I think it might be possible. You need to
exec make remotely using rexec or ssh. rexec should be easier to setup.
You will also need samba or other file sharing protocol to remotely edit
files on the Linux box.

Hope this info helps
Emiliano
Previous Topic:Refactoring in CDT
Next Topic:The proper way to navigate through project configurations/tools in 2.1
Goto Forum:
  


Current Time: Thu Jun 27 21:11:27 GMT 2024

Powered by FUDForum. Page generated in 0.03398 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top