GNU Prolog (glpc): error trying to execute as: No such file or directory - linux

I'm trying to use the GNU Prolog Compiler to build an executable from my Prolog program like so:
$ gplc solution.prolog -o prog
and it's failing with a really cryptic error:
error trying to execute as: No such file or directory
I can't figure out what it's trying to tell me is missing. Does anyone know?
I'm using Fedora Silverblue 37, and glpc is running inside of a 'toolbox' that is also Fedora 37.

The issue appears to have been that I didn't have a C compiler installed. I installed the gcc package, and got a different error:
gcc: fatal error: cannot read spec file ‘/usr/lib/rpm/redhat/redhat-hardened-ld’: No such file or directory
Apparently to get that file, I needed to install the redhat-rpm-config package. I found that package name from this relevant comment on the RedHat bugzilla.
Compilation succeeds now!

Related

fatal error: pthread.h: No such file or directory

I'm using macbook and terminal compiling gcc version 4.8.1. I solve some problem like:
fatal error ~~~~ No such file or directory
by adding such files in compile path myself. As far, those error was resolved by finding in finder application and add in root directory /usr/local/include/c++/4.8.1 myself.
But pthread.h does not exist at all my computer.
How can I get that header file?
Use this command:
gcc -I/usr/local/include/c++/4.8.1/... myfile.c -o myfile
-I indicate gcc to take include file from this specified path.

Undefined reference under WinMain#16 in cygwin

