could not build module 'XXXXXXXX'或者error: expected identifier or '(' 。一堆奇怪的错误————错误根源

一堆奇怪的错误:1??could not build module ‘XXXXXXXX‘

2??error: expected identifier or ‘(‘

3??EDIT Setting Precompile prefix header = No results in a bunch of syntax errors instead, in stuff like NSObject.h (and other 4??Foundation framework header)

5??EDIT User Cy-4AH figured it out: there needs to be #ifdef __OBJC__ around the whole pch file.

6??error: Could not build module ‘Foundation‘", and things in Foundation.h not being found.

导致以上错误的原因大多数是:

你添加.c/.h/.m文件或者其他拷贝的.c/.h/.m文件导致pch文件错误

(删除文件重新添加还是一样。发生了什么,导致错误的根本在哪?)

像这些问题,没有一种正确的解决方式,在这里我只能引导你们去找到错误的根源………………

我们围绕:    #import 的预处理指令 : #ifdef __OBJC__ #endif    去找出错误根源

pch包含作为前缀到C和ObjC文件。所以你添加的文件当然不会工作

我们平时尽可能的不去拷贝别人的代码文件,很容易让程序崩溃。拷贝也要有个度,不要整个拷贝整个文件。

尝试着不拷贝文件…………

could not build module 'XXXXXXXX'或者error: expected identifier or '(' 。一堆奇怪的错误————错误根源

时间: 2024-08-02 06:41:09

could not build module 'XXXXXXXX'或者error: expected identifier or '(' 。一堆奇怪的错误————错误根源的相关文章

Error: Expected resource of type xxx [ResourceType]

运行环境:Android Studio 1.4 gradle版本:2.10 工程编译没有问题,并且能在模拟器和真机上正常运行,但是当打包成Apk的时候,出现了 Error:Error: Expected resource of type color [ResourceType]  这个错误,导致打包不成功. 以下是出错地方的代码: private static RadioButton createGroupTabItem(Context context, MemberType data) { R

angular2 ng build --prod 报错:Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'

调试页面 ng serve 正常 ng build 也正常 ng build --prod 异常:Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' 开始以为是以前那样,引用错了路径或少引用了东西. 搜了好多资料,发现是 angular-cli 的版本有点低了(因为用了最新的material) 找到原因了,问题就很容易解决了 第一步: rm -rf node_modules/ 第二部: npm

Xcode莫名其妙问题could not build module ‘Foundation‘

今天用Xcode编译项目时,遇到一个莫名其妙的问题:could not build module 'Foundation',以及could not build module 'UIKit',NSString.h expect identifier问题,提示的位置是在Pod的库中.几经查找,才发现是自己一时的粗心... 遇到这个问题时,发现真机编译没有问题,然后编译其它项目时也提示类似的问题,最主要的是一个比较简单的项目编译时也会提示NSString.h expect identifier问题,突

vue报错 Module not found: Error: Cannot resolve 'file' or 'directory'

炸了,我好写sell而组件,直接就用了,我的天哪 看你的写了吗,就用: Module not found: Error: Cannot resolve 'file' or 'directory' 页另一种错误,按这种情况我没遇到:http://www.mamicode.com/info-detail-1564042.html vue报错 Module not found: Error: Cannot resolve 'file' or 'directory'

Error: expected expression, got '}'

1.错误描述 Error: expected expression, got '}' .globalEval/<@http://localhost:8080/Sys/resource/global/plugins/jquery.min.js:2:2613 [email protected]://localhost:8080/Sys/resource/global/plugins/jquery.min.js:2:2587 [email protected]://localhost:8080/Sys

出现could not build module foundation错误

在预编译文件中添加若干头文件引用后,出现could not build module foundation错误 解决方案: 在引用头文件开始加入#ifdef __OBJC__ 结束时加入#endif,例如 #ifndef PureStandard_PrefixHeader_pch                #define PureStandard_PrefixHeader_pch                #ifdef __OBJC__                #import "A

could not build module &#39;uikit&#39;

今天 新建一个SingleView-APP 无法运行程序,在 AppDelegate.h中 第一行代码处报错. #import <UIKit/UIKit.h> /Users/wjw/Desktop/Demo/Demo_OC/SingleView-APP/SingleView-APP/main.m:9:9: Could not build module 'UIKit' 结果处理方法如下:删除 ModuleCatche 网上说的 都是删除/Users/YOURUSERNAME/Library/De

iOS could not build module

今天写了一 framework, 引入到工程之后报错 could not build module 找了一下原因, 我的 framework 引用了我写的另一个 framework, 但是 Framework Search Paths 没有配置, 在这个 framework 中配置引用的 framework 路径, 重新编译即可

Cocos2d-x 3.0 编译出错 解决 error: expected &amp;#39;;&amp;#39; at end of member declaration

近期把项目移植到cocos2d-x 3.0,在整Android编译环境的时候,出现一大堆的编译出错,都是类似"error: expected ';' at end of member declaration"之类的,看了一些编译错误,都是cocos2d-x库里面的代码出错. 经过分析,怀疑可能是编译环境的问题,由于cocos2d-x使用了非常多C++11的新特性,这有可能导致老的编译器出错,看了一下NDK以下的文件以及toolchains里面的内容,windows编译器默认使用4.6,