I'm trying to do cross-compilation for an ARM a8 processor. I'm moving the code base to a new system, and therefore it should be installed using the same compiler and makefiles as the original system.
I know that I'm using a arm-linux-gnueabihf-gcc compiler.
I've installed the following packages:
> sudo apt install gcc-arm-linux-gnueabihf
> sudo apt install binutils-arm-linux-gnueabi
When I compile the following code block:
#include <stdio.h>
// filename: simple.c
int main(void)
{
printf("I'm printing!\n");
return;
}
with this command:
> arm-linux-gnueabihf-gcc simple.c
I expect it to compile at this step. I instead get:
In file included from simple.c:1:0:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
#include <bits/libc-header-start.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Any help would be appreciated! Thank you!
I think what you are missing is the multilib packets, if I'm right, this should do the trick for you.
sudo apt install gcc-multilib g++-multilib
Related
I installed the OpenVino on my Ubuntu 20.04 using the apt command.
sudo apt install intel-openvino-dev-ubuntu20-2021.3.394
I am trying to compile this simple program using gcc 1.c -linference_engine_c_api.
#include <stdio.h>
#include <c_api/ie_c_api.h>
int main() {
printf("C API Successfully Loaded!");
}
But the compilation fails with the following error:
1.c:2:10: fatal error: c_api/ie_c_api.h: No such file or directory
2 | #include <c_api/ie_c_api.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
How do I solve this?
You cannot directly call gcc for the 1.c file. You need to create a script to compile necessary dependencies (like CMake).
For example, in \opt\intel\openvino_2021.3.394\deployment_tools\inference_engine\samples\c there is build_sample.h script. This script is used to perform all compilation and it uses CMake. Same goes for gcc, to run the inference lib you need to compile the script first before calling ie_c_api.h. 1.c file cannot be run directly when gcc compiler does not support the operation.
Please go to Integrate the Inference Engine with Your Application - OpenVINO™ Toolkit (openvinotoolkit.org) for reference.
#include <ft2build.h>
#include FT_FREETYPE_H
int main() {
return 0;
}
Here is the compiler output:
In file included from fonttest.cpp:1:
/usr/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found
#include <freetype/config/ftheader.h>
^
1 error generated.
I follow the official tutorial.
I have the packages installed:
i libfreetype6 - FreeType 2 font engine, shared library files
i A libfreetype6:i386 - FreeType 2 font engine, shared library files
i libfreetype6-dev - FreeType 2 font engine, development files
File /usr/include/freetype2/freetype/config/ftheader.h is there.
If someone out there is struggling, you can try
sudo apt-get install libfreetype6-dev
I think it's better to install pkg-config.
pkg-config will help the configure to find the freetype2.
i dont have internet connection, so i installed gcc on my linux system manually through its debian package. but i am not able to compile any c code.
here is my sample c code.
#include <stdio.h>
main()
{
printf("Hellp world");
return 0;
}
the error that it shows:
ocpe#blrkec241972d:~$ gcc -o hello hello.c
hello.c:1:19: error: stdio.h: No such file or directory
hello.c: In function âmainâ:
hello.c:4: warning: incompatible implicit declaration of built-in function âprintfâ
I think i have not installed all the dependencies of compiler. Plz suggest me descriptive way to install it correctly..
Assuming by "installed manually", you mean "using dpkg -i", then you need to also install libc6-dev. I suggest further installing, at very minimum, build-essential and everything it depends on.
Debian actually has a few programs to help with offline package installation. One option is of course to use CD/DVD images. Another is to use something like apt-offline.
On my Debian system, the header files are in another package libc6-dev. You're probably missing that (and some others as well, I would guess).
What about this gcc -Wall hello.c -o hello -I/usr/include/stdio.h?
You can see your include search path by using:
echo | gcc -v -x c -E -
On my Ubuntu Linux machine i can see this output for the previous command:
#include \"...\" search starts here:
/usr/lib/gcc/i686-linux-gnu/4.6.1/include
/usr/local/include
/usr/lib/gcc/i686-linux-gnu/4.6.1/include-fixed
/usr/include/i386-linux-gnu
/usr/include
EDIT :
Install build-essential
Download from here : http://packages.debian.org/squeeze/i386/build-essential/download (assume you are 32 bits), and install dowloaded package like this:
dpkg -i build-essential.deb
I'm trying to put together an AMI on EC2, and am currently stalled on building 0mq.
initially, I got this error while running ./configure
checking for uuid_generate in -luuid... no
configure: error: cannot link with -luuid, install uuid-dev.
I installed e2fsprogs-devel and linux-utils via yum, which I believe contained the required library, but still got the error above. I subsequently installed uuid-devel with yum and got no further.
Then, I created a link as below:
sudo ln -s /lib64/libuuid.so.1.3.0 /lib64/libuuid.so
and now ./configure completes happily, but I get an error when I run make
[...]
CXX libzmq_la-signaler.lo
CXX libzmq_la-socket_base.lo
In file included from socket_base.cpp:50:
uuid.hpp:31:23: error: uuid/uuid.h: No such file or directory
In file included from socket_base.cpp:50:
uuid.hpp:92: error: 'uuid_t' in namespace '::' does not name a type
make[2]: *** [libzmq_la-socket_base.lo] Error 1
make[2]: Leaving directory `/home/this/infrastructure/zeromq2-2/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/this/infrastructure/zeromq2-2/src'
make: *** [all-recursive] Error 1
The following is the beginning of /usr/include/uuid.h, if that's useful.
#ifndef __UUID_H__
#define __UUID_H__
/* workaround conflicts with system headers */
#define uuid_t __vendor_uuid_t
#define uuid_create __vendor_uuid_create
#define uuid_compare __vendor_uuid_compare
#include <sys/types.h>
#include <unistd.h>
#undef uuid_t
#undef uuid_create
#undef uuid_compare
I'm pretty well stumped at this point.
As pointed out on https://bugzilla.redhat.com/show_bug.cgi?id=576296#c0, use libuuid-devel instead of uuid-devel,
$ sudo yum install libuuid-devel
This resolved the missing /usr/include/uuid/uuid.h file for me.
ultimately, I satisfied the dependency by running
$ yum install uuid-devel
also worth noting is that to get libzmq to link into the other programs that needed it down the line (Mongrel2, for example), I had to add the line
/usr/local/lib
to /etc/ldconfig.so.conf and run
$ ldconfig -v | grep zmq
(if you don't see an entry for libzmq.so in the output, something's off)
Alternatively, read the documentation on installing zeromq! :)
i.e.
Make sure that libtool, autoconf, automake are installed.
Check whether uuid-dev package, uuid/e2fsprogs RPM or equivalent on your system is installed.
Unpack the .tar.gz source archive.
Run ./configure, followed by make.
To install ØMQ system-wide run sudo make install.
On Linux, run sudo ldconfig after installing ØMQ.
As mentioned, on Amazon Linux, you'd install deps by doing:
sudo yum install uuid uuid-devel
N.B. the instructions also mention the requirement to do:
sudo ldconfig
after install too.
I'm not a linux expert, and I'm trying to install a 2D graphics library on Ubuntu 10.10. I need to make a 2D display and after a little online research, GooCanvas seems like it will fit the bill.
I'm frustrated because it simply won't install and I don't get what I am supposed to do.
Here's what I did.
1> git clone git://git.gnome.org/goocanvas #built a goocanvas directory
2> cd goocanvas
3> ls
AUTHORS ChangeLog demo goocanvas.doap NEWS src
autogen.sh configure.in docs MAINTAINERS po TODO
autom4te.cache COPYING goocanvas-2.0.pc.in Makefile.am README
4> less README #here's what it says
To build it run './configure' and 'make'. To run the demo cd into 'demo' and
run './demo'. (Or run ./simple-demo for the very simple demo, or ./mv-demo
for the model-view demo.)
5> ./configure # error: bash: ./configure: No such file or directory
6> find . -name "configure*" -print #there aren't any other configure scripts?
'make; and 'make install' don't work either.
OK, I'm frustrated. Why does it say run configure if there isn't one? How do I install this thing?
Does anyone know an easy to use graphics library for ubuntu that will actually work. and can be easily installed?
Cairo, which is usually assumed when talking about GTK, is a good 2D library. Installing should be easy as this will be in your distributions repository (from the command line as root run apt-get install libcairo2-dev).
Now that I think about it - your new enough to Linux not to look at your repository for software first - learn to do that! I checked and found Ubuntu universe already has goocanvas, just apt-get install libgoocanvas-dev and you should be good to go.
Does anyone know an easy to use graphics library for ubuntu that will actually work.
and can be easily installed?
What is wrong with the big ones:
Qt
gtk
EFL (The Enlightenment libs)
Their instructions are out of date, execute the autogen.sh file first. You'll need the gtk-doc-tools and some other packages to support compiling things.
Edit 1:
Looks like it needs GTK 3.0, glib 2.28+, and Cairo 1.1+ - those are pretty modern. I'm not sure what Ubuntu 10.10 has them (I'm on 10.04), launch Synaptic Package Manager and search for libgtk the header files are in dev packages.
Edit 2:
What sort of graphics package are you looking for? SDL may work, or Cairo.
Using SDL
If you want to use graphics.h on Ubuntu platform you need to compile and install libgraph. It is the implementation of turbo c graphics API on Linux using SDL.
It is not very powerful and suitable for production quality application, but it is simple and easy-to-use for learning purpose.
You can download it from http://download.savannah.gnu.org/releases/libgraph/libgraph-1.0.2.tar.gz.
First install build-essential by typing
sudo apt-get install build-essential
Intall some additional packages by typing
sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 \
guile-1.8-dev libsdl1.2debian libart-2.0-dev libaudiofile-dev \
libesd0-dev libdirectfb-dev libdirectfb-extra libfreetype6-dev \
libxext-dev x11proto-xext-dev libfreetype6 libaa1 libaa1-dev \
libslang2-dev libasound2 libasound2-dev
Now extract the downloaded libgraph-1.0.2.tar.gz file.
Goto extracted folder and run following command
./configure
make
sudo make install
sudo cp /usr/local/lib/libgraph.* /usr/lib
Now you can use #include on ubuntu platform
Compile it using gcc demo.c -o demo -lglut -lGL
/* demo.c*/
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glu.h>
void setup() { glClearColor(1.0f, 1.0f, 1.0f, 1.0f); }
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(0.0f, 0.0f, 0.0f);
glRectf(-0.75f,0.75f, 0.75f, -0.75f);
glutSwapBuffers();
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowSize(800,600);
glutCreateWindow("Hello World");
setup();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
Run it using ./demo
Check this out: We have developed a 2d Graphics library and Windowing System(GWS): https://github.com/MnMInfoTech/GWS