转换为c++;到VC++; 我们有工作在Raspbian上的基于Debian的C++代码。我们想把它转换成VC++。但我们看到的问题是如何获取库: #include <string> #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <string.h> #include <iostream> #include <cstdlib> #include <sys/time.h> #include <cstring> #include <sys/ioctl.h> #include <net/if.h> using namespace std; #include "base64.h" #include <wiringPi.h> #include <wiringPiSPI.h> #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 使用名称空间std; #包括“base64.h” #包括 #包括

转换为c++;到VC++; 我们有工作在Raspbian上的基于Debian的C++代码。我们想把它转换成VC++。但我们看到的问题是如何获取库: #include <string> #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <string.h> #include <iostream> #include <cstdlib> #include <sys/time.h> #include <cstring> #include <sys/ioctl.h> #include <net/if.h> using namespace std; #include "base64.h" #include <wiringPi.h> #include <wiringPiSPI.h> #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 使用名称空间std; #包括“base64.h” #包括 #包括,c++,visual-c++,raspberry-pi,raspbian,windows-10-iot-core,C++,Visual C++,Raspberry Pi,Raspbian,Windows 10 Iot Core,如果我从Raspbian操作系统复制头文件,它会使用VC++(Windows 10 IoT)还是会产生问题 请告知,处理上述库的最佳方法是什么 谢谢不,如果您从raspbian复制文件,它将不起作用。您必须使用与windows等效的库。例如,windows中的#include的等价物是#include。可以使用编译时条件代码块。例如— #ifdef _WIN32 //true for all windows #include <winsock2.h> #else #include &

如果我从Raspbian操作系统复制头文件,它会使用VC++(Windows 10 IoT)还是会产生问题

请告知,处理上述库的最佳方法是什么


谢谢

不,如果您从raspbian复制文件,它将不起作用。您必须使用与windows等效的库。例如,windows中的
#include
的等价物是
#include
。可以使用编译时条件代码块。例如—

#ifdef _WIN32 //true for all windows
#include <winsock2.h>
#else
#include <sys/socket.h>
#endif
#ifdef\u WIN32//适用于所有窗口
#包括
#否则
#包括
#恩迪夫

您也可以使用这种类型的条件编写其他代码。首先,你需要找出在Debian中使用的Windows中的函数和库的替代品。

“如果我从Rasbian操作系统复制头文件,它会用VC++工作”-不,Visual C++(Aka MSVC)管理编译器本身,而不是系统上可用的系统头或其他可用的系统。因此,在另一个编译器上没有“等效”的头,除了标准化的语言库头。@tambre我指的是windows的等效头。对不起,弄错了。编辑它。@tambre:实际上,MSVC包含了可用的系统头。这些是所谓的“Windows SDK”的一部分。@MSalters MSVC没有,它是VS15安装过程中的附加可选组件。如果不在VS15上安装Windows SDK,就可以安装MSVC。