You are here:

C++/Microsoft Visual C++


I have Developed a MSVC++ 6.0 MFC project containing 6 cpp files and their headers now i have a make file which can be used with NMAKE utility but when i try to do it with cygwin make there are some errors not syntax
-- cygwin does not recognize the flags being used  
-- cygwin uses GCC and not cl.exe
After a lot of google search and for rewriting the makefile compatible with cygwin i am not able to link the MSVC libraries and also i am not able to understand the linkin part of the makefile


The philosophy and structure of Cygwin make is completely different from windows nmake. Try to nmake your application in cmd instead of using cygwin make.

If you insist on using Cygwin, using Visual C++, you can generate the makefile from the nmake file. You can then use Cygwin to make using this generated makefile. Another thing, cygwin uses GNU GCC compiler, not Microsoft's cl.exe compiler to build.

---------- FOLLOW-UP ----------

QUESTION: I understand the compatibility of the nmake and make so is there any tool so that i can convert the makefile from windows make to GNU make , or can i find an example so that i can write a makefile for Cygwin  which handles the MSVC++ libs of MFC and SOCKET PROGRAMMING i have also tried porting using wine and also some of the sed scripts which is of no help,Is there a way to link the libs in CYGWIN
ANSWER: I am not sure what you're trying to do. Maybe you can give me more context. Why do you want to link the libs in cygwin?

---------- FOLLOW-UP ----------

My MSVC++ project contains 6 cPP files and there is a main dialog window myproj.cpp, myprojdlg.cpp,with this there are 4 more cpp files which have functions calls from myprojdlg.cpp from this i hope u have got the picture how the project flows.
from MSVC++ i have exported the make file and have removed of all the extra features like release version and some of the project switches and then i have just given 2 main target one is creating the .exe and one is to clean i use the commands
---nmake -f myproj.mak all (generates the myproj.exe)
---nmake -f myproj.mak clean (removes all the objs and pbd files )

Now i want to be able to generate myproj.exe using cygwin keeping only the cpp and .h (header) files

because not all sytems have MSVC installed i should be able to give a command
--make -f myproj.mak all
so that i get an myproj.exe in the same directory of the src files and different systems

so how do i write the make file for this and also link these files so that the exe is generated???

Thank you in advance.
appriciate your help


See examples of cygwin makefiles: and

I search "cygwin makefile" on google, and these are some relevant results. I hope this helps.

You can write cygwin makefiles like these to compile and run your application. If you face any problem, do let me know.


All Answers

Answers by Expert:

Ask Experts


Amit Kumar


I can answer Cplusplus language and library questions, including STL, ACE, Boost. I have a good background in Mathematics.


Programming in CPP for about 8 years. Industry experience of 4 years.

Bachelors and Masters in Computer Science from Indian Institute of Technology Delhi.

©2016 All rights reserved.