"sudo make x11-dist-install", no rule to generate - linux

So, I'm trying to getting setup on Ubuntu the g-samples of g-truc.
Installed build-essentials and a lot of dev mesa libs.
cmake works flawless.
However, the linux instructions are the following:
Install the GLFW library included in the external directory. -- sudo make x11-dist-install
Run CMake to create a makefile for GCC
Launch the sample from the build output directory
But if I run sudo make x11-dist-install from within gl-samples/external/glfw-3.1.1
make: *** no rule to generate "x11-dist-install" objective. Stop.
According to g-truc, it looks like a glfw bug, but I don't know if it's really the case or I'm just doing something wrong

I updated to glfw 3.2.1 and it worked
Downloaded 3.2.1.zip here, extracted along with 3.1.1, modified accordingly CMakeLists.txt as follow:
################################
# Add GLFW
set(GLFW_DIRECTORY glfw-3.2.1)
and reloaded

Related

arm-none-eabi-objdump: error while loading shared libraries: libdebuginfod.so.1: cannot open shared object file

If you have an answer for this, or further information, I'd welcome it. I'm following advice from here, to offer some unsolicited help by posting this question then an answer I've already found for it.
I have a bare-metal ARM board for which I'm building a cross-toolchain, from sources for GNU binutils, gcc and gdb, and for SourceWare's Newlib. I got those four working and cross-built a DoNothing.c into an ELF file - but I couldn't disassemble it with this:
$ arm-none-eabi-objdump -S DoNothing.elf
The error was:
$ arm-none-eabi-objdump: error while loading shared libraries: libdebuginfod.so.1: cannot open shared object file: No such file or directory
I'll follow up with a solution.
The error was correct - my system didn't have libdebuginfod.so.1 installed - but I have another cross-binutils, installed from binary for a different target, and its objdump -S works fine on the same host. Why would one build of objdump complain about missing that shared library, when clearly not all builds of objdump need it?
First I tried rebuilding cross binutils, specifying --without-debuginfod as a configure option. No change, which seems odd: surely that should build tools that not only don't use debuginfod but which don't depend on it in any way. (If someone can answer that, or point out what I've misunderstood, it may help people.)
Next I figured debuginfod was inescapable (for my cross-tools built from source at least), so I'd install it to get rid of the error. It's a component of the elfutils package, but installing the latest elfutils available for my Ubuntu 20.04 system didn't bring libdebuginfod.so.1 with it.
I found a later one, for Arch Linux, whose package contents suggested it would - but its package format doesn't match Ubuntu's and installing it was going to involve a lot of work. Instead I opted to build it from the Arch Linux source package. However, running ./configure on that gave a couple of infuriatingly similar errors:
configure: checking libdebuginfod dependencies, --disable-libdebuginfod or --enable-libdebuginfo=dummy to skip
...
configure: error: dependencies not found, use --disable-libdebuginfod to disable or --enable-libdebuginfod=dummy to build a (bootstrap) dummy library.
No combination of those suggestions would allow configure for elfutils-0.182 to run to completion.
The problem of course was my own lack of understanding. The solution came from the Linux From Scratch project: what worked was to issue configure with both of the suggested options, like this:
$ ./configure --prefix=/usr \
--disable-debuginfod \
--enable-libdebuginfod=dummy \
--libdir=/lib
That gave a clean configure; make worked first time, as did make check and then sudo make install which of course installed libdebuginfod.so.1 as required. I then had an arm-none-eabi-objdump which disassembles cross-compiled ELF files without complaining.

Paho MQTT throws undefined reference error during compile

I have a problem using Paho MQTT client in C.
I downloaded the pre built binaries for my system (Windows 10 64) from their projects page. I unpacked the zip file to a folder in the documents folder, where I also created a .c file with the example at the bottom of the Paho product page. My editor is atom and my compiler is gcc.
When I tried to compile it in Atom, I got this error:
undefined reference to MQTTClient_create'
So I went searching and found plenty of topics, but I still couldn't figure out, how to resolve this issue. From this stackoverflow topic I gather that it's a linker problem and that I need to link the files during compile, so here's what I tried:
gcc MQTT.c -L "C:\Users\Pete\Documents\MQTT on C\Examples\Paho\lib" -l paho-mqtt3c
Which still gives me the same undefined reference error. When I try to link to the dll of the same name, the compiler does not find the file.
Can anyone point me in the right direction, please?
Any help is appreciated!
I'd be interested to know if you have registered the Paho MQTT dll in Windows?
You should have paho-mqtt3c.dll as part of the download.
I don't know if this will work for you, but I have the same issue (undefined reference to MQTTClient_create)...
Copy the dll file into c:/windows/system32
Run CMD Prompt as Administrator and type:
regsvr32 i/ paho-mqtt3c.dll
Worth a try.
The problem was that I was compiling the program with the 32-bit gcc compiler for the 64-bit library. Installing and using MinGW64 worked.
I had the same issue in OS X. This is how I resolved it
I compiled the paho-mqtt library in Linux/EC2 instance.
Installed all the dependencies:
sudo yum install install build-essential gcc make cmake cmake-gui cmake-curses-gui
sudo yum install cmake
sudo yum install doxygen graphviz
cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=FALSE -DPAHO_BUILD_STATIC=TRUE -DPAHO_BUILD_SHARED=FALSE -DPAHO_MQTT_C_PATH=../paho.mqtt.c/ -DPAHO_MQTT_C_LIB=../paho.mqtt.c/src/libpaho.mqtt3as-static.a
make
make html
make install
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ec2-user/paho.mqtt.c/src
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
sudo ldconfig
gcc test1.c -o test1 -lpaho-mqtt3c
Compiled successfully..
./test1
This solution works for OS X as well. Replace step 2 with
brew install cmake doxygen openssl-devel

Build mozilla JSS

I followed NSS build instructions and built NSS successfully.
Then I follow JSS build instructions and building fails with error:
In file included from CryptoManager.c:6:0:
../../../../dist/public/nss/secitem.h:15:21: fatal error: plarena.h: No such file or directory
compilation terminated.
This result is on Ubuntu 16.04 LTS.
On WIndows I get:
All directories (dist, jss, nspr and nss) are on the same level.
What am I doing wrong?
Check my post here. Basically it's due to missing packages. If not working, this file is somewhere under nspr. Copy it and place it beside the .c file which needs it.
EDIT:
To sum it up:
1. Install build-essential and gcc with g++.
2. Try to install zlib1g-dev and libc6-dev, if they are absent.
3. And, install zlib1g-dev.
4. cd into the nss directory, and run the build like this:
gmake nss_build_all NSS_SSL_ENABLE_ZLIB=
if you are under a x64 environment, add USE_64=1, too.
It should work.

How to compile c++ programs in the new c++ driver provided by Datastax in Linux

I am new to Cassandra. I installed c++ driver from Datastax. Can some one please provide me the steps like in which path I have to create the ā€˜.cā€™ file and how I can compile it. I can see some example programs in example folder. Can anyone plz tell me how to compile the example programs.
The cpp-driver uses cmake and depends on libuv. So the first steps would be to ensure you have cmake installed as well as libuv. Depending on your linux distribution it may be as simple as using package manager like apt or yum (i.e. sudo apt-get install cmake libuv-dev)
Building is just a matter of running the following steps in the cpp-driver directory:
cmake .
make
sudo make install
This will install libcassandra.so to somewhere in your lib path. You can then link by providing '-lcassandra' in your parameters to clang or gcc (i.e. clang myfile.c -o myfile -lcassandra)
There is very comprehensive documentation on building from source here.

installing QODBC driver for linux

I am trying to install QODBC drivers on ubuntu 13.10 for Qt 5.0.2. I have followed the official documentation (see http://qt-project.org/doc/qt-5/sql-driver.html#qodbc) but am stuck at one of the steps. When I try to do
qmake "INCLUDEPATH+=/usr/local/unixODBC/include" "LIBS+=-L/usr/local/unixODBC/lib -lodbc"
it just shows me the help manual for qmake and does nothing.
So I tried to make an empty Makefile and then passed it as an argument
qmake "INCLUDEPATH+=/usr/local/unixODBC/include" "LIBS+=-L/usr/local/unixODBC/lib -lodbc" Makefile
when I try to "make" the generated Makefile, it shows the following errors:
Makefile:183: warning: overriding commands for target `Makefile'
Makefile:130: warning: ignoring old commands for target `Makefile'
make: Circular Makefile <- Makefile dependency dropped.
make: Circular Makefile <- Makefile dependency dropped.
make: Nothing to be done for `first'.
I have just managed to make the odbc driver installation. The main problem here seems to be that you are not including the "pro" target file.
Here all the steps are:
Go to odbc pluggin path. In my case: cd ~/Qt/5.3/Src/qtbase/src/plugins/sqldrivers/odbc
Run qmake including the target LIB paths and also the pro file:
~/Qt/5.3/gcc_64/bin/qmake -makefile "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lodbc" odbc.pro
make and then sudo make install
I hope it will be usefull.
Regards,

Resources