18.04 gcc a simple c program - c

appear
functionTest01.c:1:19: fatal error: stdio.h: No such file or directory #include <stdio.h>
when i see friends suggestion。sudo apt-get install libc6-dev
appear
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libc6-dev : Depends: libc6 (= 2.23-0ubuntu11) but 2.27-3ubuntu1 is to be installed
Depends: libc-dev-bin (= 2.23-0ubuntu11)
E: Unable to correct problems, you have held broken packages.

Related

Why can't I install libc6-dev

I want to compile a c file, but an error occurs after entering the compile command.
~$ gcc helloworld.c -o helloworld
fatal error: stdio.h: No such file or directory
compilation terminated.
I installed libc6-dev according to the method on the Internet
~$ sudo apt install libc6-dev
Then this error appeared
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libc6-dev : Depends: libc6 (= 2.23-0ubuntu11.3) but 2.31-0ubuntu9.2 is to be installed
Depends: libc-dev-bin (= 2.23-0ubuntu11.3)
E: Unable to correct problems, you have held broken packages.
So I followed the method
sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
sudo apt-get update
Hit:1 http://archive.canonical.com/ubuntu xenial InRelease
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:5 http://archive.ubuntu.com/ubuntu xenial-security InRelease
Reading package lists... Done
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
ubuntu-advantage-tools
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
sudo apt-get -u dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
ubuntu-advantage-tools
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
sudo dpkg --configure -a
sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
sudo apt-get install libc6-i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libc6-i386 : Depends: libc6 (= 2.23-0ubuntu11.3) but 2.31-0ubuntu9.2 is to be installed
E: Unable to correct problems, you have held broken packages.
What should I do
I have debian, but I think this solution can help you. This is the new line I added to my /etc/apt/sources.list
deb http://ftp.it.debian.org/debian bullseye-updates main contrib non-free

ROS2 (ros-eloquent-desktop) - Ubuntu 18.04 - Unable to correct problems, you have held broken packages

I'm using Ubuntu 18.04 and I want to install ROS 2 from Robot Operating System.
I am following instructions given in Installing ROS 2 via Debian Packages.
Based on this page Eloquent Elusor is the latest version for ubuntu 18.04.
I did Setup Locale and Setup Sources with no error. But, in Install ROS 2 packages when I enter
sudo apt install ros-eloquent-desktop
I get the following:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ros-eloquent-desktop : Depends: ros-eloquent-depthimage-to-laserscan but it is not going to be installed
Depends: ros-eloquent-image-tools but it is not going to be installed
Depends: ros-eloquent-intra-process-demo but it is not going to be installed
Depends: ros-eloquent-pcl-conversions but it is not going to be installed
Depends: ros-eloquent-rqt-common-plugins but it is not going to be installed
Depends: ros-eloquent-rviz-default-plugins but it is not going to be installed
Depends: ros-eloquent-rviz2 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
What should I do?

Install ffmpeg-light with cabal

I want to install the ffmpeg-light library from hackage via cabal on Windows 10 (64 bit). So I downloaded ffmpeg and extracted it to C:\FFmpeg.
At first pkg-config was complaining that it could not find various packages. I solved this problem with .pc files.
When I tried to use the command: cabal install ffmpeg-light cabal complained about missing C-libraries, being exactly those for which I created the .pc files.
Then I tried the command: cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib. Now I have a different error message, which says:
Enums.hsc:7:32: fatal error: libavcodec/avcodec.h: No such file or directory
Edit:
Then I tried the following command:
cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib \
--extra-include-dirs=C:\FFmpeg\include
Now first the compiler gives some warnings about deprecated functions in ffmpeg and redundant imports in ffmpeg-light, but compiles 11 of 11. But the build is still not successfull.
In-place registering ffmpeg-light-0.11.1...
setup-Simple-Cabal-1.22.5.0-x86_64-windows-ghc-7.10.3.exe:
'C:\Haskell\bin\ghc-pkg.exe' exited with an error:
ffmpeg-light-0.11.1: Warning: haddock-interfaces:
C:\Users\HOLEYC~1\AppData\Local\Temp\cabal-tmp-2824\ffmpeg-light-0.11.1\dist\doc\html\ffmpeg-light\ffmpeg-light.haddock
doesn't exist or isn't a file
ffmpeg-light-0.11.1: Warning: haddock-html:
C:\Users\HOLEYC~1\AppData\Local\Temp\cabal-tmp-2824\ffmpeg-light-0.11.1\dist\doc\html\ffmpeg-light
doesn't exist or isn't a directory
ffmpeg-light-0.11.1: library-dirs: C:FFmpeglib is a relative path which makes
no sense (as there is nothing for it to be relative to). You can make paths
relative to the package database itself by using ${pkgroot}. (use --force to
override)
ffmpeg-light-0.11.1: include-dirs: C:FFmpeginclude is a relative path which
makes no sense (as there is nothing for it to be relative to). You can make
paths relative to the package database itself by using ${pkgroot}. (use
--force to override)
cabal: Error: some packages failed to install:
ffmpeg-light-0.11.1 failed during the building phase. The exception was:
ExitFailure 1
Some additional information:
cabal version: cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library
gcc version of my installed Haskell platform: 5.2.0
Example .pc file I used for pkg-config:
Name: libavcodec
Description: Library for ffmpeg
Version: 57
Cflags: -IC:\FFmpeg\include
Libs: -LC:\FFmpeg\lib -llibavcodec
OK. I figured it out. The --ghc-pkg-options="--force" option was needed.
cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib --extra-include-dirs=C:\FFmpeg\include --ghc-pkg-options="--force"

Installing glibtop on ubuntu

I'm new to ubuntu and i'm currently using it on windows 7 with vmware workstation.
I need to access the CPU usage with a C program on terminal, so i thought of using glibtop_get_cpu() function on glibtop library. I just wrote #include <glibtop.h> in my code and compiled it with "gcc" on terminal, and it said
fatal error: glibtop.h: No such file or directory
compilation terminated.
I tried to install the library using this:
sudo apt-get install liblib2.0-dev
but the terminal said:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libglib2.0-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
However the following packages replace it:
libglib2.0-0 libglib2.0-bin
E: Package 'libglib2.0-dev' has no installation candidate
any ideas about this?
You should install libgtop2-dev (sudo apt-get install libgtop2-dev).

Package path error when trying to install lib package in C

I am trying to install libpackedobjects on my fedora 17. The path that I am trying to install it on is home/libpackedobjects. The steps that I am following are:
git clone git://gitorious.org/libpackedobjectsd/libpackedobjectsd.git
cd libpackedobjectsd
autoreconf -i
./configure
when I am trying to run the ./configure I am getting error:
checking for LIBPACKEDOBJECTS... no
configure: error: Package requirements (libpackedobjects) were not met:
No package 'libpackedobjects' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables LIBPACKEDOBJECTS_CFLAGS
and LIBPACKEDOBJECTS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
I do understand that the path can not be found, but do not know how to repair the problem. Any suggestions?
As evident from your error report:
checking for LIBPACKEDOBJECTS... no
configure: error: Package requirements (libpackedobjects) were not met:
No package 'libpackedobjects' found
Hence, You have to install the packages libpackedobjects and libXml2to install the libpackedobjectsd.
If you still get this error after installing the depenedent packages, there might be a PATH issue or linking issue.

Resources