【问题标题】:Use of undeclared identifier with libcinder在 libcinder 中使用未声明的标识符
【发布时间】:2013-08-16 11:41:34
【问题描述】:

我一直在研究这个https://github.com/Morpheu5/SecondStudy-touch,直到 Xcode 决定放弃并停止编译,因为......好吧,我不知道。在我看来,这一定是菜鸟失误的结果,但我真的看不出来。

它吐出的错误正是

In file included from /Users/af6539/src/SecondStudy/xcode/../src/TouchPoint.cpp:1:
In file included from /Users/af6539/src/SecondStudy/xcode/../include/TouchPoint.h:4:
/Users/af6539/src/SecondStudy/xcode/../../cinder_0.8.5_mac/blocks/TUIO/include/TuioCursor.h:51:44: error: use of undeclared identifier 'osc'
    static Cursor createFromSetMessage( const osc::Message &message ) {
                                              ^
/Users/af6539/src/SecondStudy/xcode/../../cinder_0.8.5_mac/blocks/TUIO/include/TuioCursor.h:87:47: error: use of undeclared identifier 'osc'
    static Cursor25d createFromSetMessage( const osc::Message &message ) {
                                                 ^

指的是我正在使用的库 cinder,其中包括 TUIO 和 OSC。正如我所说,它正在工作,然后我认为当我开始从事整个 MusicStroke* 业务时,一切都开始向南,所以这些文件可能会提供一些线索?如果有,我就看不到它们了。

【问题讨论】:

  • 你没有丢失一个头文件#include?
  • osc::Message 声明在哪里?
  • @Joachim 如果有的话,我包含的太多了。我正在检查它们以确保我没有得到环依赖,但#pragma once 仍然应该解决这个问题。 Doctorlove,正如我所说,它们来自第三方库 cinder。您可以从他们的网站获取源代码,osc::Message 在那里定义。

标签: c++ undeclared-identifier osc cinder


【解决方案1】:

我提出的第一个建议是回滚到之前的提交,直到您可以成功构建。我还将删除构建目录(如果您不使用相对的“派生数据”路径,则删除任何共享文件夹),因为您所看到的一种可能的解释是未显示已编译代码的缓存版本错误,但突然间它就失效了。

如果我不得不猜测,没有任何示例代码,只是简单地浏览一下您的项目,我确实会说这是因为循环包含。尝试从 .cpp 转发声明你能做的和#include。比如MusicStrokeGesture.h中的TouchTrace可以前向声明...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多