简体   繁体   English

VxWorks与Eclipse-缺少头文件

[英]VxWorks with Eclipse - missing header files

I want to compile a library for VxWorks 6.8 using Cmake and Eclipse 3.7 Indigo CDT (with VxWorks Pentium and Power-PC compilers set). 我想使用CmakeEclipse 3.7 Indigo CDT (设置了VxWorks PentiumPower-PC编译器)为VxWorks 6.8编译一个库。 The cmake steps work fine and I get ready-to-use Eclipse project. cmake步骤工作正常,我可以使用现成的Eclipse项目。 But compiling fails because of missing headers. 但是由于缺少标头,编译失败。

Example: 例:

#if defined __VXWORKS__
#include <sys/socket.h>
// some more includes here
#endif

This fails because sys/socket.h is missing. 失败是因为缺少sys/socket.h Include directory C:/<path to vxworks>/target/h where most headers are available (including sys directory, but there's no socket.h in it!) is set. 设置包含目录C:/<path to vxworks>/target/h ,在该目录中,大多数标头均可用(包括sys目录,但其中没有 socket.h !)。 The missing socket.h is C:/<path to vxworks>/target/h/wrn/coreip/sys . 缺少的socket.hC:/<path to vxworks>/target/h/wrn/coreip/sys Both paths are set as include directories – nevertheless is still missing. 这两个路径都设置为包含目录-但是仍然缺少。

I've started writing some “dummy headers” – headers which are placed in the proper subdirectory of target/h and only include the actual headers from target/h/wrn/coreip . 我已经开始编写一些“虚拟标头” –标头放置在target/h的正确子目录中,并且仅包含target/h/wrn/coreip的实际标头。 This solution works, but these headers include some more headers on their own, so those need such a workaround too (and then the new one needs some more …). 此解决方案有效,但是这些标头本身包含更多的标头,因此那些标头也需要这种解决方法(然后新的标头还需要更多……)。 I'm wondering why it doesn't work even with include paths set in eclipse. 我想知道为什么即使在eclipse中设置了include路径也无法使用。

Most headers of VxWorks don't have this issue; VxWorks的大多数头文件都没有此问题。 it seems only those for Network. 似乎只有那些用于网络。

Is there any magic trick or something I'm missing? 魔术或我缺少的东西吗?


Missing header Error Message: 标头错误消息丢失:

error: sys/socket.h: No such file or directory 错误:sys / socket.h:没有这样的文件或目录

A Warning i get while compiling: 我在编译时得到的警告

[vxworks path here]/h/vsbConfig.h:42:2: warning: #warning "VxWorks Source Build (VSB) project not specified; using default VxWorks UP configuration under $WIND_BASE/target/lib/h/config" [此处的vxworks路径] /h/vsbConfig.h:42:2:警告:#warning“未指定VxWorks源构建(VSB)项目;在$ WIND_BASE / target / lib / h / config下使用默认VxWorks UP配置”

Environmentvariables WIND_BASE , WIND_HOME and WIND_LIC_PROXY are set in eclipse. Environmentvariables WIND_BASEWIND_HOMEWIND_LIC_PROXY在Eclipse中设置。

I'm crosscompiling from Win7. 我正在从Win7交叉编译。

adding the path to include directories in eclipse is not enough. 仅添加路径以在eclipse中包含目录是不够的。 you have to add it to cmakelists too. 您也必须将其添加到cmakelists You can use include_directories("[your path here]") to do so. 您可以使用include_directories("[your path here]")来执行此操作。

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

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