|
From: | Laurent Michel |
Subject: | Re: Getting Objective-C 2.0 working |
Date: | Fri, 18 May 2012 12:03:49 -0400 |
Dear Eric (and everybody else reading! ;-)), One more question, if I can abuse of your time some more.... To make a long story short, I apparently failed to get GNUstep compiled with the newer libobjc2 runtime you pointed me at, but my own code does compile against that runtime. However, my code does not link succesfully against the GNUstep I cobbled together on Ubuntu. Any attempt to build GNUstep with the gcc tool suite pulls a different (older) libobjc runtime and the two are incompatible. So I eventually decide to remove all the tools that came with ubuntu and try to build GNUstep with clang. Note that I successfully build the libobjc2 you pointed me to. To attempt a build of GNUstep: 1. export CC=clang 2. ./InstallGNUstep Step #2 fails to succesffully configure GNUstep though. Here is the report it produces at the end: * Startup configuration report * ********************************************************************* -------------------------------------------------------------- W107 Warning No XML library support was found. The GNUstep uses XML for many basic functions, such as reading/writing property lists. XML will automatically be disabled, but this is probably not what you want. If possible you should stop installation and install an xml library. -------------------------------------------------------------- W125 Warning The OpenSSL package (libcrypto, etc) is needed to access https connections with NSURL and for other purposes. This package is optional so you are not required to install it. -------------------------------------------------------------- E150 Error You do not have the GNU Objective-C compiler installed Check to make sure you have a full installation of the GCC compiler that includes the Objective-C headers and libraries -------------------------------------------------------------- W272 Warning You do not have a recent version of the libobjc library. Startup will install one. -------------------------------------------------------------- E281 Error I don't seem to be able to use your Objective-C compiler to produce working binaries! Please check your Objective-C compiler installation. For gcc-3.0.x make sure that your compiler's libgcc_s and libobjc can be found by the dynamic linker - usually that requires you to add the directory given by gcc -print-file-name=libobjc.so to your LD_LIBRARY_PATH or /etc/ld.so.conf. However: 1. I do have libxml2 and libxml2-dev 2. I do lhave libopenssl and its dev package as well 3. Scrolling up, I can see that the configure invoked by this script did try to use clang. For instance: checking for library combo... gnu-gnu-gnu checking for prefix... checking for gcc... clang checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether clang accepts -g... yes checking for clang option to accept ISO C89... none needed checking how to run the C preprocessor... clang -E configure: Configuring on linux-gnu checking compiler version... gcc major version is 4 checking for apple compiler... no checking for ar... ar checking for ld... ld checking for dlltool... no checking for gawk... no checking for awk... awk checking for patch... patch checking for ranlib... ranlib checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking for whoami... /usr/bin/whoami checking for gmake... no checking for make... make checking make version > 3.75... yes GNU Make 3.81 checking broken make... ok checking binutils version > 2.9... yes GNU ld (GNU Binutils for Ubuntu) 2.22 checking iconv version > 2.1... yes 2.15 checking iconv support... yes, in libc checking for xml2-config... /usr/bin/xml2-config checking for libxml - version >= 2.3.0... no *** Could not run libxml test program, checking why... checking the Objective-C runtime... GNU It also says it is going to try to use the GNU version of the objective-C runtime. So I suspect that he can't locate the newer one I gave even though I added it in ldconfig: address@hidden:/usr/local/src/gnustep-startup-0.28.0# ldconfig -p|grep objc libobjcxx.so.4.6.0 (libc6) => /usr/local/lib/libobjcxx.so.4.6.0 libobjcxx.so.4.6 (libc6) => /usr/local/lib/libobjcxx.so.4.6 libobjcxx.so.4 (libc6) => /usr/local/lib/libobjcxx.so.4 libobjcxx.so (libc6) => /usr/local/lib/libobjcxx.so libobjc.so.4.6.0 (libc6) => /usr/local/lib/libobjc.so.4.6.0 libobjc.so.4.6 (libc6) => /usr/local/lib/libobjc.so.4.6 libobjc.so.4 (libc6) => /usr/local/lib/libobjc.so.4 libobjc.so (libc6) => /usr/local/lib/libobjc.so So it is present. I checked the header and: address@hidden:/usr/local/src/gnustep-startup-0.28.0/build# updatedb address@hidden:/usr/local/src/gnustep-startup-0.28.0/build# locate objc.h /usr/local/include/objc/objc.h /usr/local/src/libobjc2-1.6/objc/objc.h Namely, there is only one objc.h (the good one) Looking inside the log, I see: configure:6154: checking whether objc has thread support configure:6186: clang -o conftest -g -O2 -x objective-c -I/usr/local/src/gnustep-startup-0.28.0 -fgnu-runtime conftest.c -lobjc -lpthread >&5 In file included from conftest.c:14: /usr/local/src/gnustep-startup-0.28.0/config/config_thread.m:5:10: fatal error: 'objc/NXConstStr.h' file not found #include <objc/NXConstStr.h> ^ 1 error generated. configure:6186: $? = 1 configure: program exited with status 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "GNUstep Setup" | #define PACKAGE_TARNAME "gnustep-setup" | #define PACKAGE_VERSION "0.20.0" | #define PACKAGE_STRING "GNUstep Setup 0.20.0" | #define PACKAGE_BUGREPORT "address@hidden" | #define PACKAGE_URL "" | #define HAVE_ICONV 1 | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_OBJC_OBJC_H 1 | #define HAVE_CALLBACK_H 1 | /* end confdefs.h. */ | #include "/usr/local/src/gnustep-startup-0.28.0/config/config_thread.m" configure:6348: result: no and /usr/local/include/objc does not contain anything named NXConstStr.h address@hidden:/usr/local/src/gnustep-startup-0.28.0/build# ls /usr/local/include/objc/ Availability.h capabilities.h encoding.h objc-api.h objc-auto.h Object.h runtime-deprecated.h slot.h blocks_runtime.h developer.h hooks.h objc-arc.h objc.h Protocol.h runtime.h toydispatch.h So... what is going on ? is the configure picking the wrong runtime? Any hint at how to diagnose this? Thanks again! (Aside on the XML / openssl issue) (For XML: I have libxml2 installed (including dev package of course). The configuration fails though with this in the log for libxml2: configure:4208: checking for xml2-config configure:4226: found /usr/bin/xml2-config configure:4239: result: /usr/bin/xml2-config configure:4293: checking for libxml - version >= 2.3.0 configure:4472: gcc -o conftest -g -O2 -I/usr/include/libxml2 conftest.c /i386-linux-gnu -lxml2 >&5 gcc: error: /i386-linux-gnu: No such file or directory The compilation command constructed is clearly incorrect. Then I have a second error related to openssl: configure:4989: gcc -o conftest -g -O2 conftest.c -lsocket -lcrypto >&5 /usr/bin/ld: cannot find -lsocket There is no socket lib. sockets are part of libc no? ) On May 17, 2012, at 11:09 PM, Eric Wasylishen wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |