質問

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). The cmake steps work fine and I get ready-to-use Eclipse project. 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. 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. The missing socket.h is C:/<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 fromtarget/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.

Most headers of VxWorks don’t have this issue; 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

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"

Environmentvariables WIND_BASE, WIND_HOME and WIND_LIC_PROXY are set in eclipse.

I'm crosscompiling from Win7.

役に立ちましたか?

解決

adding the path to include directories in eclipse is not enough. you have to add it to cmakelists too. You can use include_directories("[your path here]") to do so.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top