DouglasHeriot / ios-cmake

Automatically exported from code.google.com/p/ios-cmake
0 stars 0 forks source link

configure: error: C++ compiler cannot create executables #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've been trying to solve this issue for a couple of days but without success. 
I am building a static library written in C, which uses other static libraries 
(like curl, libevent, defined as ExternalProjects in CMake and compiled from 
sources). The output static library is merged from static dependencies and 
library itself. After upgrading to iOS 7 and OS 10.9 I cannot compile library 
dependencies due to error described below.

What steps will reproduce the problem?

1. cmake  -DCMAKE_TOOLCHAIN_FILE=../iOS/iOS.cmake -DIOS_PLATFORM=OS  -GXcode ..
2. xcodebuild  -configuration Debug

What is the expected output? What do you see instead?

./configure --prefix=build.ios/libs/staging --disable-dependency-tracking 
--disable-shared --with-pic "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" --disable-cookies 
--disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap 
--disable-ipv6 --disable-ldap --disable-ldaps --disable-manual --disable-pop3 
--disable-proxy --disable-rtsp --disable-smtp --disable-sspi --disable-telnet 
--disable-tftp --without-libidn --without-ssl --without-zlib --without-librtmp
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable c-ares for DNS lookups... no
checking for grep... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ar... 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/ar
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking curl version... 7.21.3
checking build system type... x86_64-apple-darwin13.0.0
checking host system type... x86_64-apple-darwin13.0.0
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `build.ios/libs/src/curl':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** [build.ios/libs/src/curl-stamp/Debug-iphoneos/curl-configure] Error 77
Command /bin/sh failed with exit code 2

What version of the product are you using? On what operating system?

Latest version of ios-cmake, on OS X Mavericks, trying to cross compile against 
iOS 7.0.

Please provide any additional information below.

I've been successfully using ios-cmake on OS X 10.8 and iOS 6.0. After 
upgrading I cannot get it working.
I managed to get it somehow working using:

1. cmake  -DCMAKE_TOOLCHAIN_FILE=../iOS/iOS.cmake -DIOS_PLATFORM=SIMULATOR  
-GXcode ..

but the output binary is somehow corrupted:

lipo -info build/Debug/library.a  
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/lipo: archive member build/Debug/library.a(base64.o) cputype (16777223) 
and cpusubtype (3) does not match previous archive members cputype (7) and 
cpusubtype (3) (all members must match)

I tried reinstalling macports (to have new version of cmake), installed latest 
Xcode (5.0.2), latest command-line-tools and accepted license for 
command-line-tools (which could also generate similar error from clang/gcc).

I don't know if that is a bug ios-cmake, but I would appreciate any help.

Cheers,

Tomasz

Original issue reported on code.google.com by gebarow...@gmail.com on 15 Nov 2013 at 5:30

GoogleCodeExporter commented 9 years ago
This is largely the same problem as issue #11. The iOS-cmake toolchain was 
never written to support compiling executables, only libraries, as the errors 
indicate:

"configure: error: C compiler cannot create executables"

My comments on #11 add some details. 

Original comment by wizzr...@gmail.com on 18 Nov 2013 at 3:42

GoogleCodeExporter commented 9 years ago

Original comment by wizzr...@gmail.com on 12 Dec 2013 at 2:54