Stlink: Ubuntu 18.04 Installation

Created on 1 Jul 2018  路  1Comment  路  Source: stlink-org/stlink

Hi there,

Just trying to compile this on Ubuntu 18.04 LTS with GCC 4:7.3.0-3ubuntu2, libusb-dev 2:0.1.12-31) & cmake 3.10.2-1ubuntu2.

I simply did a git clone, followed by a make release. This didn't work so I tried make clean then make release.
The CMakeError.log file shows that the '-Wshorten-64-to-32' option is unrecognised

Performing C SOURCE FILE Test C_SUPPORTS_WSHORTEN_64_TO_32 failed with the following output:
Change Dir: /home/tim/stlink/build/Release/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_16bb9/fast"
make[1]: Entering directory '/home/tim/stlink/build/Release/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_16bb9.dir/build.make CMakeFiles/cmTC_16bb9.dir/build
make[2]: Entering directory '/home/tim/stlink/build/Release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_16bb9.dir/src.c.o
/usr/bin/cc   -std=gnu99 -Wall -Wextra -Wshadow -D_FORTIFY_SOURCE=2 -fstrict-aliasing -Wundef -Wformat -Wformat-security -Wmaybe-uninitialized -DC_SUPPORTS_WSHORTEN_64_TO_32   -Wshorten-64-to-32 -o CMakeFiles/cmTC_16bb9.dir/src.c.o   -c /home/tim/stlink/build/Release/CMakeFiles/CMakeTmp/src.c

cc: error: unrecognized command line option '-Wshorten-64-to-32'

CMakeFiles/cmTC_16bb9.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_16bb9.dir/src.c.o' failed
make[2]: *** [CMakeFiles/cmTC_16bb9.dir/src.c.o] Error 1
make[2]: Leaving directory '/home/tim/stlink/build/Release/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_16bb9/fast' failed
make[1]: *** [cmTC_16bb9/fast] Error 2
make[1]: Leaving directory '/home/tim/stlink/build/Release/CMakeFiles/CMakeTmp'

dependenclibusb errocompilation olinux staturesolved

Most helpful comment

OK I solved this problem. Basically don't use:
sudo apt-get install libusb-dev
Instead use:
sudo apt-get install libusb-1.0-0-dev

From a clean ubuntu build here's what I did

#Install USB library
sudo apt-get install libusb-1.0-0-dev
#install cmake to compile and build using MakeFile
sudo apt-get install cmake
#download this great repository :-)
git clone https://github.com/texane/stlink
cd stlink
#start on a clean page
make clean
#make and make release are the same, Release made in build/Release
make
#install the Release binaries, symbolic links etc.
cd build/Release
sudo make install
#refresh the cache for the updated links
sudo ldconfig
#check that you can see the device
st-info --descr
F42x and F43x device

>All comments

OK I solved this problem. Basically don't use:
sudo apt-get install libusb-dev
Instead use:
sudo apt-get install libusb-1.0-0-dev

From a clean ubuntu build here's what I did

#Install USB library
sudo apt-get install libusb-1.0-0-dev
#install cmake to compile and build using MakeFile
sudo apt-get install cmake
#download this great repository :-)
git clone https://github.com/texane/stlink
cd stlink
#start on a clean page
make clean
#make and make release are the same, Release made in build/Release
make
#install the Release binaries, symbolic links etc.
cd build/Release
sudo make install
#refresh the cache for the updated links
sudo ldconfig
#check that you can see the device
st-info --descr
F42x and F43x device
Was this page helpful?
0 / 5 - 0 ratings

Related issues

tabemann picture tabemann  路  5Comments

grzegorz-kraszewski picture grzegorz-kraszewski  路  9Comments

xor-gate picture xor-gate  路  7Comments

renn0xtek9 picture renn0xtek9  路  8Comments

Hamid-Najafi picture Hamid-Najafi  路  8Comments