' WX / wx.h'使用codelite最新的wxwidget版本在eclipse cdt项目中找不到文件

时间:2016-11-25 05:03:07

标签: eclipse wxwidgets

我的wxwidget(3.10 dev版本)是基于以下链接安装的:

http://codelite.org/LiteEditor/WxWidgets31Binaries

并注意到相应的头文件被放入:

/usr/include/wx-3.1-unofficial/wx/wx.h

在听到的文件中," wx.h"包括这样:

#ifndef DSTODO_H_
#define DSTODO_H_
#include <wx/wx.h>

建造时,eclipse给了我:

Info: Internal Builder is used for build
clang++ -I/usr/lib/llvm-3.8/lib -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -o src/DSToDo.bc ../src/DSToDo.cpp 
In file included from ../src/DSToDo.cpp:8:
../src/DSToDo.h:11:10: fatal error: 'wx/wx.h' file not found
#include <wx/wx.h>
     ^
1 error generated.

将包括更改为:

#include <wx-3.1-unofficial/wx/wx.h>

Eclipse给了我:

Info: Internal Builder is used for build
clang++ -I/usr/lib/llvm-3.8/lib -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -o src/DSToDo.bc ../src/DSToDo.cpp 
In file included from ../src/DSToDo.cpp:8:
In file included from ../src/DSToDo.h:11:
/usr/include/wx-3.1-unofficial/wx/wx.h:14:10: fatal error: 'wx/defs.h' file not found
#include "wx/defs.h"
     ^
1 error generated.

如果添加

/usr/include/wx-3.1-unofficial

c/c++ build->settings->LLVM Clang++->Includes

Eclipse给出:

Info: Internal Builder is used for build
clang++ -I/usr/lib/llvm-3.8/lib **-I/usr/include/wx-3.1-unofficial** -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -o src/DSToDo.bc ../src/DSToDo.cpp 
In file included from ../src/DSToDo.cpp:8:
In file included from ../src/DSToDo.h:11:
In file included from /usr/include/wx-3.1-unofficial/wx/wx.h:14:
In file included from /usr/include/wx-3.1-unofficial/wx/defs.h:20:
/usr/include/wx-3.1-unofficial/wx/platform.h:136:10: fatal error: 'wx/setup.h' file not found
#include "wx/setup.h"
         ^
1 error generated.

如何解决此问题?

1 个答案:

答案 0 :(得分:1)

您需要将-I/usr/include/wx-3.1-unofficial添加到编译器选项中。

我不知道为什么标题会安装在这个非标准位置。