GNUstep - fatal error: 'objc/objc.h' file not found on Ubuntu 20.04 - objective-c

I have the following problem:
I am on Ubuntu 20.04 and I am trying to set up GNUstep which is required for certain source binaries I want to build
(for the sake of completion, the program I want to build is called Advanced Rendering Toollḱit, information can be found here: https://cgg.mff.cuni.cz/ART/).
When building with the clang-9 compiler, after invoking the make command, I receive this error message:
fatal error: 'objc/objc.h' file not found
I should mention that I am still fairly new to Linux in general. What I did was installing GNUstep via
sudo apt-get install gnustep gnustep-devel
as advised on the website (http://wiki.gnustep.org/index.php/GNUstep_under_Ubuntu_Linux). It resulted in receiving the mentioned error.
/usr/include/GNUstep/Foundation/Foundation.h:31:9: fatal error: 'objc/objc.h' file not found
The next thing I tried was to download the provided configuration scripts from the same webpage and execute them. When I did, I received the following feedback:
checking whether objc really works... no. I don't seem to be able to use your Objective-C compiler to produce
working binaries! Please check your Objective-C compiler installation.
If you are using gcc-3.x make sure that your compiler's libgcc_s and libobjc
can be found by the dynamic linker - usually that requires you to play
with LD_LIBRARY_PATH or /etc/ld.so.conf.
Please refer to your compiler installation instructions for more help.
configure: error: The Objective-C compiler does not work or is not installed properly.
Maybe I am getting something wrong, however, my whole intention of installing GNUstep is to make Objective-C programming possible on a non-Apple machine. Therefore I do not understand why it is complaining about a non-working Objective-C compiler (by the way, I end up with the same result when using gcc and g++ as compilers).
I did do some research and I came across some StackOverflow posts, suggesting me to install libobjc2, but I suspect this to be depreciated with Ubuntu 20.04.
I honestly don't know what's wrong and I highly appreciate a little push in the right direction! Many thanks in advance for helping me!

Although I cannot tell what exactly the bug was in my case, I got some external help and together we came up with a solution that worked for me.
For debugging purposes, we created a test user account in my Ubuntu environment and repeated the whole process. It worked flawlessly.
We concluded that something must have been wrong locally with regard to my user account. I am sure there was something wrong with my environment variables, although I failed to clearly identify the bug (I am a Linux beginner). I chose the easy way out, backed up important files, deleted and re-created my root user account and then it worked. I hope, this may help any other who has the same problem.
#skaak, thank you for your help and suggestions!

As people are pointing, if you want to use clang to compile objective C programs in Ubuntu you have to install libobjc2 (mainstream project here) but it's currently not packaged in Ubuntu. It's possible that there was a package with the same or similar name, as you found out, but that was a different thing. This manual installation worked for me:
wget https://github.com/gnustep/libobjc2/archive/v2.0.tar.gz
tar xvzf v2.0.tar.gz
cd libobjc2-2.0
mkdir build
cd build
export CC=`which clang`
export CXX=`which clang++`
cmake ..
make
sudo make install

Related

Unable to run kotlinc-native command

I'm trying to run the Kotlin/Native Hello Program
but the terminal says the command kotlin-native cannot be found. I'm on a MacBook, using zsh (get same error when I use bash) and installed Kotlin via Homebrew before, so kotlin and it's compiler works on my machine, the kotlinc command works just fine. I'm trying to use the compiler instead of gradle for now. Is there a different command I'm supposed to be using?
It sound like you may have had a similar problem to me. Installing kotlin-native via homebrew did not install the kotlinc-native command.
To get the command working, I had to do the following:
Go to https://github.com/JetBrains/kotlin/releases and get the latest version of Kotlin
Extract it to .kotlin in the home directory
Add export PATH="$HOME/.kotlin/bin:$PATH" to .zshrc
The problem with this method is that it's completely disconnected from Homebrew. You will have to run the steps again every time you want to update Kotlin.
You've typed kotlin-native but the tutorial says kotlinc-native, which is the actual name of the process file.
If kotlinc works then you might just have a typeo.
I don't use these processes directly, but I'm somewhat familiar with them. My guess is check the name.

Install v4l2loopback in WSL2

I am currently struggling with v4l2loopback installation on WSL2.
Some context:
Recently, I have read about create a virtual video device in Linux and then mock its output from an image or video file.
This is quite important for testing or developing purposes, for example in order to attach a virtual webcam that reproduces a video file as a loop to the android emulator.
After some research I got to the conclusion I don't want to use desktop applications and it might be easy to run even in a CI or similar, therefore v4l2loopback looks nice, but I am currently a Windows user.
I enabled WSL2 on my machine, downloaded the repo, and tried to execute make command like in the repo description.
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/angel/v4l2loopback modules
make[1]: *** /lib/modules/4.19.84-microsoft-standard/build: No such file or directory. Stop.
make: *** [Makefile:43: v4l2loopback.ko] Error 2
I googled a little bit and i found that issue on GitHub where a similar output (for another tool) is mentioned.
There, someone mentioned that WSL2 Kernel Config can be adjusted in order to add more modules ( maybe and hopefully one of them could make work v4l2-loopback 😂 or at least that I think).
I also googled in order to check out custom WSL builds but I am not really sure what I need to make it work or even if I am going in the right direction.
Is there something I 've missed in order to make v4l2loopback work?
In the case only a custom WSL2 build would work, how should I proceed?
Thanks in advance 🤘
I am not familiar with WSL...
-- Ah, it appears WSL doesn't have a linux kernel at all: see
https://unix.stackexchange.com/questions/594470/wsl-2-does-not-have-lib-modules .
So it's useless building the v4l2loopback mod; even if you'd be able to build it, there's nothing, no kernel, to load it!
Maybe an alternative for you might be running Virtualbox (it's free, and available for Windows) on your windows machine, and load a real Linux distro of your own choice in it. Then build the v4l2loop module, after installing the kernel development headers, and install the mod (after building, as root do insmod v4l2loop.ko) and play with it.
Thus, you are on your way. Far more elegant, and far easier. Also will have you make an enormous and important climb on the 'getting familiar with Linux' ladder, as well as maybe familiarize yourself with a virtual machine(?).
I'd definitely go for that.

Cygwin & OCaml: OPAM + Batteries

I extensively use Cygwin on a Windows 8 environment (I do not want to go ahead and boot/load Linux directly on the machine). I use the OCamlIDE plug-in for Eclipse and have experienced relatively no problems using this workflow setup.
However, I would like to use Batteries so that I may make use of use of its dynamic arrays among a few other interesting features that will speed up my development process.
I have tried this method: http://ocaml.org/install.html, but I get the following error:
$ sh ./opam_installer.sh /usr/local/bin
No file yet for i686:CYGWIN_NT-6.2-WOW64
What am I missing and how would I configure Cygwin so that it can accept the Opam installer? When I tried yet a different way of building Opam, I got:
'i686-w64-mingw32-gcc' is not recognized as an internal or external command,
as a Makefile error and reason for building failure. It seems something is wrong related to mingw32-gcc, what do I need to install and/or configure for my Cygwin to get it to compile/build things properly. I have wget and curl installed as well.
My overall question: What is the best way to get Batteries installed on my system with the minimum of time spent tracing all of its dependencies by hand? Is there a way I can just build the library module, such as BatDynArray and the includes:
include BatEnum.Enumerable
include BatInterfaces.Mappable
That way I can just call them directly in my code with open...;; and/or include...;;;
OCaml works beautifully on Windows with WODI, which is a Cygwin-based distribution that includes Batteries and tons of other useful packages (which are a pain to install manually on Windows).
I urge you to take a shot at WODI, which I believe to be an indispensable tool for the
rest of us, the forgotten souls, who have to deal with Windows.
First of all, include does not do what you think it does. open Batteries should be exactly what you're looking for. OPAM is not yet solid on windows (maybe Thomas could give an update on where things stand).
Frankly, I would recommend to install a linux on a VM, you should be able to get started with OPAM instantly then. Otherwise, take a look at this package manager for OCaml which focuses on cross platform support: http://yypkg.forge.ocamlcore.org/. I've never tried it myself however. The last package manger you could try is GODI, I'm not sure about its windows support though.
Finally, if none of these options work then it should be possible to install batteries from the source. All you need is OCaml and make. And if there are problems with this approach then you should definitely follow up on them either here or on the bug tracker because batteries does intend to support windows AFAIK.

AIX apache rpm dependencies

I am evaluating the Crowd SSO by Atlassian. Now to get apache to use Crowd for authentication, there is a connector available by the vendor.
Problem
Unfortunately they do not provide anything for my OS (AIX). Instead they provide source code with instructions. Now the example here uses yum -y install autoconf automake gcc httpd-devel libcurl-devel libtool libxml2-devel mod_dav_svn subversion-devel to download the required packages for which there is no alternate in AIX (AFAIK).
So I went to the AIX toolbox and got some packages. For the rest, I took Mr Perzl's help. And while installing the rpms ended up getting dependency errors.
Question
Do I go with
The solution given here dependency hell.
IBM way
Something else which Google and my limited exposure to AIX are not telling me.
I am not *nix expert, rather at basic user level. And any installations are actually done by the admins. I need expert advice so as to get it right and efficiently if possible.
Appreciate if someone would like to retag this question for getting attention from the right people.
It has been a while since I struggled with AIX and Linux, and have success with the Crowd Connector on Linux. So, having taken a look at both links, I would say:
The IBM documentation is only for the packages supplied with their Toolbox and there is a risk that if you use it for other things, you may end up with a dead-end as the utilities may refuse to play ball.
With Mr. Perzl's way, you are building it brick by brick, with known certainty. The main risk is that the right versions may not be available and/or one of the build tools may not work. In that case, you may still have to tweak the source and/or the build/make files to compile properly, but it will eventually work.
Once you have a compiled plugin and it works with a certain version of Apache, you will not need many of the dependencies, so the instructions you give to the admins to deploy will be minimal. Most likely, the runtime dependencies will be mod_dav_svn, curl and libxml
Please post an update when you get it working.

Issues in using 3rd party libraries while developing Apache Modules

I am writing an Apache module for my internship. I am using C for this (I am not acquainted with Perl or Python that much).
I need to use an HTML Parser to solve the problem for which I am writing this module. I am considering libxml2 for this purpose.
I am confused how should I link the library in my module ? Should I link the library while compiling the module OR Should I use the LoadFile directive in the configuration file to load the library.
My main concern is that while I am developing this on Ubuntu, but I don't know what will be the OS running on the deployment server. So I want its deployment, complications free and successful.
EDIT: #Grim: thanks for replying :)
I compiled the module with the following commands:
apxs -I /usr/include/libxml2/ -c mod_xmltest.c
sudo apxs -n xmltest_module -i mod_xmltest.la
I believe this does not link the libraries in the module, I was getting "Unresolved Symbols" error when starting the server, so I used the LoadFile directive to load libxml2 library. It seems to work.
Do you think there can be any issues this way? I think this makes my module more portable, as on the deployment server the admin can explicitly specify the location of the libxml2 library.
You should link the library while compiling your module.
There are of course the usual portability issues (at least then it comes to a non-posix OS). In this case some of them are solved by apxc. It's impossible to say which complications that might occur, but nothing of what you describe should cause any.