我的应用程序在模拟器和设备上构建并运行良好,但我注意到由于某种原因,我的主目录中有一个重复的目录,以及一些重复的文件.因此,虽然我的主目录是/ MyAppName,但/ MyAppName/MyAppName中也有文件.
我小心地将任何非重复文件移出子目录,删除了目录,并更新了我的Prefix Header和Info.plist文件的路径.我清理并构建了项目,但是我仍然从编译器中查找重复子目录(已删除)中的错误,如下所示:
arm-apple-darwin10-llvm-gcc-4.2:/MyAppName/MyAppName/main.m:没有这样的文件或目录
因为main.m现在位于/MyAppName/main.m中
我没有看到除Prefix Header和Info.plist文件之外的变量或设置.我还应该看看其他地方吗?显然有些东西仍然引用了重复的子目录,但我没有看到.
我开始使用Xcode 4.2,我在生成代码覆盖方面遇到了问题.
Xcode 4.2不包含GCC 4.2编译器,但它已被LLVM GCC 4.2编译器取代.第一个需要在以前版本的Xcode中生成代码覆盖.
我按照CoverStory 网站上的"教程"进行了操作,但结果如下:
a)当我执行所有步骤时,没有覆盖文件.
b)当我将libprofile_rt.dylib链接到我的项目时,应该失败的测试,不再失败.
有人遇到过这个问题吗?你是怎么解决的?
谢谢
我正在进行一个图书馆项目,我总是Strip Debug Symbols为发布版本启用" "
我最近注意到了" Generate Debug Symbols"旗帜.当我将" Generate Debug Symbols"标志设置为NO时,我的库大小缩小了30%
这是发布版本的合理优化吗?
" 条带调试符号 "和" 生成调试符号 "选项有什么区别,理想情况下,如果我剥离调试符号,并不是所有生成的调试符号都会消失?为什么我看到这种差异?
除了-Os(最快,最小)之外,还有什么其他优化可以减少二进制大小?
" Strip Linked Product" 如何运作?
我有兴趣学习更多x86/x86_64程序集.唉,我在Mac上.没问题,对吧?
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build
5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Run Code Online (Sandbox Code Playgroud)
我在C中写了一个简单的"Hello World",以获得我将要编写的代码类型的基线.我在大学时做了一点x86,并且查了很多教程,但是没有一个看起来像我在这里看到的怪异输出:
.section __TEXT,__text,regular,pure_instructions
.globl _main
.align 4, 0x90
_main:
Leh_func_begin1:
pushq %rbp
Ltmp0:
movq %rsp, %rbp
Ltmp1:
subq $32, %rsp
Ltmp2:
movl %edi, %eax
movl %eax, -4(%rbp)
movq %rsi, -16(%rbp)
leaq L_.str(%rip), …Run Code Online (Sandbox Code Playgroud) 我正在运行 gdb,并且set verbose on试图理解收到的消息之一:
Reading symbols from system-supplied DSO at 0x7ffff7ffb000...(no debugging symbols found)...done.
Run Code Online (Sandbox Code Playgroud)
是什么system-supplied DSO?经过一番搜索,我认为这DSO可能代表“动态共享对象”。但我仍然不明白 gdb 在这里做什么以及如何解决找不到调试符号的问题(或者如果它甚至很重要)。
另外,我正在调试的程序正在使用 llvm-gcc 进行编译,并应用了 LLVM pass。我认为这会影响 gdb 的行为,但我不确定如何影响。
所以本质上我的问题是 gdb 打印的消息意味着什么,它是否可能导致问题,如果是的话,有什么建议可以帮助 gdb 找到调试符号。
我想使用gold作为我的系统链接器而不是ld,因为ld不支持-fPIC和-shared.我按照这个特殊的url这样做, gold-plugin 根据文档,我运行了gcc -v filename.c来找出gcc将运行的链接命令. 然后它告诉我检查运行collect2的行并用-plugin /path/to/LLVMgold.so替换它. 但是gcc和collect2是二进制文件.我研究了一下......并且理解gcc调用collect2,然后通过搜索ld-linux.so.2来调用collect2调用系统链接器ld.我在我的fedora上安装了rpm包装gcc4.4.4 ...如何更改配置.
如何让gcc调用ld-new/gold而不是collect2?
我正在尝试使用gcc 4.8(通过MacPorts安装)编译boost :: program_options示例中的一个,http: //svn.boost.org/svn/boost/trunk/libs/program_options/example/first.cpp.但是,我不断收到错误:
Undefined symbols for architecture x86_64:
"boost::program_options::to_internal(std::basic_string, std::allocator > const&)", referenced from:
std::vector, std::allocator >, std::allocator, std::allocator > > > boost::program_options::to_internal, std::allocator > >(std::vector, std::allocator >, std::allocator, std::allocator > > > const&) in ccEWnIGV.o
"boost::program_options::options_description::options_description(std::basic_string, std::allocator > const&, unsigned int, unsigned int)", referenced from:
_main in ccEWnIGV.o
"boost::program_options::invalid_option_value::invalid_option_value(std::basic_string, std::allocator > const&)", referenced from:
void boost::program_options::validate(boost::any&, std::vector, std::allocator >, std::allocator, std::allocator > > > const&, double*, long) in ccEWnIGV.o
"boost::program_options::error_with_option_name::error_with_option_name(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, int)", referenced from:
boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, int) … 我正在尝试打开一个使用iOS 6.0构建的旧项目.该项目用于编译正常,但在xCode 5下打开时,我得到这个神秘的错误消息.
Unsupported compiler 'com.apple.compilers.llvmgcc42' selected for architecture 'armv7'
Unable to determine concrete GCC compiler for file /Users/alexanderstone/Desktop/Development/RestKit/Vendor/NXJSON/NSError+Extensions.m of type sourcecode.c.objc.
Unable to determine concrete GCC compiler for file /Users/alexanderstone/Desktop/Development/RestKit/Vendor/NXJSON/NXDebug.m of type sourcecode.c.objc.
Unable to determine concrete GCC compiler for file /Users/alexanderstone/Desktop/Development/RestKit/Vendor/NXJSON/NXJsonParser.m of type sourcecode.c.objc.
Unable to determine concrete GCC compiler for file /Users/alexanderstone/Desktop/Development/RestKit/Vendor/NXJSON/NXJsonSerializer.m of type sourcecode.c.objc.
Run Code Online (Sandbox Code Playgroud)
我已经检查了两个项目构建设置,它们看起来是正确的 - LLVM 5.0被选为两者的编译器.


