简体   繁体   中英

How to compile code with visual studio using makefile

I have just downloaded a open source project which is said to be compiled using visual studio c++. It contains 3 makeFiles (makeFile, makeFile(1) and makeFile(2) ) I always open programs in VS using the .sln files and now I dont know what to do with this makeFile. can anyone instruct me how to deal with it please.

regards

You may try NMake . See NMake Reference and Stackoverflow post.

NMake is included with Visual Studio. You may try with NMake shipped with the edition of Visual Studio you may want to use.

If you are only familiar with Visual Studio projects and solutions, dealing with makefiles can be a challenge. The following link will give you a good introduction to makefiles from a Visual studio perspective.

An introduction to Makefiles for Visual Studio developers

Translating Linux makefiles to Visual Studio solution will be a manual effort.

NMake looks promising. However, the following link takes a simple Makefile and explains some fundamental issues that one may encounter.

Makefiles in Windows

VS2017 and cross-platform dev with make linux binaries

If you're working on windows 10, you can make make work and compile linux binaries:

  • have lxss installed, and gdb server, ssh server installed:

    sudo apt update && sudo apt install -y build-essential gdbserver openssh-server

  • make sure you can connect through ssh to your local machine:

    sudo vi /etc/ssh/sshd_config && sudo service ssh start

  • make sure you have linux development with c++ packages installed (VS2017 install)

  • make sure you configured your connexion to lsxx through ssh in VS/tools/options/connection manager ("connection" in search).

  • make sure to have a linux project (new project/other languages/vc++/crossplatform/linux)

  • yet, add you make commands in project/properties.

I've just run into the same problem and for me the solution: open "VS2012 Native Command Prompt" the name varies over different versions of MSVS. then simply type 'nmake makefile.vc'. nmake is the command, makefile.vc is your own makefile in your local folder. and it is done (if no further errors occur)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM