i have MOTIF installed X11
a easy program is saved as hello.c
there is the following message
where can i get the X11/intrinsic.h , file ???
need help to compile
my system : MX-16 Linux Debian Jessie / i386
Code:
hans#mx1:~/Documents
$ cc push.c -o push -lXm -lXt -lX11
In file included from push.c:2:0:
/usr/include/Xm/Xm.h:59:27: fatal error: X11/Intrinsic.h: No such file or directory
#include <X11/Intrinsic.h>
^
compilation terminated.
hans#mx1:~/Documents
I installed the libxt-dev package on my Debian box:
apt-get install libxt-dev
Then the proper header will be installed:
# find /usr -name "Intrinsic.h" -print
/usr/include/X11/Intrinsic.h
Been using xv for several decades now -- I always find myself trying to rebuild it.
The copy on my system came from libxt-dev
$ locate Intrinsic
/usr/include/X11/Intrinsic.h
/usr/include/X11/IntrinsicI.h
/usr/include/X11/IntrinsicP.h
$ dpkg-query -S /usr/include/X11/Intrinsic.h
libxt-dev:amd64: /usr/include/X11/Intrinsic.h
You may want to install and use apt-file - you can ask it for a filename and it will tell you which packages (that you don't even have to have installed - just from the repos in your sources.lists) contain a file with that name
Related
I downloaded python source code using the command
git clone https://github.com/python/cpython
Now I created a main.c like so
#include <stdio.h>
#include <python.h>
int main(void)
{
return 0;
}
when I try to compile using this command
gcc main.c -L /f/<redacted>/cpython/Lib -I /f/<redacted>/cpython/Include -lpython
I get this error
$ gcc main.c -L /f/<redacted>/cpython/Lib -I /f/<redacted>/cpython/Include -lpython
In file included from main.c:2:
F:/<redacted>/cpython/Include/python.h:12:10: fatal error: pyconfig.h: No such file or directory
12 | #include "pyconfig.h"
| ^~~~~~~~~~~~
compilation terminated.
I know that pyconfig.h can be obtained using sudo apt install python-dev on Linux, so I tried pacman -S python-devel but this does not seem to fix the issue
I also tried to use locate pyconfig.h to link it using the -I but it is nowhere to be found
My machine is a windows 10 and I am using MSYS2withMINGW64 to compile this code
What I have done:
git clone https://github.com/eclipse/paho.mqtt.c
cd paho.mqtt.c
make
sudo make install
Then, I tried compiling a simple C program that includes the MQTT C library like this:
#include <MQTTClient.h>
The command I used was:
$ gcc -o mqttTest mqttTest.c -lpaho-mqtt3c
What I got was ...
... even though the libraries are clearly present in /usr/local/lib:
What do I need to do to compile my code?
I already tried adding -L/usr/local/lib to the compile command, to no avail.
I found the answer on GitHub. See VilleViktor's post here: https://github.com/eclipse/paho.mqtt.cpp/issues/150
All I had to do was:
$ mv /usr/local/lib/libpaho-mqtt3a.so.1.0 /usr/local/lib/libpaho-mqtt3a.so.1
$ mv /usr/local/lib/libpaho-mqtt3as.so.1.0 /usr/local/lib/libpaho-mqtt3as.so.1
$ mv /usr/local/lib/libpaho-mqtt3c.so.1.0 /usr/local/lib/libpaho-mqtt3c.so.1
$ mv /usr/local/lib/libpaho-mqtt3cs.so.1.0 /usr/local/lib/libpaho-mqtt3cs.so.1
Maybe that saves someone else a lot of time on Google ...
Observe:
$ cat /tmp/plugin.go
package main
import "fmt"
var V int
func F() { fmt.Printf("Hello, number %d\n", V) }
$ go build -buildmode=plugin -o /tmp/plugin.so /tmp/plugin.go
# runtime/cgo
cgo-builtin-prolog:1:57: fatal error: stddef.h: No such file or directory
compilation terminated.
Why is that?
This is under Ubuntu 17.04, and I have build-essentials installed:
$ go version
go version go1.9 linux/amd64
$ uname -r
4.10.0-37-generic
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
$ apt-cache policy build-essential
build-essential:
Installed: 12.1ubuntu2
Candidate: 12.1ubuntu2
please not the "Compilation error: "stddef.h: No such file or directory"" is NOT the answer as my gcc-core package and gcc-g++ are of the same version -- here are my gcc related packages:
gcc_4:6.3.0-2ubuntu1
gcc-6_6.3.0-12ubuntu2
gcc-6-base:amd64_6.3.0-12ubuntu2
libgcc-6-dev:amd64_6.3.0-12ubuntu2
libgcc1:amd64_1:6.3.0-12ubuntu2
UPDATE:
thanks #peterSO, seems to be my gcc's own problem:
$ cat /tmp/foo.c
#include <stdio.h>
$ gcc /tmp/foo.c
In file included from /tmp/foo.c:1:0:
/usr/include/stdio.h:33:21: fatal error: stddef.h: No such file or directory
# include <stddef.h>
While searching for solution for it, I found someone suggested to reinstall gcc, so I did, together with libc6-dev:
apt-get --reinstall install libgcc-6-dev gcc-6 gcc-6-base:amd64 libc6-dev:amd64
Now my simple .c file compiles OK now, but I'm bumped into a new problem with cgo:
$ go build -buildmode=plugin -o /tmp/plugin.so /tmp/plugin.go
# runtime/cgo
In file included from /usr/include/errno.h:35:0,
from cgo-gcc-prolog:21:
/usr/include/x86_64-linux-gnu/bits/errno.h:24:26: fatal error: linux/errno.h: No such file or directory
# include <linux/errno.h>
^
compilation terminated.
I know this might be a Ubuntu/gcc specific problem (Ref: Why is stddef.h not in /usr/include? and my stddef.h is under /usr/src/linux-headers-4.10.0-37/include/linux/stddef.h), but anybody here knows Go and gcc good enough to know how to fix it, so that Go plugins can be compiled properly?
Thx!
I am installing muPDF.
I gave an input like make prefix=/usr/local install in terminal
I have installed XQuartz already
But I get an error as follows
In file included from thirdparty/glfw/src/context.c:28:
In file included from thirdparty/glfw/src/internal.h:85:
thirdparty/glfw/src/x11_platform.h:35:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
^
make XCFLAGS=-I/opt/X11/include XLIBS=-L/opt/X11/lib
I'm on Mac OS X 10.9;
The makefile looks for X11 headers into /usr/local/include/X11 instead of /opt/X11/include/X11
The quick fix is a symlink
$ sudo ln -s /opt/X11/include/X11 /usr/local/include/X11
You may also need this further fix for OpenGL headers
$ sudo ln -s /opt/X11/include/GL /usr/local/include/GL
Probably exists a more elegant solution by specifying headers location when invoking make but I couldn't find a way to do that.
The best solution for now is to use the X11 mupdf (and disable the openGL one):
make HAVE_GLFW=no
I have installed eCos OS on a linux system (Ubuntu 13.02). After installation, the eCos files are located in opt/ecos.
As I read the eCos tutorial, I see hello.c is stored in opt/ecos/ecos-3.0/examples/hello.c (And I notice that maybe all main eCos system files store in the ecos-3.0 directory).
I have followed the eCos tutorial found on the official website, but I still cannot successfully compile hello.c.
More detail. When I try to run :
$ export INSTALL_DIR=BASE_DIR/ecos-work/arm_install
$ TARGET-gcc -g -IBASE_DIR/ecos-work/install/include hello.c \
-LBASE_DIR/ecos-work/install/lib -Ttarget.ld -nostdlib
I get the error : TARGET-gcc : command not found
I have tried some other tutorials, but I'm still having issues (too messy to list here).
I am looking for step-by-step instruction on compiling hello.c in eCos system. I see the eCos manual lacking in this area.
Thanks :)
It appears that you've missed a subtle convention in the eCos documentation. Items in italics are provided by you! They are variables.
The documentation mentions this here:
Note: Remember that when this manual shows TARGET-gcc you should use
the full name of the cross compiler, e.g. i386-elf-gcc, arm-elf-gcc,
or sh-elf-gcc. When compiling for the synthetic Linux target, use the
native gcc which must have the features required by eCos.
Replace TARGET with the appropriate value and BASE_DIR with (I think, in your case) /opt/ecos. You should verify the include directory before moving forward:
$ ls -l /opt/ecos/ecos-work/install/include
If that doesn't list directory contents, then you simply need to locate ecos-work
The Ecosconfig on Windows and Linux Quick Start section of the docs has you create the BASE_DIR directory (below is a snippet that I am quoting ... italics will not display).
$ mkdir BASE_DIR/ecos-work
$ cd BASE_DIR/ecos-work
So, this could be the correct invocation.
$ export INSTALL_DIR=/opt/ecos/ecos-work/arm_install
$ arm-elf-gcc -g -I/opt/ecos/ecos-work/install/include hello.c \
-L/opt/ecos/ecos-work/install/lib -Ttarget.ld -nostdlib
you need to do
# source /opt/ecos/ecosenv.sh
Then you can try to compile by changing TARGET=
$ TARGET-gcc -g -IBASE_DIR/ecos-work/install/include hello.c \
-LBASE_DIR/ecos-work/install/lib -Ttarget.ld -nostdlib