简体   繁体   中英

Cross compile from linux to windows a visual studio project

I distribute a c++ program made with visual studio.

Whenever I need to give it to someone I just edit the code with some infos regarding this person to track the executable usage.

I have a server running ubuntu, I already made a shell script that automates the code changes but I can't find a way to compile a visual studio project on linux for windows.

Is it even possible ?

Thanks.

How complex is your Visual Studio project? If it is basically a straightforward project, you should be able to write a Makefile with minimal effort. If Visual studio basically auto-created your project and you did very little customization, other than small stuff like include directories, then the Makefile should be pretty simple.

There is an option for such a development.

Install all dev libraries with vcpkg tool on Windows. Install all dev libraries with apt-get tool on Ubuntu.

Create cross-platform Linux project in VS2017. Add there all your files from Windows project. Set up remote Ubuntu server(I'm using VirtualBox with Ubuntu installed). Compile and debug your project on Ubuntu server just from VS2017.

There is one problem I'm looking solution for: auto-refresh Linux project according to file changes (add/remove only as modifications are auto-refreshing) in your Windows project, but that is a minor issue.

Have a nice day :)

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