简体   繁体   中英

Compiling the same c++ code in Ubuntu(Netbeans) and Windows(Visual Studio 2012)

I have starded developing a c++ project under ubuntu. No I want to compile exactly the same code under Windows with Visual Studio 2012(I will add a GUI afterwards for the Windows version) Is this possible? Or should I use Netbeans as well in Windows?

I use the gcc in Linux. To use the same libraries in Windows I must use cygwin right? Do I need cygwin only to compile or also to execute the application?

This is very important, it should be as easy as possible to run my Programm under Linux and Windows!

Thanks Florian

Really depends on what you are linking to in windows. If you only link against the libstdc++ probably you can just compile your source code (after some tweaks) directly with MSVC. Otherwise, you either need your dependencies already compiled for windows, or build them from source code (in case it is possible). Using cygwin will allow you to use the gcc toolchain in both environments, but you won't be using VS2012 to compile.

With so little information is hard to tell what you do you really need. Try explaining your project to us.

I hope that helps.

如果仅使用标准库,请确保可以在任何操作系统中编译,并且无法在VS上使用GCC,则可以安装mingw并在Netbeans或代码块或Eclipse上对其进行配置

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