我一直在试图将我的pThread类移植到iOS。因此,我已将它们全部移到我的XCode项目中,并放入名为“Threading”的主要文件的子目录中。相对标题XCode 4
但是我无法编译。在pThreadThread.cpp,例如,它有一个
#include "Threading/pThreadThread.h"
,但返回的XCode我一个错误说,它不能找到头。我假设这是因为它从目录中查看标题当前所在。因此,在前面添加“../”似乎有帮助,但它不是一个很好的解决方案,IMO。
所以我发现这个线程:
XCode 4 Relative #include paths in search?
但在尝试它似乎不工作的解决方案。首先我注意到实际的源数据在$ SRCROOT /下,所以我在(首先在User Header路径下,然后,因为在正常的头文件路径下工作不起作用),并且...它仍然没有工作。
怎么回事?我如何获得相关头文件,包括实际工作?
编辑:命令行看起来是这样的
CompileC /Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/Intermediates/VoiceAnalyser.build/Debug-iphonesimulator/VoiceAnalyser.build/Objects-normal/i386/pthreadThread.o VoiceAnalyser/Threading/pthreadThread.cpp normal i386 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd "/Volumes/Dev Disk/Development/Oxford Wave Research/VoiceAnalyser"
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -x c++ -arch i386 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -O0 -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -DDEBUG=1 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -fexceptions -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -fvisibility-inlines-hidden -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -iquote /Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/Intermediates/VoiceAnalyser.build/Debug-iphonesimulator/VoiceAnalyser.build/VoiceAnalyser-generated-files.hmap -I/Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/Intermediates/VoiceAnalyser.build/Debug-iphonesimulator/VoiceAnalyser.build/VoiceAnalyser-own-target-headers.hmap -I/Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/Intermediates/VoiceAnalyser.build/Debug-iphonesimulator/VoiceAnalyser.build/VoiceAnalyser-all-target-headers.hmap -iquote /Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/Intermediates/VoiceAnalyser.build/Debug-iphonesimulator/VoiceAnalyser.build/VoiceAnalyser-project-headers.hmap -iquote/Volumes/Dev -iquoteDisk/Development/Oxford -iquoteWave -iquoteResearch/VoiceAnalyser -I/Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/Products/Debug-iphonesimulator/include -I/Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/Intermediates/VoiceAnalyser.build/Debug-iphonesimulator/VoiceAnalyser.build/DerivedSources/i386 -I/Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/Intermediates/VoiceAnalyser.build/Debug-iphonesimulator/VoiceAnalyser.build/DerivedSources -F/Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/Products/Debug-iphonesimulator -include /Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/PrecompiledHeaders/VoiceAnalyser-Prefix-dzvjbuvabxhsdtfseyyxyapbsuqv/VoiceAnalyser-Prefix.pch -c "/Volumes/Dev Disk/Development/Oxford Wave Research/VoiceAnalyser/VoiceAnalyser/Threading/pthreadThread.cpp" -o /Users/oscarforth/Library/Developer/Xcode/DerivedData/VoiceAnalyser-baxcnwbmyjmkfncxfxoaltcqbrzr/Build/Intermediates/VoiceAnalyser.build/Debug-iphonesimulator/VoiceAnalyser.build/Objects-normal/i386/pthreadThread.o
In file included from /Volumes/Dev Disk/Development/Oxford Wave Research/VoiceAnalyser/VoiceAnalyser/Threading/pthreadThread.cpp:1:
/Volumes/Dev Disk/Development/Oxford Wave Research/VoiceAnalyser/VoiceAnalyser/Threading/../Threading/pthreadThread.h:44:10: fatal error: 'Threading/pThreadEvent.h' file not found [2]
#include "Threading/pThreadEvent.h"
^
1 error generated.
加载我的项目是什么,你要添加页眉路径?包含pThreadThread.h的目录或包含Threading目录的目录?后者是你应该包含在标题路径中。 –
@Ben Hocking:$ SRCROOT/指向我的Threading子目录所在的目录,但我仍然得到相同的构建错误。 –
Goz
另请注意......我已经检查并重复检查过......它绝对指向线程目录是其子目录的目录。 – Goz