Linux 的程序可以透过建立vs2010 工程来编译
Linux 的程序可以通过建立vs2010 工程来编译?
有个vrpn的工具
vrpn可以捕获鼠标的信号.
cmake 之后编译. 发现vrpn.sln里面的vrpn_Mouse.h 文件好像都是linux的?链接如下:
vrpn_Mouse.h vrpn_Mouse.cpp
那这些linux的代码怎么能在vs2010里面编译?
------解决方案--------------------
理论上是可行的,VS只是一个外壳,可以把它看成一个可视化的make工具,它最终还是要底层的Compiler、Linker来干活的。
------解决方案--------------------
Compiler没问题,但是Linker不行,因为VC的Linker产生的是PE格式的头。
------解决方案--------------------
用MinGW
------解决方案--------------------
都什么跟什么啊,明显是跨平台的代码,非说什么linux的。。。
#if !( defined(_WIN32) && defined(VRPN_USE_WINSOCK_SOCKETS) )
24 # include <sys/select.h> // for select, FD_ISSET, FD_SET, etc
25 #endif
26
27 #ifdef _WIN32
28 #include <windows.h>
29
30 #pragma comment (lib, "user32.lib")
31
32 // Fix sent in by Andrei State to make this compile under Visual Studio 6.0.
33 // If you need this, you also have to copy multimon.h from the DirectX or
34 // another Windows SDK into a place where the compiler can find it.
35 #ifndef SM_XVIRTUALSCREEN
36 #define COMPILE_MULTIMON_STUBS
37 #include "multimon.h"
38 #endif
39
40 #endif
41
有个vrpn的工具
vrpn可以捕获鼠标的信号.
cmake 之后编译. 发现vrpn.sln里面的vrpn_Mouse.h 文件好像都是linux的?链接如下:
vrpn_Mouse.h vrpn_Mouse.cpp
那这些linux的代码怎么能在vs2010里面编译?
------解决方案--------------------
理论上是可行的,VS只是一个外壳,可以把它看成一个可视化的make工具,它最终还是要底层的Compiler、Linker来干活的。
------解决方案--------------------
Compiler没问题,但是Linker不行,因为VC的Linker产生的是PE格式的头。
------解决方案--------------------
用MinGW
------解决方案--------------------
都什么跟什么啊,明显是跨平台的代码,非说什么linux的。。。
#if !( defined(_WIN32) && defined(VRPN_USE_WINSOCK_SOCKETS) )
24 # include <sys/select.h> // for select, FD_ISSET, FD_SET, etc
25 #endif
26
27 #ifdef _WIN32
28 #include <windows.h>
29
30 #pragma comment (lib, "user32.lib")
31
32 // Fix sent in by Andrei State to make this compile under Visual Studio 6.0.
33 // If you need this, you also have to copy multimon.h from the DirectX or
34 // another Windows SDK into a place where the compiler can find it.
35 #ifndef SM_XVIRTUALSCREEN
36 #define COMPILE_MULTIMON_STUBS
37 #include "multimon.h"
38 #endif
39
40 #endif
41