i am new to stackflow and i previously i have no background in computer system and programming. However, now i need to run analysis under cygwin for my bioinformatics project. I encounter some error when i try to compile a file name 'zone_b.linux'using cygwin, to produce an executable program. The linux file is download from web https://github.com/haddocking/HADDOCK-binding-sites-tutorial/blob/master/ana_scripts/zone_b.linux. When i try to compile using the following command under cygwin it produce the following error:
$ gcc zone_b.linux
/usr/lib/gcc/i686-pc-cygwin/6.4.0/../../../libcygwin.a(libcmain.o): In
function `main':
/usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/lib/libcmain.c:37: undefined
reference to `WinMain#16'
collect2: error: ld returned 1 exit status
Error description
I search the following error under stackoverflow, and i found two post with similar problem.
First is the post from undefined reference to `WinMain#16'. It stated that the problem is due the Microsoft'linker uses a runtime library entry point(winMainCRTStartup) that calls Microsoft's non-standard WinMain instead of standard main. So, i try the post's suggestion of including the entry by following command
$ gcc zone_b.linux /entry:winMainCRTStartup
gcc: error: /entry:winMainCRTStartup: No such file or directory
However i get the error no such file or directory. I think maybe it is because i am running under cygwin not mingW.
Second post is the Undefined reference to WinMain in Cygwin. From the post, it said use -c compile flag to only produce object file. However, for my case, i am not using any -c. Therefore, i think it is not relevant to my issue.
I would appreciate if anyone could kindly explain to me since i am new to this computing area. Thank you.
zone_b.linux is the compiled and linked executable program to run on a linux machine. It is a 32-bit ELF binary file. It will not work on a Windows machine, even using cygwin or mingw32, without re-compulation.
You probably have to compile zone_b.f, a FORTRAN source file, using the gfortran compiler to create a zone_b.exe that is usable in cygwin. I saw no instructions for this, but try something like gcc zone_b.f and cross fingers. Be sure gfortran is installed using cygwin setup.
You will also need to (re-)build the other executables (cluster_struc and contact) by performing make in the ana_scripts directory. Any supplied executables (from the git clone ... or a downloaded .zip file) will not work under cygwin.
You will need to have perl and python installed. I think perl is installed by default. You can install python2 using cygwin setup. The python script looked like it will work with python2 or python3, whichever is the default. On cygwin, today, python2 is the default python. I don't do perl, so cross your fingers.

Installing erlang from tar resulting in errors, wondering how to specify folders

I had the inspiration to start messing around with Erlang and I am having problems installing it... I am using Linux Mint 16 (petra). I installed the dependencies, and then downloaded otp_src_17.1.tar.gz and ran 'tar -zxf otp_src_17.1.tar.gz' I then ran ./configure which gave me some errors that made it impossible to run make.
These are the errors I'm getting (actually what I did was I did ./configure > configure.txt to get all the lines it prints as it configures, and it conveniently still printed to the console everything that has errors - neat)
configure: WARNING: No odbc library found skipping odbc
configure: WARNING: "ODBC library - header check failed"
configure: WARNING: "ODBC library - link check failed"
rm: remove write-protected regular file './CONF_INFO'?
configure: WARNING: No GLU headers found, wx will NOT be usable
/home/core/Desktop/otp_src_17.1/lib/wx/./configure: line 5195: wx-config: command not found
/home/core/Desktop/otp_src_17.1/lib/wx/./configure: line 5893: ./CONF_INFO: Permission denied
configure: WARNING:
wxWidgets must be installed on your system.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' or 'wx-config --static --libs' command)
is in LD_LIBRARY_PATH or equivalent variable and
wxWidgets version is 2.8.4 or above.
rm: remove write-protected regular file 'doc/CONF_INFO'?
/home/core/Desktop/otp_src_17.1/erts/configure: line 6466: doc/CONF_INFO: Permission denied
configure: WARNING: No 'xsltproc' command found: the documentation cannot be built
/home/core/Desktop/otp_src_17.1/erts/configure: line 6513: doc/CONF_INFO: Permission denied
configure: WARNING: No 'fop' command found: going to generate placeholder PDF files
configure: error: No curses library functions found
configure: error: /bin/bash '/home/core/Desktop/otp_src_17.1/erts/configure' failed for erts
The thing is - I know that I have the ncurses library, as evidenced by the fact that when I do "sudo apt-get install ncurses-base ncurses-bin" it says:
Reading package lists... Done
Building dependency tree
Reading state information... Done
ncurses-base is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
When I run "locate ncurses" it gives me the following:
/lib/i386-linux-gnu/libncurses.so.5
/lib/i386-linux-gnu/libncurses.so.5.9
/lib/x86_64-linux-gnu/libncurses.so.5
/lib/x86_64-linux-gnu/libncurses.so.5.9
/lib/x86_64-linux-gnu/libncursesw.so.5
/lib/x86_64-linux-gnu/libncursesw.so.5.9
/usr/bin/ncurses5-config
/usr/bin/ncursesw5-config
/usr/lib/vlc/plugins/gui/libncurses_plugin.so
/usr/share/doc/libncurses5
/usr/share/doc/libncursesw5
/usr/share/doc/ncurses-base
/usr/share/doc/ncurses-bin
/usr/share/doc/ncurses-base/changelog.Debian.gz
/usr/share/doc/ncurses-base/copyright
/usr/share/doc/ncurses-bin/FAQ
/usr/share/doc/ncurses-bin/changelog.Debian.gz
/usr/share/doc/ncurses-bin/copyright
/usr/share/lintian/overrides/ncurses-base
/usr/share/man/man1/ncurses5-config.1.gz
/usr/share/man/man1/ncursesw5-config.1.gz
/var/cache/apt/archives/libncurses5_5.9+20130608-1ubuntu1_i386.deb
/var/lib/dpkg/info/libncurses5:amd64.list
/var/lib/dpkg/info/libncurses5:amd64.md5sums
/var/lib/dpkg/info/libncurses5:amd64.postinst
/var/lib/dpkg/info/libncurses5:amd64.postrm
/var/lib/dpkg/info/libncurses5:amd64.shlibs
/var/lib/dpkg/info/libncurses5:amd64.symbols
/var/lib/dpkg/info/libncurses5:i386.list
/var/lib/dpkg/info/libncurses5:i386.md5sums
/var/lib/dpkg/info/libncurses5:i386.postinst
/var/lib/dpkg/info/libncurses5:i386.postrm
/var/lib/dpkg/info/libncurses5:i386.shlibs
/var/lib/dpkg/info/libncurses5:i386.symbols
/var/lib/dpkg/info/libncursesw5:amd64.list
/var/lib/dpkg/info/libncursesw5:amd64.md5sums
/var/lib/dpkg/info/libncursesw5:amd64.postinst
/var/lib/dpkg/info/libncursesw5:amd64.postrm
/var/lib/dpkg/info/libncursesw5:amd64.shlibs
/var/lib/dpkg/info/libncursesw5:amd64.symbols
/var/lib/dpkg/info/ncurses-base.conffiles
/var/lib/dpkg/info/ncurses-base.list
/var/lib/dpkg/info/ncurses-base.md5sums
/var/lib/dpkg/info/ncurses-bin.list
/var/lib/dpkg/info/ncurses-bin.md5sums
I am at a loss as to where to proceed. Thanks for any help
I believe you need to install ncurses-dev
'sudo yum install ncurses-devel.x86_64' prior to running ./configure worked just fine for me. Fedora 21 x64, btw.
After I extracted the tar, the documentation was in '/opt_src_{version}/HOWTO/INSTALL.md. The contents of which states:
Required Utilities
These are the tools you need in order to unpack and build Erlang/OTP.
WARNING: Please have a look at the [Known platform issues][] chapter
before you start.
Unpacking
GNU unzip, or a modern uncompress.
A TAR program that understands the GNU TAR format for long filenames.
Building
GNU make
Compiler -- GNU C Compiler, gcc or the C compiler frontend for LLVM, clang.
Perl 5
GNU m4 -- If HiPE (native code) support is enabled. HiPE can be
disabled using --disable-hipe
ncurses, termcap, or termlib -- The development headers and
libraries are needed, often known as ncurses-devel. Use
--without-termcap to build without any of these libraries. Note that
in this case only the old shell (without any line editing) can be used.
sed -- Stream Editor for basic text transformation.
ncurses just happened to be the only required package I didn't have installed on this development VM. So your mileage may vary.
This was the output of 'locate ncurses' after I installed the ncurses lib:
/usr/lib64/libncurses++.so.5
/usr/lib64/libncurses++.so.5.9
/usr/lib64/libncurses++w.so.5
/usr/lib64/libncurses++w.so.5.9
/usr/lib64/libncurses.so.5
/usr/lib64/libncurses.so.5.9
/usr/lib64/libncursesw.so.5
/usr/lib64/libncursesw.so.5.9
/usr/share/doc/ncurses
/usr/share/doc/ncurses-base
/usr/share/doc/ncurses/ANNOUNCE
/usr/share/doc/ncurses/AUTHORS
/usr/share/doc/ncurses/NEWS.bz2
/usr/share/doc/ncurses/README
/usr/share/doc/ncurses/TO-DO
/usr/share/doc/ncurses-base/README
/usr/share/licenses/ncurses-base
/usr/share/licenses/ncurses-base/COPYING
So I'd say the OP had a corrupt / bad ncurses install. I'm just posting this here because this was the #1 Google result I got when I was too lazy to RTFD.
One alternative is using the option "--without-termcap"
otp_src_18.0/configure file says:
--without-termcap do not use any termcap libraries
(ncurses,curses,termcap,termlib)
./configure --prefix=/home/username/erlang/18.0 --without-termcap
Set your PATH variable as shown below.
export PATH=$PATH=/home/username/erlang/18.0/bin
Not sure about implications though. :)
Hope this helps someone.

gcc does not find files that are on the search path

I'm using software on Linux Ubuntu 14.04 64bit that uses gcc. I get errors about files or programs not being found like these:
cc: error trying to exec 'cc1': execvp: No such file or directory
or
fatal error: stddef.h: No such file or directory
However, when I do
gcc -print-search-dirs
I get many paths, and cc1 is on the first path in that list (/usr/lib/gcc/x86_64-linux-gnu/4.8/). I do not understand this.
Then I created a link to cc1 as follows (in /usr/bin):
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.8/cc1 cc1
Now the first error disappears, but I get the second error. Strange again, because I have this file /usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h which is again on the gcc search path.`
I'm not an expert in gcc at all, but this makes no sense to me. Thanks for your help.