另外,我检查了编译器抱怨的.m文件,并且没有看到任何对GCC的引用.有一些ASSERT()和其他宏,但我不知道它们是否是特定于编译器的.
当所有子项目似乎都设置为llvm5.0时,如何解决xCode 5中缺少的llvmgcc4.2编译器?
我正在编写一个自制语言的编译器,它只能处理int值,即i32.条件和表达式与C语言类似.因此,我正在考虑条件语句作为表达式,即它们返回一个int值.它们也可以用在表达式中,例如(2 > 1) + (3 > 2)将返回2.但LLVM条件输出i1值.
i1应该转换成i32,以便我可以执行二进制操作if(variable)或if(a + b).为此,我需要转换i32为i1最后,我想办法从类型转换i1到i32和i32到i1.我的代码现在提供这些错误:
对于如下声明if(variable):
error: branch condition must have 'i1' type
br i32 %0, label %ifb, label %else
^
Run Code Online (Sandbox Code Playgroud)
对于声明 a = b > 3
error: stored value and pointer type do not match
store i1 %gttmp, i32* @a
^
Run Code Online (Sandbox Code Playgroud)
有关如何做到这一点的任何建议?
使用pip在Python中安装软件包时,我遇到了以下错误:
unable to execute gcc-4.2: No such file or directory
Run Code Online (Sandbox Code Playgroud)
显然,pip正在尝试使用gcc-4.2,它不在任何二进制目录中,即/ usr/bin.在浏览了这个网站和其他网站后,我发现其他许多人都遇到了同样的问题.但是,在OS X Lion中将gcc更新为版本4.2,这不是版本问题,而是在/ usr/bin下将gcc称为gcc,而不是gcc-4.2,并且符号链接到llvm-gcc.在/ usr/bin中添加gcc-4.2作为gcc的符号链接后,pip能够成功安装所有内容.为什么呢,那个pip正在寻找gcc-4.2而不是gcc?这是pip,OS X Lion或pip中试图用gcc-4.2自行安装的软件包的错吗?
最后,我的符号链接在这种情况下是正确的做法,还是应该以其他方式解决这个问题?