yetist / ios-toolchain-based-on-clang-for-linux

Automatically exported from code.google.com/p/ios-toolchain-based-on-clang-for-linux
0 stars 0 forks source link

iphonesdk-utils-2.0: Problems compiling genLocalization2/getLocalizedStringFromFile.cpp #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cd iphonesdk-utils-2.0
2. ./configure --prefix=/usr
3. make

What is the expected output? What do you see instead?
I get the following errors creating the make files

make[2]: Entering directory 
`/home/cameron/src/iphonesdk-utils-2.0/genLocalization2'
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include  -D_DEBUG -D_GNU_SOURCE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 
-fomit-frame-pointer -std=c++11 -fvisibility-inlines-hidden -fno-exceptions 
-fno-rtti -fPIC -Woverloaded-virtual -ffunction-sections -fdata-sections 
-Wcast-qual -I../libhelper -I../libplutil -fno-rtti   -g -O2 -MT 
ios_genLocalization-getLocalizedStringFromFile.o -MD -MP -MF 
.deps/ios_genLocalization-getLocalizedStringFromFile.Tpo -c -o 
ios_genLocalization-getLocalizedStringFromFile.o `test -f 
'getLocalizedStringFromFile.cpp' || echo './'`getLocalizedStringFromFile.cpp
getLocalizedStringFromFile.cpp: In function 
‘std::vector<std::basic_string<char> > 
getLocalizedStringFromFile(std::string, std::string, 
std::vector<std::basic_string<char> >)’:
getLocalizedStringFromFile.cpp:101:13: error: no matching function for call to 
‘clang::TargetInfo::CreateTargetInfo(clang::DiagnosticsEngine&, 
clang::TargetOptions*)’
             );   
             ^
getLocalizedStringFromFile.cpp:101:13: note: candidate is:
In file included from getLocalizedStringFromFile.cpp:18:0:
/usr/include/clang/Basic/TargetInfo.h:98:3: note: static clang::TargetInfo* 
clang::TargetInfo::CreateTargetInfo(clang::DiagnosticsEngine&, const 
std::shared_ptr<clang::TargetOptions>&)
   CreateTargetInfo(DiagnosticsEngine &Diags,
   ^
/usr/include/clang/Basic/TargetInfo.h:98:3: note:   no known conversion for 
argument 2 from ‘clang::TargetOptions*’ to ‘const 
std::shared_ptr<clang::TargetOptions>&’
getLocalizedStringFromFile.cpp:117:49: error: no matching function for call to 
‘clang::HeaderSearch::HeaderSearch(llvm::IntrusiveRefCntPtr<clang::HeaderSearc
hOptions>&, clang::FileManager&, clang::DiagnosticsEngine&, 
clang::LangOptions&, clang::TargetInfo*&)’
                                      pTargetInfo);
                                                 ^
getLocalizedStringFromFile.cpp:117:49: note: candidate is:
In file included from getLocalizedStringFromFile.cpp:14:0:
/usr/include/clang/Lex/HeaderSearch.h:260:3: note: 
clang::HeaderSearch::HeaderSearch(llvm::IntrusiveRefCntPtr<clang::HeaderSearchOp
tions>, clang::SourceManager&, clang::DiagnosticsEngine&, const 
clang::LangOptions&, const clang::TargetInfo*)
   HeaderSearch(IntrusiveRefCntPtr<HeaderSearchOptions> HSOpts,
   ^
/usr/include/clang/Lex/HeaderSearch.h:260:3: note:   no known conversion for 
argument 2 from ‘clang::FileManager’ to ‘clang::SourceManager&’
getLocalizedStringFromFile.cpp:159:17: error: no matching function for call to 
‘clang::Preprocessor::Preprocessor(llvm::IntrusiveRefCntPtr<clang::Preprocesso
rOptions>&, clang::DiagnosticsEngine&, clang::LangOptions&, 
clang::TargetInfo*&, clang::SourceManager&, clang::HeaderSearch&, 
clang::CompilerInstance&)’
         compInst);
                 ^
getLocalizedStringFromFile.cpp:159:17: note: candidate is:
In file included from getLocalizedStringFromFile.cpp:20:0:
/usr/include/clang/Lex/Preprocessor.h:456:3: note: 
clang::Preprocessor::Preprocessor(llvm::IntrusiveRefCntPtr<clang::PreprocessorOp
tions>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, 
clang::HeaderSearch&, clang::ModuleLoader&, clang::IdentifierInfoLookup*, bool, 
clang::TranslationUnitKind)
   Preprocessor(IntrusiveRefCntPtr<PreprocessorOptions> PPOpts,
   ^
/usr/include/clang/Lex/Preprocessor.h:456:3: note:   no known conversion for 
argument 4 from ‘clang::TargetInfo*’ to ‘clang::SourceManager&’
getLocalizedStringFromFile.cpp:165:24: error: invalid initialization of 
reference of type ‘const clang::FrontendOptions&’ from expression of type 
‘clang::HeaderSearchOptions’
         frontendOptions);
                        ^
In file included from /usr/include/clang/Frontend/CompilerInstance.h:16:0,
                 from getLocalizedStringFromFile.cpp:21:
/usr/include/clang/Frontend/Utils.h:64:6: error: in passing argument 3 of 
‘void clang::InitializePreprocessor(clang::Preprocessor&, const 
clang::PreprocessorOptions&, const clang::FrontendOptions&)’
 void InitializePreprocessor(Preprocessor &PP,
      ^
getLocalizedStringFromFile.cpp:188:19: error: ‘class clang::SourceManager’ 
has no member named ‘createMainFileID’
     sourceManager.createMainFileID(pFile);
                   ^

What version of the product are you using? On what operating system?
Linux Mint 16 64-bit, Linux kernel 3.11.0-12-generic

Please provide any additional information below.
I'm not certain, but I compared the error producing line (101) with the clang 
documentation of clang::TargetInfo::CreateTargetInfo and the parameter 
targetInfo seems to be of the wrong type. 
http://clang.llvm.org/doxygen/classclang_1_1TargetInfo.html#a44a938d7eca2e63ba70
4ac5538f1a208

Original issue reported on code.google.com by caramsay...@gmail.com on 18 Jul 2014 at 3:31

GoogleCodeExporter commented 9 years ago
I looked through other issues and it seems that having clang version>=3.4 is a 
problem. I should note that the version of clang on my computer is 3.5.0.

Original comment by caramsay...@gmail.com on 21 Jul 2014 at 1:20

GoogleCodeExporter commented 9 years ago
They are now using C++11 stuff instead of own implementations, thus llvm-3.5 
breaks api compatibility.
You can work around this by using <= llvm-3.4 for compiling the tool chain 
stuff, you can still switch to
3.5 afterwards (llvm stuff is usually linked statically, besides libLTO).

http://llvm.org/apt/ provides a 3.4 version.

Original comment by t.poecht...@gmail.com on 24 Jul 2014 at 8:00

GoogleCodeExporter commented 9 years ago
Using a lower version worked. Thanks

Original comment by caramsay...@gmail.com on 26 Jul 2014 at 5:09

GoogleCodeExporter commented 9 years ago
I am with similar problem to compile this file, what exactly version you have 
used?

I have tested with 3.5.2, 3.4.2 and now with 3.4... still returning errors.

Original comment by semei...@gmail.com on 16 Nov 2014 at 3:53

GoogleCodeExporter commented 9 years ago
There is a different approach that should work with any clang version: 
https://github.com/tpoechtrager/cctools-port/issues/3

Original comment by t.poecht...@gmail.com on 18 Nov 2014 at 8:28

GoogleCodeExporter commented 9 years ago
Oh wait, that's actually you, sorry ;) Anyway, may be useful for future 
visitors.

Original comment by t.poecht...@gmail.com on 18 Nov 2014 at 8:32

GoogleCodeExporter commented 9 years ago
A small patch found on another issue fixed the problem for me.

https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/issues/detail?i
d=27

Original comment by ps...@psyon.org on 9 Dec 2014 at 10:09