I have just installed Cygwin on my 64 bit Windows 10. I need sys/types.h, sys/socket.h and several other libraries. However, I can't find these files under the cygwin installation directory. Where can I get them?
Those are part of the cygwin-devel package:
$ apt-cyg listfiles cygwin-devel | egrep 'sys/(types|socket).h'
usr/include/sys/types.h
usr/include/sys/socket.h
Related
In short: how do I get Squeak 5 to run on x64 Linux?
I dont care whether the executable is 32 or 64 bit as long as it runs and opens the Squeak 5 image.
Here is what I tried:
When I try to run the executables from the Squeak 5 package i get: Running 32-bit Squeak on a 64-bit System. install-libs32 may install them - tried that. Wasn't found.
Then I went looking for a 64 bit executable. There are some from Squeak 4 but they can't open Squeak 5 images.
Looking through the Squeak 5 package:
The shell scripts squeak.sh in both these directories:
Squeak-5.0-All-in-One/
Squeak-5.0-All-in-One/Squeak-5.0-All-in-One.app/Contents/LinuxAndWindows/
Both return this error:
/usr/bin/ldd didn't produce any output and the system is 64 bit. You may need to (re)install the 32-bit libraries.
There are also misleading files named squeak (no .sh) in these directories:
Squeak-5.0-All-in-One/Squeak-5.0-All-in-One.app/Contents/LinuxAndWindows/Linux-i686
Squeak-5.0-All-in-One/Squeak-5.0-All-in-One.app/Contents/LinuxAndWindows/Linux-i686/bin
They are not the executable, just more shell scripts.
There is another squeak file in:
Squeak-5.0-All-in-One/Squeak-5.0-All-in-One.app/Contents/LinuxAndWindows/Linux-i686/lib/squeak/5.0-3397
Running ./squeak misleadingly says No such file or directory. It is misleading because the file does exist, it is just a 32-bit exe.
file squeak tells me: ELF 32-bit LSB executable, Intel 80386.
So how do I get it to run on 64-bit Linux? I could compile it myself but haven't tried assuming there are a lot of dependencies. Or has anyone tried it?
You already got all information you need:
You may need to (re)install the 32-bit libraries.
Squeak 5 is currently 32bit only. Hence, you need 32bit libraries.
It cannot use your 64bit libraries.
You may need thes:e packages (I use Debian/Ubuntu names, CentOS/RH/SuSE should be similar):
libc6:i386
libuuid1:i386
libkrb5-3:i386
libk5crypto3:i386
zlib1g:i386
libcomerr2:i386
libkrb5support0:i386
libkeyutils1:i386
libx11-6:i386
libgl1-mesa-glx:i386
libsm6:i386
libssl1.0.0:i386
(note the :i386 in the names)
This works in 64 bit Ubuntu 16.04:
In the directory where you unzipped the
Squeak-5.0-All-in-One.zip
archive, and that contains the squeak.sh file,
put the following into a file named libs32.sh :
#!/bin/bash
objdump -p ./Squeak-5.0-All-in-One.app/Contents/LinuxAndWindows/Linux-i686/lib/squeak/5.0-3397/*|
grep NEEDED|
awk '{print $2}'|
sort -u|
xargs dpkg -S|
awk '{print $1}'|
sort -u|
sed 's/:amd64:/:i386:/'|
sort -u|
sed 's/:$//'
Make that file executable:
chmod +x ./libs32.sh
Run it:
./libs32.sh
You will get a list of libraries that need to be installed.
Run
./lib32.sh | xargs sudo apt install
to see what would be installed.
Run
./lib32.sh | xargs sudo apt install -y
to install it.
I am using Linux Mint and I installed clang_complete using the makefile from Clang Complete, but it does not work. When I open a cpp file, there is an error message:
Loading libclang failed, completion won't be available. Consider setting g:clang_library_path
I already did some research on this topic and tried to find the libclang.so file to put g:clang_library_path= '...' into my vimrc, but I cannot find the file so I cannot define the path in my vimrc.
$ find / -name libclang -type f 2> /dev/null doesn't return anything.
How do I make clang_complete work?
You probably have libclang.so.1 in /usr/lib/x86_64-unknown-linux or somewhere similar. Make a symbolic link named as libclang.so in any of your library path would solve the problem (at least for me).
cd /usr/lib/x86_64-unknown-linux
ln -s libclang.so.1 libclang.so
You need to install libclang. On my Ubuntu system it is in the "libclang1" package. Clang compiler and libclang are in different packages.
I ran into this issue with Ubuntu 20.04.3 LTS:
Loading libclang failed, completion won't be available. Are you sure '/usr/lib/x86_64-linux-gnu/libclang-6.0.so.1' contains libclang?
I fixed it using:
Install libclang
sudo apt install clang
Add following in .vimrc to use latest installed libclang
let g:clang_library_path = '/usr/lib/x86_64-linux-gnu/libclang-10.so.1'
If needed, adjust "libclang-10.so.1" to use the clang version that was installed.
You should be good with Vim at this point.
In $clang_complete/plugin/libclang.py, there is a code like this:
debug = int(vim.eval("g:clang_debug")) == 1
So use let g:clang_debug=1 to enable clang debug.
For me, the error is:
/lib64/libstdc++.so.6: version 'GLIBCCC_3.x.xx' not found
Set LD_LIBRARY_PATH and PKG_CONFIG_PATH to a third libstdc++ will solve this.
While building gcc, I get this error:
In file included from /usr/include/bits/errno.h:25,
from /usr/include/errno.h:36,
from ../.././gcc/tsystem.h:96,
from ../.././gcc/crtstuff.c:68:
/usr/include/linux/errno.h:4:23: error: asm/errno.h: No such file or directory
make[2]: *** [crtbegin.o] Error 1
make[2]: Leaving directory `/opt/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc'
I am building gcc 4.1 from source. I think I have to install build-essential. However installing that package in ubuntu 12.04 will automatically download and install gcc 4.6 and I don't want that.
Is there any other way?
I think the package you want is linux-libc-dev . I encountered this when building 32-on-64; so I needed linux-libc-dev:i386 .
This worked for me:
ln -s /usr/include/asm-generic /usr/include/asm
This worked for me:
sudo ln -s /usr/include/asm-generic /usr/include/asm
The reason being that what GCC expects to be called /usr/include/asm is renamed to /usr/include/asm-generic in some distros.
This fixed it for me.
sudo apt-get install linux-libc-dev:i386
This solved it for me on Debian 10, even though I was compiling with an LLVM-based compiler:
sudo apt install gcc-multilib
/usr/include/asm/errno.h is part of the linux headers. I can't speak directly to Ubuntu 12.04, but in general you can download the linux sources as a package for your distro and it shouldn't require you to download/install gcc. Failing that, you can manually download the linux headers for the version of your kernel (uname -a) and use an include directive to CFLAGS to specify the directory to look for those.
Edit: sudo apt-get install linux-headers-generic may work for you.
You are missing part of the development packages. I don't know Ubuntu, but you should be able to ask it's package management system to install the package containing /usr/include/asm/errno.h.
Do not copy some file with a similar name from somewhere on your system (or, even worse, from somewhere else). Missing files might mean that some package is damaged; again, ask your package manager to check everything and (re)install missing/broken pieces.
Unless you are running some LTS release, upgrade. Your Ubuntu is some 2 years old, i.e., ancient.
While we are at this, why on this beautiful planet are you building such an ancient compiler? Current GCC is just released 4.9.0, anything before 4.7 is ancient history, not longer supported.
On Ubuntu 16.04 x86_64 you could try this:
ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/asm
This works on my server.
If you want to use errno.h that is in the asm file, simply go to /usr/(ctrl + l, type /usr/) and then search for errno.h and errno-base.h. Once you did find them, copy the code in these two files, and place them in your include folder. And be careful, in "errno.h" the file includes "errno-base.h" as:
#include <asm-generic/errno-base.h>
Either create a directory with the same name above or change the code above to something different which is suitable for you to use.
If you can find:
usr/include/asm-generic/errno.h
by executing:
find /usr/include -name errno.h
then try to execute:
cp --archive /usr/include/asm-generic /usr/include/asm
It may fix that problem.
I had this issue while compiling Asterisk 1.8.24.0 and solved it with:
mkdir /usr/include/asm-generic
cp /usr/include/asm/errno-base.h /usr/include/asm-generic/
Don't know if it is the "right way" but i've read the comments above and that gave me the idea... and it worked :)
rpmbuild generates RPM under which directory?
I checked the RPMS directory:-
[root#tom adil]# ls /usr/src/redhat/
BUILD RPMS SOURCES SPECS SRPMS
[root#tom adil]# ls /usr/src/redhat/RPMS/
athlon i386 i486 i586 i686 noarch
[root#tom adil]#
How to decide rpmbuild outputs in which of the above sub-directories?
Is it controlled by spec file? What is the default option?
I thought uname -p but its not the case probable uname -i is used.
Linked to my last question Difference between "machine hardware" and "hardware platform"
The binary package is named according to the %_build_name_fmt macro. By default this macro contains %{ARCH}/ at the beginning, so that is where the binary package is placed.
Following on from your last comment, by default the RPM will go into the subdirectory that matches the platform you're building on. You can override this by passing the --target parameter to rpmbuild, but this only applies where valid; for example, you can use --target i386 on an x86_64 system to build a 32-bit RPM, but you can't build a 64-bit RPM on a 32-bit platform.
The RPM goes to the RPMS folder and the source RPM to the SRPMS. This is not controlled by the spec file - this is convention. What exactly are you trying to do?
I need to determine which version of GTK+ is installed on Ubuntu
Man does not seem to help
This suggestion will tell you which minor version of 2.0 is installed. Different major versions will have different package names because they can co-exist on the system (in order to support applications built with older versions).
Even for development files, which normally would only let you have one version on the system, you can have a version of gtk 1.x and a version of gtk 2.0 on the same system (the include files are in directories called gtk-1.2 or gtk-2.0).
So in short there isn't a simple answer to "what version of GTK is on the system". But...
Try something like:
dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]'
to list all the libgtk packages, including -dev ones, that are on your system. dpkg -l will list all the packages that dpkg knows about, including ones that aren't currently installed, so I've used grep to list only ones that are installed (line starts with i).
Alternatively, and probably better if it's the version of the headers etc that you're interested in, use pkg-config:
pkg-config --modversion gtk+
will tell you what version of GTK 1.x development files are installed, and
pkg-config --modversion gtk+-2.0
will tell you what version of GTK 2.0. The old 1.x version also has its own gtk-config program that does the same thing. Similarly, for GTK+ 3:
pkg-config --modversion gtk+-3.0
This isn't so difficult.
Just check your gtk+ toolkit utilities version from terminal:
gtk-launch --version
get GTK3 version:
dpkg -s libgtk-3-0|grep '^Version'
or just version number
dpkg -s libgtk-3-0|grep '^Version' | cut -d' ' -f2-
You can use this command:
$ dpkg -s libgtk2.0-0|grep '^Version'
You could also just compile the following program and run it on your machine.
#include <gtk/gtk.h>
#include <glib/gprintf.h>
int main(int argc, char *argv[])
{
/* Initialize GTK */
gtk_init (&argc, &argv);
g_printf("%d.%d.%d\n", gtk_major_version, gtk_minor_version, gtk_micro_version);
return(0);
}
compile with ( assuming above source file is named version.c):
gcc version.c -o version `pkg-config --cflags --libs gtk+-2.0`
When you run this you will get some output. On my old embedded device I get the following:
[root#n00E04B3730DF n2]# ./version
2.10.4
[root#n00E04B3730DF n2]#
Try,
apt-cache policy libgtk2.0-0 libgtk-3-0
or,
dpkg -l libgtk2.0-0 libgtk-3-0
I think a distribution-independent way is:
gtk-config --version
You can also just open synaptic and search for libgtk, it will show you exactly which lib is installed.
Try:
dpkg-query -W libgtk-3-bin
Because apt-cache policy will list all the matches available, even if not installed, I would suggest using this command for a more manageable shortlist of GTK-related packages installed on your system:
apt list --installed libgtk*
This will get the version of the GTK libraries for GTK 2, 3, and 4.
dpkg -l | egrep "libgtk(2.0-0|-3-0|-4)"
As major versions are parallel installable, you may have several of them on your system, which is my case, so the above command returns this on my Ubuntu Trusty system:
ii libgtk-3-0:amd64 3.10.8-0ubuntu1.6 amd64 GTK+ graphical user interface library
ii libgtk2.0-0:amd64 2.24.23-0ubuntu1.4 amd64 GTK+ graphical user interface library
This means I have GTK+ 2.24.23 and 3.10.8 installed.
If what you want is the version of the development files, use:
pkg-config --modversion gtk+-2.0 for GTK 2
pkg-config --modversion gtk+-3.0 for GTK 3
pkg-config --modversion gtk4 for GTK 4
(This changed because the + from GTK+ was dropped a while ago.)
To make the answer more general than Ubuntu (I have Redhat):
gtk is usually installed under /usr, but possibly in other locations. This should be visible in environment variables. Check with
env | grep gtk
Then try to find where your gtk files are stored. For example, use locate and grep.
locate gtk | grep /usr/lib
In this way, I found /usr/lib64/gtk-2.0, which contains the subdirectory 2.10.0, which contains many .so library files. My conclusion is that I have gtk+ version 2.10. This is rather consistent with the rpm command on Redhat: rpm -qa | grep gtk2, so I think my conclusion is right.
To compile and link a GTK program with pkg-config, we need the library name instead of the actual version number. For example, the following command compiles and links a GTK program that uses the GTK4 library:
gcc -o program program.c `pkg-config --cflags --libs gtk`
To obtain the library name for GTK, use the following command:
pkg-config --list-all | grep gtk