| Please help: makefile for Cygwin [message #146402] | 
Wed, 01 June 2005 23:26   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 00:54    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 #146500 is a reply to message #146481] | 
Fri, 03 June 2005 03:05    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 01:14   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.05520 seconds