Thursday, May 16, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 5566  / 2 Years ago, mon, august 1, 2022, 1:06:27

I had problem when compiling 32-bit ELF inside 64-bit Ubuntu. This is error message produced by GCC compiler :



cheap-laptop@my-machine:~/DEV-DIR$ gcc -m32 test.c -o test
In file included from /usr/include/stdio.h:27:0,
from test.c:1:
/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
# include <sys/cdefs.h>
^
compilation terminated.


I searched Google for this problem and found that libc6-dev-i386 must be installed first.



I installed it and had no luck, and same error still occurred. So I had Google again and found this link.



It suggested to remove purge libc6-dev and install it back using apt-get. Then, some message appeared and it look like this :-



cheap-laptop@my-machine:~/DEV-DIR$ sudo apt-get purge libc6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gir1.2-gee-0.8 gir1.2-gtk-2.0 icu-devtools libboost-atomic1.54.0
libboost-chrono1.54.0 libboost-context1.54.0 libboost-filesystem1.54.0
libboost-graph-parallel1.54.0 libboost-graph1.54.0 libboost-iostreams1.54.0
libboost-locale1.54.0 libboost-log1.54.0 libboost-math1.54.0
libboost-mpi-python1.54.0 libboost-mpi1.54.0 libboost-program-options1.54.0
libboost-python1.54.0 libboost-random1.54.0 libboost-regex1.54.0
libboost-serialization1.54.0 libboost-signals1.54.0 libboost-test1.54.0
libboost-thread1.54.0 libboost-timer1.54.0 libboost-tools-dev
libboost-wave1.54.0 libboost1.54-tools-dev libcairo-script-interpreter2
libdbus-1-dev libgnutlsxx27 libgpg-error-dev libgssrpc4 libharfbuzz-dev
libharfbuzz-gobject0 libibverbs-dev libice-dev libidn11-dev
libkadm5clnt-mit9 libkadm5srv-mit9 libkdb5-7 libp11-kit-dev libpcrecpp0
libpixman-1-dev libpthread-stubs0-dev libsm-dev libssl-doc libtasn1-6-dev
libtinfo-dev libvala-0.22-0 libx11-dev libxau-dev libxcb-render0-dev
libxcb-shm0-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev
libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev
libxml2-utils libxrandr-dev libxrender-dev mpi-default-bin valac-0.22-vapi
x11proto-composite-dev x11proto-randr-dev x11proto-render-dev
x11proto-xinerama-dev
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
comerr-dev* gcc-4.9-multilib* gcc-multilib* krb5-multidev* libatk1.0-dev*
libboost-all-dev* libboost-atomic-dev* libboost-atomic1.54-dev*
libboost-chrono-dev* libboost-chrono1.54-dev* libboost-context-dev*
libboost-context1.54-dev* libboost-coroutine-dev*
libboost-coroutine1.54-dev* libboost-date-time-dev*
libboost-date-time1.54-dev* libboost-dev* libboost-exception-dev*
libboost-exception1.54-dev* libboost-filesystem-dev*
libboost-filesystem1.54-dev* libboost-graph-dev*
libboost-graph-parallel-dev* libboost-graph-parallel1.54-dev*
libboost-graph1.54-dev* libboost-iostreams-dev* libboost-iostreams1.54-dev*
libboost-locale-dev* libboost-locale1.54-dev* libboost-log-dev*
libboost-log1.54-dev* libboost-math-dev* libboost-math1.54-dev*
libboost-mpi-dev* libboost-mpi-python-dev* libboost-mpi-python1.54-dev*
libboost-mpi1.54-dev* libboost-program-options-dev*
libboost-program-options1.54-dev* libboost-python-dev*
libboost-python1.54-dev* libboost-random-dev* libboost-random1.54-dev*
libboost-regex-dev* libboost-regex1.54-dev* libboost-serialization-dev*
libboost-serialization1.54-dev* libboost-signals-dev*
libboost-signals1.54-dev* libboost-system-dev* libboost-system1.54-dev*
libboost-test-dev* libboost-test1.54-dev* libboost-thread-dev*
libboost-thread1.54-dev* libboost-timer-dev* libboost-timer1.54-dev*
libboost-wave-dev* libboost-wave1.54-dev* libboost1.54-dev* libc6-dev*
libc6-dev-i386* libc6-dev-x32* libcairo2-dev* libcurl4-openssl-dev*
libdbus-glib-1-dev* libdbusmenu-glib-dev* libdee-dev* libexpat1-dev*
libfontconfig1-dev* libfreetype6-dev* libgcrypt11-dev* libgdk-pixbuf2.0-dev*
libgee-0.8-dev* libglib2.0-dev* libgnutls-dev* libgpgme11-dev*
libgtk2.0-dev* libhwloc-dev* libicu-dev* libkrb5-dev* libncurses5-dev*
libncursesw5-dev* libnotify-dev* libopenmpi-dev* libpango1.0-dev*
libpcap-dev* libpcap0.8-dev* libpci-dev* libpcre3-dev* libpng12-dev*
libpython-dev* libpython2.7-dev* librtmp-dev* libsqlite3-dev* libssh-dev*
libssh2-1-dev* libssl-dev* libstdc++-4.8-dev* libunity-dev* libxft-dev*
mpi-default-dev* nvidia-331* python2.7-dev* uuid-dev* valac-0.22*
zlib1g-dev*
0 upgraded, 0 newly installed, 107 to remove and 0 not upgraded.
After this operation, 506 MB disk space will be freed.
Do you want to continue? [Y/n]


It want to remove important packages such as libboost-*, nvidia-331* and others. Why this is happening?


More From » apt

 Answers
6

After searching for some minutes, I found this answer inside Stack Overflow site.



So the solution for my problem is, just use install --reinstall [package-name] argument when running apt-get, it will just reinstall you desired package without purging and downloading it back, so here is full command that solved my problem :



sudo apt-get install --reinstall libc6-dev-i386


[#22184] Tuesday, August 2, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
feeous

Total Points: 102
Total Questions: 122
Total Answers: 119

Location: Netherlands
Member since Thu, Jul 1, 2021
3 Years ago
;