I am trying to build a "libgnustep-base.a" file in 64bit so I can possibly compile Objective-c code in cygwin86_64 using gcc, in the "gnustep-base-1.26.0" folder there is a make file that only includes this string "@echo You need to use GNU make to compile the GNUstep Base Library", well firstly I found this pretty unconventional and odd, there's also the folder named "gnustep-make-2.7.0", the manual says that this is the first build that needs to be done, I've gone thru the "./configure--->make---->make install", this actually does nothing but extremely long scans of C include files to check if some very usual function (e.g printf) exists.
1 Answer
for what I see you need first to download, configure and install in /usr/local
the gnustep-make
package.
Of course you need to install the gcc-objc
, make
and some other packages
$ wget https://github.com/gnustep/tools-make/releases/download/make-2_8_0/gnustep-make-2.8.0.tar.gz
$ tar -xf gnustep-make-2.8.0.tar.gz
$ cd gnustep-make-2.8.0
$ ./configure LDFLAGS="-Wl,--allow-multiple-definition"
$ make install
$ cd ..
than you can do the same with the base
$ wget https://github.com/gnustep/libs-base/releases/download/base-1_27_0/gnustep-base-1.27.0.tar.gz
$ tar -xf gnustep-base-1.27.0.tar.gz
$ cd gnustep-base-1.27.0
$ ./configure LDFLAGS="-Wl,--allow-multiple-definition"
add to Source/common.h
the
#define TRUE 1
#define FALSE 1
and then
$ make
unfortunately the build will fail later at linking stage for
relocation truncated to fit: R_X86_64_PC32 against undefined symbol `object_getRetainCount_np'
At first glance it seems that portion is part of libobjc2
https://github.com/gnustep/libobjc2/releases/tag/v2.1
that does not like to be built with gcc
and ask for clang
.
For what I see Cygwin clang has not the objC
portion, but I could be wrong.
-
I have installed "gcc-objc", "gcc-objc" installs a small objective-c runtime : gcc.gnu.org/onlinedocs/gcc/Objective-C.html, which includes a few files (.h, .a) to build something like the main objective-c abstraction (gcc.gnu.org/onlinedocs/gcc/…) when I compile my code I get "ld" errors (gcc linker) like : undefined reference to `NSLog', to me this is because I don't have the "libgnustep-base.a",– Manul667Feb 7, 2021 at 23:11
-
I found "libgnustep-base.a" on GNUstep installer for Windows (MSYS/MinGW System) which is old and crap (doesn't even include the gcc binary) but the lib is 32bit so won't work with gcc 64bit, I just downloaded Clang but it doesn't include any Objective-c library.– Manul667Feb 7, 2021 at 23:28