简体   繁体   English

Linux标头-VS Unix扩展

[英]Headers for Linux - VS Unix Extension

I'm using Visual Studio extension ( LinuxDevelopmentExtension ) to write programs for unix-based OS. 我正在使用Visual Studio扩展( LinuxDevelopmentExtension )来为基于unix的OS编写程序。 For working with sockets, I'm using headers, such as: 为了使用套接字,我使用了标题,例如:

<sys/socket.h>
<netinet/in.h>
<arpa/inet.h>

Problem: programs building without errors, but in the IDE these headers is marks as unreachable, that brings some inconvenience. 问题:程序的构建没有错误,但是在IDE中,这些标头被标记为不可访问,这带来了一些不便。 How to resolve it ? 怎么解决呢?

You need to manually copy those header files to your IDE PC, and add them to the include path in the project build settings. 您需要手动将这些头文件复制到您的IDE PC,并将它们添加到项目构建设置中的include路径。

It works so that any local (ie Windows) paths for headers are used by the IDE for IntelliSense, etc. - while remote (ie Linux) paths are used by the compiler. 它可以正常工作,以便IDE可以将头的任何本地(即Windows)路径用于IntelliSense等。-编译器可以使用远程(即Linux)路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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