【问题标题】:'wx/wx.h' file not found in eclipse cdt project with codelite's latest wxwidget version在具有 Codelite 最新 wxwidget 版本的 eclipse cdt 项目中找不到“wx/wx.h”文件
【发布时间】:2016-11-25 05:03:07
【问题描述】:

我的wxwidget(3.10 dev version)是根据这个链接安装的:

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.

如何解决这个问题?

【问题讨论】:

  • “标题搜索路径”和“链接器选项”的项目设置是什么?

标签: eclipse wxwidgets


【解决方案1】:

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

我不知道为什么头文件安装在这个非标准位置。

【讨论】:

  • 你真的需要阅读 documentation 来使用 wxWidgets 构建应用程序,我真的不明白如果你什么都没做,你怎么期望任何工作。
猜你喜欢
  • 2020-09-11
  • 1970-01-01
  • 2016-10-22
  • 2012-03-24
  • 1970-01-01
  • 2012-01-30
  • 1970-01-01
  • 2021-06-18
  • 2011-06-04
相关资源
最近更新 更多