libnl-3 includes broken?

I am trying to use libnl 3 (http://www.infradead.org/~tgr/libnl/) under Ubuntu to use netlink in order to get some information from the IPv6 Neighbour Cache.
I am including a bunch of headers for this lib, but gcc already fails for the first one:
#include <libnl3/netlink/netlink.h>
There is no "main header", like libnl.h.
>$ gcc netlink_test.c
In file included from netlink_test.c:11:0:
/usr/include/libnl3/netlink/netlink.h:24:36: fatal error: netlink/netlink-compat.h: No such file or directory
compilation terminated.
The file netlink.h includes "netlink/netlink-compat.h". Unfortunately, there is no "/usr/include/netlink/" folder. There is only "/usr/include/libnl3/netlink/"
Including "netlink/netlink.h" thus gives me:
netlink_test.c:10:29: fatal error: netlink/netlink.h: No such file or directory
compilation terminated.
I have installed the following packages under Ubuntu 12.04:
libnl-3-200
libnl-3-200-dbg
libnl-3-dev
libnl-3-doc
libnl-genl-3-200
libnl-genl-3-200-dev
libnl-route-3-200
libnl-route-3-200-dev
Am I missing here something or is this genuinely broken?
OK, so the package is not broken, I am ;)
A short while ago, they introduced a mechanism to enable users to install different versions of this library.
Now you can configure it using "pkg-config" or just pass the precise directory to the compiler with "-I /usr/include/libnl3/".
And it works.

Resources