Do you need it to be compiled with MSVC or MinGW? Is this important?
For the MinGW version:
Download the corresponding version of MSYS2 from here: http://www.msys2.org/ .
Follow the instructions on the page linked above to install it, and update it.
You need to install a couple of packages using the MSYS2 shell, in order to build libsmu:
Thanks, I had already installed mingw64-gcc4.7.1 exe but I think I need to install more along with MSYS2.
I'll let you know if I encounter any difficulties along the way.
I think I must be missing some steps.
I only want to make a 32 bit version of libsmu so I skipped the steps listed under "for 64 bit"
in a freshly opened MSYS2 MinGW 32-bit terminal screen:
I entered the four steps under the "for 32 bit", A copy of the contents of the terminal screen is here:
msys-MINGW32-steps1-4.zip
I have the libusb hotplug for 32 bit from here: http://swdownloads.analog.com/cse/build/libusb-1.0-hp.7z extracted into C:\libusb-mingw.
In the pwd of the terminal I have the downloaded and extracted libsmu-master.
I next stated entering the stuff listed under Build libsmu MinGW 32 bit. And this is what I get.
Doug@Doug-PC MINGW32 ~
$ pwd
/home/Doug
Doug@Doug-PC MINGW32 ~
$ ls
c:libsmumingw-32 cmake.txt libsmu-master libsmu-master.zip
I've made some small additional progress here.
I installed MinGW to C:/MinGW (all packages)
I then opened MSYS2 32 bit again and typed in the following:
Doug@Doug-PC MINGW32 ~
$ cd C:/projects/libsmu/mingw-32
Doug@Doug-PC MINGW32 /c/projects/libsmu/mingw-32
$ cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=/mingw32 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER:FILEPATH=C:/msys64/mingw32/bin/i686-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:/msys64/mingw32/bin/i686-w64-mingw32-g++.exe -DLIBUSB_LIBRARIES=C:/libusb-mingw/MinGW32/static/libusb-1.0.a -DLIBUSB_INCLUDE_DIRS=C:/libusb-mingw/include/libusb-1.0 -DBUILD_STATIC_LIB=ON -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DBOOST_INCLUDE_DIR=C:/msys32/mingw32/include -DBUILD_PYTHON=OFF ..
CMake Error: Error: generator : Unix Makefiles
Does not match the generator used previously: NMake Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
It now got past the step to make the project dir but the cmake step failed as you can see.
It looks like the build directory contains some cache files ( CMakeCache.txt file and CMakeFiles ) which were generated on an older build using NMake Makefiles. I think you can cd c:\libsmu\mingw-32 and remove everything in this folder, then run cmake. The new cache files will be generated using the correct cmake generator.
Sorry but still not working.
Here is the contents of the terminal window as I was trying what you suggested after deleted CMakeCache.txt file and CMakeFiles directory from C:/projects/libsmu/mingw-32. Added a copy of CMakeLists.txt from libsmu-master archive zip file from gitub to C:/projects/libsmu after first error.
Doug@Doug-PC MINGW32 ~
$ cd C:/projects/libsmu/mingw-32
Doug@Doug-PC MINGW32 /c/projects/libsmu/mingw-32
$ cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=/mingw32 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER:FILEPATH=C:/msys64/mingw32/bin/i686-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:/msys64/mingw32/bin/i686-w64-mingw32-g++.exe -DLIBUSB_LIBRARIES=C:/libusb-mingw/MinGW32/static/libusb-1.0.a -DLIBUSB_INCLUDE_DIRS=C:/libusb-mingw/include/libusb-1.0 -DBUILD_STATIC_LIB=ON -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DBOOST_INCLUDE_DIR=C:/msys32/mingw32/include -DBUILD_PYTHON=OFF ..
CMake Error: The source directory "C:/projects/libsmu" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Doug@Doug-PC MINGW32 /c/projects/libsmu/mingw-32
$ cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=/mingw32 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER:FILEPATH=C:/msys64/mingw32/bin/i686-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:/msys64/mingw32/bin/i686-w64-mingw32-g++.exe -DLIBUSB_LIBRARIES=C:/libusb-mingw/MinGW32/static/libusb-1.0.a -DLIBUSB_INCLUDE_DIRS=C:/libusb-mingw/include/libusb-1.0 -DBUILD_STATIC_LIB=ON -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DBOOST_INCLUDE_DIR=C:/msys32/mingw32/include -DBUILD_PYTHON=OFF ..
CMake Error: The source directory "C:/projects/libsmu" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Doug@Doug-PC MINGW32 /c/projects/libsmu/mingw-32
$ ls
appveyor.yml CMakeLists.txt dist examples LICENSE src
bindings contrib doc include README.md tests
Doug@Doug-PC MINGW32 /c/projects/libsmu/mingw-32
$ cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=/mingw32 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER:FILEPATH=C:/msys64/mingw32/bin/i686-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:/msys64/mingw32/bin/i686-w64-mingw32-g++.exe -DLIBUSB_LIBRARIES=C:/libusb-mingw/MinGW32/static/libusb-1.0.a -DLIBUSB_INCLUDE_DIRS=C:/libusb-mingw/include/libusb-1.0 -DBUILD_STATIC_LIB=ON -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DBOOST_INCLUDE_DIR=C:/msys32/mingw32/include -DBUILD_PYTHON=OFF ..
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
See also "C:/projects/libsmu/mingw-32/CMakeFiles/CMakeOutput.log".
I attached a script to setup and build libsmu. This script will clone the github repo and create the initial build structure for libsmu.
You can run it like this from the MSYS2 MINGW32 command line: ./libsmu-build.sh < path to the location where you want to keep libsmu >
The parameter is optional. If you leave it blank, it will automatically get your currently working directory and clone libsmu there.
You do not need to run this everytime, because it will clean and clone the repo again. Just modify the sources and after building this once, you can just cd < path to the location where you want to keep libsmu >/libsmu/mingw-32 and run cmake --build . --config Release.
Doug@Doug-PC MINGW32 ~
$ ./libsmu-build.sh libsmu-master
Saving libsmu to libsmu-master
./libsmu-build.sh: line 6: git: command not found
./libsmu-build.sh: line 7: cd: libsmu: No such file or directory
Building libsmu in /home/Doug/mingw-32
CMake Error: The source directory "C:/msys64/home/Doug" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Error: could not load cache
Doug@Doug-PC MINGW32 ~
$
How do I add git to MSYS2?
Is there anything else you can think of I might be missing? Please try to anticipate everything because of the time difference I only really get to do one experiment per day and this will take forever if I don't have everything in place fro the start.
Sorry about this.
You can install new packages with pacman. So you can run: pacman -S git mingw-w64-i686-ninja
Please make sure you remove the libsmu folder (if you have one) before running the build script again.
Up-date:
I added git by typing pacman -S git.
I then tried again and got the following:
Doug@Doug-PC MINGW32 ~
$ ./libsmu-build.sh libsmu-master
Saving libsmu to libsmu-master
Cloning into 'libsmu-master/libsmu'...
remote: Enumerating objects: 11733, done.
remote: Total 11733 (delta 0), reused 0 (delta 0), pack-reused 11733
Receiving objects: 100% (11733/11733), 6.95 MiB | 4.04 MiB/s, done.
Resolving deltas: 100% (7332/7332), done.
Checking out files: 100% (95/95), done.
./libsmu-build.sh: line 7: cd: libsmu: No such file or directory
Building libsmu in /home/Doug/mingw-32
CMake Error: The source directory "C:/msys64/home/Doug" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Error: could not load cache
Doug@Doug-PC MINGW32 ~
Still no luck getting to a working libsmu. Git made libsmu-master/libsmu and everything seems to be below that dir. Script seems to still have trouble finding what it needs?
Looking at the dir that it made and where it was looking I tried this:
Doug@Doug-PC MINGW32 ~
$ ./libsmu-build.sh
Saving libsmu to /home/Doug
Cloning into '/home/Doug/libsmu'...
remote: Enumerating objects: 11733, done.
remote: Total 11733 (delta 0), reused 0 (delta 0), pack-reused 11733
Receiving objects: 100% (11733/11733), 6.95 MiB | 4.16 MiB/s, done.
Resolving deltas: 100% (7332/7332), done.
Building libsmu in /home/Doug/libsmu/mingw-32
CMake Error at CMakeLists.txt:7 (project):
Running
'C:/msys64/mingw64/bin/ninja.exe' '--version'
failed with:
The system cannot find the file specified
-- Configuring incomplete, errors occurred!
See also "C:/msys64/home/Doug/libsmu/mingw-32/CMakeFiles/CMakeOutput.log".
The system cannot find the file specified
CMake Error: Generator: execution of make failed. Make command was: "C:/msys64/mingw64/bin/ninja.exe"
Doug@Doug-PC MINGW32 ~
$ pacman -S git mingw-w64-i686-ninja
warning: git-2.20.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Total Download Size: 0.35 MiB
Total Installed Size: 31.25 MiB
Net Upgrade Size: 1.46 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages...
mingw-w64-i686-ninj... 360.7 KiB 1478K/s 00:00 [#####################] 100%
(2/2) checking keys in keyring [#####################] 100%
(2/2) checking package integrity [#####################] 100%
(2/2) loading package files [#####################] 100%
(2/2) checking for file conflicts [#####################] 100%
(2/2) checking available disk space [#####################] 100%
:: Processing package changes...
(1/2) reinstalling git [#####################] 100%
(2/2) installing mingw-w64-i686-ninja [#####################] 100%
Doug@Doug-PC MINGW32 ~
$ ./libsmu-build.sh
Saving libsmu to /home/Doug
fatal: destination path '/home/Doug/libsmu' already exists and is not an empty directory.
Building libsmu in /home/Doug/libsmu/mingw-32
CMake Error at CMakeLists.txt:7 (project):
Running
'C:/msys64/mingw64/bin/ninja.exe' '--version'
failed with:
The system cannot find the file specified
-- Configuring incomplete, errors occurred!
See also "C:/msys64/home/Doug/libsmu/mingw-32/CMakeFiles/CMakeOutput.log".
The system cannot find the file specified
CMake Error: Generator: execution of make failed. Make command was: "C:/msys64/mingw64/bin/ninja.exe"
Did you try to remove the "/home/Doug/libsmu" folder before running the script again? It looks like it ran the first time without finding the good ninja and used the cached files the second time you tried to run it ("fatal: destination path '/home/Doug/libsmu' already exists and is not an empty directory.").
I found the problem. I am really sorry about this.
The build script I sent you was adapted from the 64 bit build. There is a path in there in the cmake command: " -DCMAKE_MAKE_PROGRAM:FILEPATH=C:/msys64/mingw64/bin/ninja.exe" which needs to be modified to -DCMAKE_MAKE_PROGRAM:FILEPATH=C:/msys64/mingw32/bin/ninja.exe
I changed the line using EMACS and tried again ( with libsmu dir deleted before hand)
Doug@Doug-PC MINGW32 ~
$ ./libsmu-build.sh
Saving libsmu to /home/Doug
Cloning into '/home/Doug/libsmu'...
remote: Enumerating objects: 11733, done.
remote: Total 11733 (delta 0), reused 0 (delta 0), pack-reused 11733
Receiving objects: 100% (11733/11733), 6.95 MiB | 4.20 MiB/s, done.
Resolving deltas: 100% (7332/7332), done.
Building libsmu in /home/Doug/libsmu/mingw-32
-- The CXX compiler identification is GNU 7.4.0
-- The C compiler identification is GNU 7.4.0
-- Check for working CXX compiler: C:/msys64/mingw32/bin/g++.exe
-- Check for working CXX compiler: C:/msys64/mingw32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: C:/msys64/mingw32/bin/gcc.exe
-- Check for working C compiler: C:/msys64/mingw32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Boost version: 1.69.0
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Looking for getopt
-- Looking for getopt - found
-- Downloading/updating googletest
-- Configuring done
-- Generating done
-- Build files have been written to: C:/msys64/home/Doug/libsmu/mingw-32/googletest-download
[1/9] Creating directories for 'googletest-download'
[2/9] Performing download step (git clone) for 'googletest-download'
Cloning into 'googletest-src'...
Checking out files: 100% (337/337), done.
Already on 'master'
Your branch is up to date with 'origin/master'.
[3/9] No patch step for 'googletest-download'
[4/9] Performing update step for 'googletest-download'
Current branch master is up to date.
[5/9] No configure step for 'googletest-download'
[6/9] No build step for 'googletest-download'
[7/9] No install step for 'googletest-download'
[8/9] No test step for 'googletest-download'
[9/9] Completed 'googletest-download'
-- Found PythonInterp: C:/msys64/mingw32/bin/python.exe (found version "2.7.15")
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
BOOST_INCLUDE_DIR
-- Build files have been written to: C:/msys64/home/Doug/libsmu/mingw-32
[1/46] Building CXX object src/CMakeFiles/smu.dir/usb.cpp.obj
FAILED: src/CMakeFiles/smu.dir/usb.cpp.obj
C:\msys64\mingw32\bin\g++.exe -Dsmu_EXPORTS -I../include -IC:/msys64/mingw32/include -isystem C:/libusb-mingw/include/libusb-1.0 -Wall -pedantic -std=c++11 -Wno-format-extra-args -fopenmp -O3 -DNDEBUG -MD -MT src/CMakeFiles/smu.dir/usb.cpp.obj -MF src\CMakeFiles\smu.dir\usb.cpp.obj.d -o src/CMakeFiles/smu.dir/usb.cpp.obj -c ../src/usb.cpp
In file included from ../src/usb.cpp:7:0:
../src/usb.hpp:30:15: error: 'libusb_transfer' was not declared in this scope
std::vector<libusb_transfer*> m_transfers;
^~~~~~~~~~~~~~~
../src/usb.hpp:30:15: note: suggested alternative: 'libusb_to_errno'
std::vector<libusb_transfer*> m_transfers;
^~~~~~~~~~~~~~~
libusb_to_errno
../src/usb.hpp:30:31: error: template argument 1 is invalid
std::vector<libusb_transfer*> m_transfers;
^
../src/usb.hpp:30:31: error: template argument 2 is invalid
../src/usb.hpp:35:29: error: 'libusb_device_handle' has not been declared
int alloc(unsigned count, libusb_device_handle* handle,
^~~~~~~~~~~~~~~~~~~~
../src/usb.hpp:37:23: error: 'libusb_transfer_cb_fn' has not been declared
unsigned timeout, libusb_transfer_cb_fn callback, void* user_data);
^~~~~~~~~~~~~~~~~~~~~
../src/usb.hpp:41:15: error: 'libusb_transfer' has not been declared
void failed(libusb_transfer* t);
^~~~~~~~~~~~~~~
../src/usb.hpp:56:23: error: 'libusb_transfer' was not declared in this scope
typedef std::vector<libusb_transfer*>::iterator iterator;
^~~~~~~~~~~~~~~
../src/usb.hpp:56:23: note: suggested alternative: 'm_transfers'
typedef std::vector<libusb_transfer*>::iterator iterator;
^~~~~~~~~~~~~~~
m_transfers
../src/usb.hpp:56:39: error: template argument 1 is invalid
typedef std::vector<libusb_transfer*>::iterator iterator;
^
../src/usb.hpp:56:39: error: template argument 2 is invalid
../src/usb.hpp:56:42: error: typedef name may not be a nested-name-specifier
typedef std::vector<libusb_transfer*>::iterator iterator;
^~~~~~~~
../src/usb.hpp:56:42: error: expected ';' at end of member declaration
../src/usb.hpp:56:51: error: declaration does not declare anything [-fpermissive]
typedef std::vector<libusb_transfer*>::iterator iterator;
^~~~~~~~
../src/usb.hpp:57:23: error: 'libusb_transfer' was not declared in this scope
typedef std::vector<libusb_transfer*>::const_iterator const_iterator;
^~~~~~~~~~~~~~~
../src/usb.hpp:57:23: note: suggested alternative: 'm_transfers'
typedef std::vector<libusb_transfer*>::const_iterator const_iterator;
^~~~~~~~~~~~~~~
m_transfers
../src/usb.hpp:57:39: error: template argument 1 is invalid
typedef std::vector<libusb_transfer*>::const_iterator const_iterator;
^
../src/usb.hpp:57:39: error: template argument 2 is invalid
../src/usb.hpp:57:42: error: typedef name may not be a nested-name-specifier
typedef std::vector<libusb_transfer*>::const_iterator const_iterator;
^~~~~~~~~~~~~~
../src/usb.hpp:57:42: error: expected ';' at end of member declaration
../src/usb.hpp:57:57: error: declaration does not declare anything [-fpermissive]
typedef std::vector<libusb_transfer*>::const_iterator const_iterator;
^~~~~~~~~~~~~~
../src/usb.hpp: In member function 'size_t Transfers::size()':
../src/usb.hpp:53:38: error: request for member 'size' in '((Transfers*)this)->Transfers::m_transfers', which is of non-class type 'int'
size_t size() { return m_transfers.size(); }
^~~~
../src/usb.cpp: At global scope:
../src/usb.cpp:22:3: error: 'LIBUSB_ERROR_INVALID_PARAM' was not declared in this scope
{LIBUSB_ERROR_INVALID_PARAM, EINVAL},
^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:23:3: error: 'LIBUSB_ERROR_ACCESS' was not declared in this scope
{LIBUSB_ERROR_ACCESS, EACCES},
^~~~~~~~~~~~~~~~~~~
../src/usb.cpp:24:3: error: 'LIBUSB_ERROR_NO_DEVICE' was not declared in this scope
{LIBUSB_ERROR_NO_DEVICE, ENODEV},
^~~~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:25:3: error: 'LIBUSB_ERROR_NOT_FOUND' was not declared in this scope
{LIBUSB_ERROR_NOT_FOUND, ENXIO},
^~~~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:26:3: error: 'LIBUSB_ERROR_BUSY' was not declared in this scope
{LIBUSB_ERROR_BUSY, EBUSY},
^~~~~~~~~~~~~~~~~
../src/usb.cpp:27:3: error: 'LIBUSB_ERROR_TIMEOUT' was not declared in this scope
{LIBUSB_ERROR_TIMEOUT, ETIMEDOUT},
^~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:28:3: error: 'LIBUSB_ERROR_OVERFLOW' was not declared in this scope
{LIBUSB_ERROR_OVERFLOW, EIO},
^~~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:28:3: note: suggested alternative: '_GLIBCXX_HAVE_EOVERFLOW'
{LIBUSB_ERROR_OVERFLOW, EIO},
^~~~~~~~~~~~~~~~~~~~~
_GLIBCXX_HAVE_EOVERFLOW
../src/usb.cpp:29:3: error: 'LIBUSB_ERROR_PIPE' was not declared in this scope
{LIBUSB_ERROR_PIPE, EPIPE},
^~~~~~~~~~~~~~~~~
../src/usb.cpp:30:3: error: 'LIBUSB_ERROR_INTERRUPTED' was not declared in this scope
{LIBUSB_ERROR_INTERRUPTED, EINTR},
^~~~~~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:31:3: error: 'LIBUSB_ERROR_NO_MEM' was not declared in this scope
{LIBUSB_ERROR_NO_MEM, ENOMEM},
^~~~~~~~~~~~~~~~~~~
../src/usb.cpp:32:3: error: 'LIBUSB_ERROR_NOT_SUPPORTED' was not declared in this scope
{LIBUSB_ERROR_NOT_SUPPORTED, ENOSYS},
^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:33:1: error: could not convert '{{, 22}, {, 13}, {, 19}, {, 6}, {, 16}, {, 138}, {, 5}, {, 32}, {, 4}, {, 12}, {, 40}}' from '' to 'std::map<int, int>'
};
^
../src/usb.cpp:58:38: error: 'libusb_device_handle' has not been declared
int Transfers::alloc(unsigned count, libusb_device_handle* handle,
^~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:60:22: error: 'libusb_transfer_cb_fn' has not been declared
unsigned timeout, libusb_transfer_cb_fn callback, void* user_data) {
^~~~~~~~~~~~~~~~~~~~~
../src/usb.cpp: In member function 'int Transfers::alloc(unsigned int, int*, unsigned char, unsigned char, size_t, unsigned int, int, void*)':
../src/usb.cpp:62:14: error: request for member 'resize' in '((Transfers*)this)->Transfers::m_transfers', which is of non-class type 'int'
m_transfers.resize(count, NULL);
^~~~~~
../src/usb.cpp:64:25: error: invalid types 'int[size_t {aka unsigned int}]' for array subscript
auto t = m_transfers[i] = libusb_alloc_transfer(0);
^
../src/usb.cpp:64:29: error: 'libusb_alloc_transfer' was not declared in this scope
auto t = m_transfers[i] = libusb_alloc_transfer(0);
^~~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:64:29: note: suggested alternative: 'libusb_to_errno'
auto t = m_transfers[i] = libusb_alloc_transfer(0);
^~~~~~~~~~~~~~~~~~~~~
libusb_to_errno
../src/usb.cpp:68:14: error: 'LIBUSB_TRANSFER_FREE_BUFFER' was not declared in this scope
t->flags = LIBUSB_TRANSFER_FREE_BUFFER;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/usb.cpp: At global scope:
../src/usb.cpp:82:24: error: variable or field 'failed' declared void
void Transfers::failed(libusb_transfer* t)
^~~~~~~~~~~~~~~
../src/usb.cpp:82:24: error: 'libusb_transfer' was not declared in this scope
../src/usb.cpp:82:24: note: suggested alternative: 'libusb_to_errno'
void Transfers::failed(libusb_transfer* t)
^~~~~~~~~~~~~~~
libusb_to_errno
../src/usb.cpp:82:41: error: 't' was not declared in this scope
void Transfers::failed(libusb_transfer* t)
^
../src/usb.cpp:82:41: note: suggested alternative: 'tm'
void Transfers::failed(libusb_transfer* t)
^
tm
../src/usb.cpp: In member function 'void Transfers::clear()':
../src/usb.cpp:94:15: error: 'begin' was not declared in this scope
for (auto i: m_transfers) {
^~~~~~~~~~~
../src/usb.cpp:94:15: note: suggested alternative:
In file included from C:/msys64/mingw32/include/c++/7.4.0/vector:66:0,
from ../src/usb.hpp:12,
from ../src/usb.cpp:7:
C:/msys64/mingw32/include/c++/7.4.0/bits/range_access.h:87:5: note: 'std::begin'
begin(_Tp (&__arr)[_Nm])
^~~~~
../src/usb.cpp:94:15: error: 'end' was not declared in this scope
for (auto i: m_transfers) {
^~~~~~~~~~~
../src/usb.cpp:94:15: note: suggested alternative:
In file included from C:/msys64/mingw32/include/c++/7.4.0/vector:66:0,
from ../src/usb.hpp:12,
from ../src/usb.cpp:7:
C:/msys64/mingw32/include/c++/7.4.0/bits/range_access.h:97:5: note: 'std::end'
end(_Tp (&__arr)[_Nm])
^~~
../src/usb.cpp:95:3: error: 'libusb_free_transfer' was not declared in this scope
libusb_free_transfer(i);
^~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:95:3: note: suggested alternative: 'libusb_errno_or_zero'
libusb_free_transfer(i);
^~~~~~~~~~~~~~~~~~~~
libusb_errno_or_zero
../src/usb.cpp:99:14: error: request for member 'clear' in '((Transfers*)this)->Transfers::m_transfers', which is of non-class type 'int'
m_transfers.clear();
^~~~~
../src/usb.cpp: In member function 'int Transfers::cancel()':
../src/usb.cpp:105:15: error: 'begin' was not declared in this scope
for (auto i: m_transfers) {
^~~~~~~~~~~
../src/usb.cpp:105:15: note: suggested alternative:
In file included from C:/msys64/mingw32/include/c++/7.4.0/vector:66:0,
from ../src/usb.hpp:12,
from ../src/usb.cpp:7:
C:/msys64/mingw32/include/c++/7.4.0/bits/range_access.h:87:5: note: 'std::begin'
begin(_Tp (&__arr)[_Nm])
^~~~~
../src/usb.cpp:105:15: error: 'end' was not declared in this scope
for (auto i: m_transfers) {
^~~~~~~~~~~
../src/usb.cpp:105:15: note: suggested alternative:
In file included from C:/msys64/mingw32/include/c++/7.4.0/vector:66:0,
from ../src/usb.hpp:12,
from ../src/usb.cpp:7:
C:/msys64/mingw32/include/c++/7.4.0/bits/range_access.h:97:5: note: 'std::end'
end(_Tp (&__arr)[_Nm])
^~~
../src/usb.cpp:107:10: error: 'libusb_cancel_transfer' was not declared in this scope
ret = libusb_cancel_transfer(i);
^~~~~~~~~~~~~~~~~~~~~~
../src/usb.cpp:108:27: error: 'LIBUSB_ERROR_NOT_FOUND' was not declared in this scope
if (ret != 0 && ret != LIBUSB_ERROR_NOT_FOUND) {
^~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/usb.cpp:18:0:
../src/usb.cpp:110:69: error: 'libusb_error_name' was not declared in this scope
DEBUG("%s: usb transfer cancelled with status: %s\n", func, libusb_error_name(ret));
^
../src/debug.hpp:14:57: note: in definition of macro 'DEBUG'
#define DEBUG(...) do { if (DEBUG_TEST) fprintf(stderr, VA_ARGS); } while(0);
^~~~~~~~~~~
../src/usb.cpp:110:69: note: suggested alternative: 'libusb_errno_or_zero'
DEBUG("%s: usb transfer cancelled with status: %s\n", func, libusb_error_name(ret));
^
../src/debug.hpp:14:57: note: in definition of macro 'DEBUG'
#define DEBUG(...) do { if (DEBUG_TEST) fprintf(stderr, VA_ARGS); } while(0);
^~~~~~~~~~~
[2/46] Building CXX object src/CMakeFiles/smu.dir/session.cpp.obj
FAILED: src/CMakeFiles/smu.dir/session.cpp.obj
C:\msys64\mingw32\bin\g++.exe -Dsmu_EXPORTS -I../include -IC:/msys64/mingw32/include -isystem C:/libusb-mingw/include/libusb-1.0 -Wall -pedantic -std=c++11 -Wno-format-extra-args -fopenmp -O3 -DNDEBUG -MD -MT src/CMakeFiles/smu.dir/session.cpp.obj -MF src\CMakeFiles\smu.dir\session.cpp.obj.d -o src/CMakeFiles/smu.dir/session.cpp.obj -c ../src/session.cpp
In file included from ../src/device_m1000.hpp:23:0,
from ../src/session.cpp:17:
../src/usb.hpp:30:15: error: 'libusb_transfer' was not declared in this scope
std::vector<libusb_transfer*> m_transfers;
^~~~~~~~~~~~~~~
../src/usb.hpp:30:15: note: suggested alternative: 'libusb_to_errno'
std::vector<libusb_transfer*> m_transfers;
^~~~~~~~~~~~~~~
libusb_to_errno
../src/usb.hpp:30:31: error: template argument 1 is invalid
std::vector<libusb_transfer*> m_transfers;
^
../src/usb.hpp:30:31: error: template argument 2 is invalid
../src/usb.hpp:35:29: error: 'libusb_device_handle' has not been declared
int alloc(unsigned count, libusb_device_handle* handle,
^~~~~~~~~~~~~~~~~~~~
../src/usb.hpp:37:23: error: 'libusb_transfer_cb_fn' has not been declared
unsigned timeout, libusb_transfer_cb_fn callback, void* user_data);
^~~~~~~~~~~~~~~~~~~~~
../src/usb.hpp:41:15: error: 'libusb_transfer' has not been declared
void failed(libusb_transfer* t);
^~~~~~~~~~~~~~~
../src/usb.hpp:56:23: error: 'libusb_transfer' was not declared in this scope
typedef std::vector<libusb_transfer*>::iterator iterator;
^~~~~~~~~~~~~~~
../src/usb.hpp:56:23: note: suggested alternative: 'm_transfers'
typedef std::vector<libusb_transfer*>::iterator iterator;
^~~~~~~~~~~~~~~
m_transfers
../src/usb.hpp:56:39: error: template argument 1 is invalid
typedef std::vector<libusb_transfer*>::iterator iterator;
^
../src/usb.hpp:56:39: error: template argument 2 is invalid
../src/usb.hpp:56:42: error: typedef name may not be a nested-name-specifier
typedef std::vector<libusb_transfer*>::iterator iterator;
^~~~~~~~
../src/usb.hpp:56:42: error: expected ';' at end of member declaration
../src/usb.hpp:56:51: error: declaration does not declare anything [-fpermissive]
typedef std::vector<libusb_transfer*>::iterator iterator;
^~~~~~~~
../src/usb.hpp:57:23: error: 'libusb_transfer' was not declared in this scope
typedef std::vector<libusb_transfer*>::const_iterator const_iterator;
^~~~~~~~~~~~~~~
../src/usb.hpp:57:23: note: suggested alternative: 'm_transfers'
typedef std::vector<libusb_transfer*>::const_iterator const_iterator;
^~~~~~~~~~~~~~~
m_transfers
../src/usb.hpp:57:39: error: template argument 1 is invalid
typedef std::vector<libusb_transfer*>::const_iterator const_iterator;
^
../src/usb.hpp:57:39: error: template argument 2 is invalid
../src/usb.hpp:57:42: error: typedef name may not be a nested-name-specifier
typedef std::vector<libusb_transfer*>::const_iterator const_iterator;
^~~~~~~~~~~~~~
../src/usb.hpp:57:42: error: expected ';' at end of member declaration
../src/usb.hpp:57:57: error: declaration does not declare anything [-fpermissive]
typedef std::vector<libusb_transfer*>::const_iterator const_iterator;
^~~~~~~~~~~~~~
../src/usb.hpp: In member function 'size_t Transfers::size()':
../src/usb.hpp:53:38: error: request for member 'size' in '((Transfers*)this)->Transfers::m_transfers', which is of non-class type 'int'
size_t size() { return m_transfers.size(); }
^~~~
In file included from ../src/device_m1000.hpp:24:0,
from ../src/session.cpp:17:
../include/libsmu/libsmu.hpp: At global scope:
../include/libsmu/libsmu.hpp:227:35: error: 'libusb_device' was not declared in this scope
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:227:35: note: suggested alternative: 'libusb_to_errno'
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~~~~~~~~
libusb_to_errno
../include/libsmu/libsmu.hpp:227:49: error: template argument 1 is invalid
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^
../include/libsmu/libsmu.hpp:227:49: error: template argument 2 is invalid
../include/libsmu/libsmu.hpp:227:35: error: 'libusb_device' was not declared in this scope
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:227:35: note: suggested alternative: 'libusb_to_errno'
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~~~~~~~~
libusb_to_errno
../include/libsmu/libsmu.hpp:227:49: error: template argument 1 is invalid
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^
../include/libsmu/libsmu.hpp:227:49: error: template argument 2 is invalid
../include/libsmu/libsmu.hpp:227:35: error: 'libusb_device' was not declared in this scope
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:227:35: note: suggested alternative: 'libusb_to_errno'
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~~~~~~~~
libusb_to_errno
../include/libsmu/libsmu.hpp:227:49: error: template argument 1 is invalid
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^
../include/libsmu/libsmu.hpp:227:49: error: template argument 2 is invalid
../include/libsmu/libsmu.hpp:227:28: error: 'std::vector' is not a type
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~
../include/libsmu/libsmu.hpp:227:34: error: expected ',' or '...' before '<' token
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^
../include/libsmu/libsmu.hpp:242:17: error: 'libusb_device' has not been declared
void attached(libusb_device* usb_dev);
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:244:17: error: 'libusb_device' has not been declared
void detached(libusb_device* usb_dev);
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:292:3: error: 'libusb_context' does not name a type; did you mean 'libusb_to_errno'?
libusb_context* m_usb_ctx;
^~~~~~~~~~~~~~
libusb_to_errno
../include/libsmu/libsmu.hpp:295:3: error: 'libusb_hotplug_callback_handle' does not name a type
libusb_hotplug_callback_handle m_usb_cb;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:306:11: error: expected ';' at end of member declaration
Device* probe_device(libusb_device* usb_dev);
^~~~~~~~~~~~
../include/libsmu/libsmu.hpp:306:37: error: expected ')' before '' token
Device probe_device(libusb_device* usb_dev);
^
../include/libsmu/libsmu.hpp:313:11: error: expected ';' at end of member declaration
Device* find_existing_device(libusb_device* usb_dev);
^~~~~~~~~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:313:45: error: expected ')' before '' token
Device find_existing_device(libusb_device* usb_dev);
^
In file included from ../src/device_m1000.hpp:24:0,
from ../src/session.cpp:17:
../include/libsmu/libsmu.hpp:451:22: error: 'libusb_device' has not been declared
Device(Session* s, libusb_device* usb_dev, libusb_device_handle* usb_handle,
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:451:46: error: 'libusb_device_handle' has not been declared
Device(Session* s, libusb_device* usb_dev, libusb_device_handle* usb_handle,
^~~~~~~~~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:496:3: error: 'libusb_device' does not name a type; did you mean 'libusb_to_errno'?
libusb_device* const m_usb_dev = NULL;
^~~~~~~~~~~~~
libusb_to_errno
../include/libsmu/libsmu.hpp:498:3: error: 'libusb_device_handle' does not name a type; did you mean 'sl_device_info'?
libusb_device_handle* m_usb = NULL;
^~~~~~~~~~~~~~~~~~~~
sl_device_info
In file included from ../src/session.cpp:17:0:
../src/device_m1000.hpp:42:30: error: expected initializer before 'm1000_in_completion'
extern "C" void LIBUSB_CALL m1000_in_completion(libusb_transfer t);
^~~~~~~~~~~~~~~~~~~
../src/device_m1000.hpp:43:30: error: expected initializer before 'm1000_out_completion'
extern "C" void LIBUSB_CALL m1000_out_completion(libusb_transfer t);
^~~~~~~~~~~~~~~~~~~~
../src/device_m1000.hpp:48:22: error: 'libusb_transfer' has not been declared
void in_completion(libusb_transfer t);
^~~~~~~~~~~~~~~
../src/device_m1000.hpp:50:23: error: 'libusb_transfer' has not been declared
void out_completion(libusb_transfer t);
^~~~~~~~~~~~~~~
../src/device_m1000.hpp:72:15: error: variable or field 'LIBUSB_CALL' declared void
friend void LIBUSB_CALL m1000_in_completion(libusb_transfer t);
^~~~~~~~~~~
../src/device_m1000.hpp:72:15: error: expected ';' at end of member declaration
../src/device_m1000.hpp:72:47: error: 'libusb_transfer' has not been declared
friend void LIBUSB_CALL m1000_in_completion(libusb_transfer t);
^~~~~~~~~~~~~~~
../src/device_m1000.hpp:73:15: error: variable or field 'LIBUSB_CALL' declared void
friend void LIBUSB_CALL m1000_out_completion(libusb_transfer t);
^~~~~~~~~~~
../src/device_m1000.hpp:73:15: error: expected ';' at end of member declaration
../src/device_m1000.hpp:73:48: error: 'libusb_transfer' has not been declared
friend void LIBUSB_CALL m1000_out_completion(libusb_transfer t);
^~~~~~~~~~~~~~~
../src/device_m1000.hpp:118:28: error: 'libusb_device' has not been declared
M1000_Device(Session s, libusb_device d, libusb_device_handle h,
^~~~~~~~~~~~~
../src/device_m1000.hpp:118:46: error: 'libusb_device_handle' has not been declared
M1000_Device(Session s, libusb_device d, libusb_device_handle h,
^~~~~~~~~~~~~~~~~~~~
../src/device_m1000.hpp:133:27: error: 'libusb_transfer' has not been declared
void handle_in_transfer(libusb_transfer t);
^~~~~~~~~~~~~~~
../src/device_m1000.hpp:136:28: error: 'libusb_transfer' has not been declared
void handle_out_transfer(libusb_transfer t);
^~~~~~~~~~~~~~~
../src/device_m1000.hpp:139:27: error: 'libusb_transfer' has not been declared
int submit_out_transfer(libusb_transfer* t);
^~~~~~~~~~~~~~~
../src/device_m1000.hpp:142:26: error: 'libusb_transfer' has not been declared
int submit_in_transfer(libusb_transfer* t);
^~~~~~~~~~~~~~~
../src/session.cpp:27:28: error: expected initializer before 'usb_hotplug_callback'
extern "C" int LIBUSB_CALL usb_hotplug_callback(
^~~~~~~~~~~~~~~~~~~~
../src/session.cpp: In constructor 'smu::Session::Session()':
../src/session.cpp:55:21: error: 'm_usb_ctx' was not declared in this scope
ret = libusb_init(&m_usb_ctx);
^~~~~~~~~
../src/session.cpp:55:8: error: 'libusb_init' was not declared in this scope
ret = libusb_init(&m_usb_ctx);
^~~~~~~~~~~
../src/session.cpp:55:8: note: suggested alternative: 'mbsinit'
ret = libusb_init(&m_usb_ctx);
^~~~~~~~~~~
mbsinit
In file included from ../src/session.cpp:16:0:
../src/session.cpp:57:51: error: 'libusb_error_name' was not declared in this scope
DEBUG("%s: libusb init failed: %s\n", func, libusb_error_name(ret));
^
../src/debug.hpp:14:57: note: in definition of macro 'DEBUG'
#define DEBUG(...) do { if (DEBUG_TEST) fprintf(stderr, VA_ARGS); } while(0);
^~~~~~~~~~~
../src/session.cpp:57:51: note: suggested alternative: 'libusb_errno_or_zero'
DEBUG("%s: libusb init failed: %s\n", func, libusb_error_name(ret));
^
../src/debug.hpp:14:57: note: in definition of macro 'DEBUG'
#define DEBUG(...) do { if (DEBUG_TEST) fprintf(stderr, VA_ARGS); } while(0);
^~~~~~~~~~~
../src/session.cpp:65:28: error: 'LIBUSB_CAP_HAS_HOTPLUG' was not declared in this scope
if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {
^~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp:65:6: error: 'libusb_has_capability' was not declared in this scope
if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {
^~~~~~~~~~~~~~~~~~~~~
../src/session.cpp:68:5: error: 'libusb_hotplug_event' was not declared in this scope
(libusb_hotplug_event)(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT),
^~~~~~~~~~~~~~~~~~~~
../src/session.cpp:68:5: note: suggested alternative: 'libusb_to_errno'
(libusb_hotplug_event)(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT),
^~~~~~~~~~~~~~~~~~~~
libusb_to_errno
../src/session.cpp:68:27: error: 'LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED' was not declared in this scope
(libusb_hotplug_event)(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp:68:65: error: 'LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT' was not declared in this scope
(libusb_hotplug_event)(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp:69:5: error: 'libusb_hotplug_flag' was not declared in this scope
(libusb_hotplug_flag) 0,
^~~~~~~~~~~~~~~~~~~
../src/session.cpp:70:4: error: 'LIBUSB_HOTPLUG_MATCH_ANY' was not declared in this scope
LIBUSB_HOTPLUG_MATCH_ANY,
^~~~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp:73:4: error: 'usb_hotplug_callback' was not declared in this scope
usb_hotplug_callback,
^~~~~~~~~~~~~~~~~~~~
../src/session.cpp:73:4: note: suggested alternative: 'hotplug_attach'
usb_hotplug_callback,
^~~~~~~~~~~~~~~~~~~~
hotplug_attach
../src/session.cpp:75:5: error: 'm_usb_cb' was not declared in this scope
&m_usb_cb);
^~~~~~~~
../src/session.cpp:66:9: error: 'libusb_hotplug_register_callback' was not declared in this scope
ret = libusb_hotplug_register_callback(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp:66:9: note: suggested alternative: 'm_hotplug_detach_callbacks'
ret = libusb_hotplug_register_callback(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_hotplug_detach_callbacks
In file included from ../src/session.cpp:16:0:
../src/session.cpp:77:77: error: 'libusb_error_name' was not declared in this scope
DEBUG("%s: libusb hotplug callback registration failed: %s\n", func, libusb_error_name(ret));
^
../src/debug.hpp:14:57: note: in definition of macro 'DEBUG'
#define DEBUG(...) do { if (DEBUG_TEST) fprintf(stderr, VA_ARGS); } while(0);
^~~~~~~~~~~
../src/session.cpp:77:77: note: suggested alternative: 'libusb_errno_or_zero'
DEBUG("%s: libusb hotplug callback registration failed: %s\n", func, libusb_error_name(ret));
^
../src/debug.hpp:14:57: note: in definition of macro 'DEBUG'
#define DEBUG(...) do { if (DEBUG_TEST) fprintf(stderr, VA_ARGS); } while(0);
^~~~~~~~~~~
../src/session.cpp: In lambda function:
../src/session.cpp:90:4: error: 'libusb_handle_events_timeout_completed' was not declared in this scope
libusb_handle_events_timeout_completed(m_usb_ctx, const_cast<timeval >(&zero_tv), NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp: In constructor 'smu::Session::Session()':
../src/session.cpp:107:3: error: 'libusb_set_debug' was not declared in this scope
libusb_set_debug(m_usb_ctx, 4);
^~~~~~~~~~~~~~~~
../src/session.cpp:107:3: note: suggested alternative: 'libusb_to_errno'
libusb_set_debug(m_usb_ctx, 4);
^~~~~~~~~~~~~~~~
libusb_to_errno
../src/session.cpp: In destructor 'smu::Session::~Session()':
../src/session.cpp:115:37: error: 'm_usb_ctx' was not declared in this scope
libusb_hotplug_deregister_callback(m_usb_ctx, m_usb_cb);
^~~~~~~~~
../src/session.cpp:115:48: error: 'm_usb_cb' was not declared in this scope
libusb_hotplug_deregister_callback(m_usb_ctx, m_usb_cb);
^~~~~~~~
../src/session.cpp:115:2: error: 'libusb_hotplug_deregister_callback' was not declared in this scope
libusb_hotplug_deregister_callback(m_usb_ctx, m_usb_cb);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp:115:2: note: suggested alternative: 'm_hotplug_detach_callbacks'
libusb_hotplug_deregister_callback(m_usb_ctx, m_usb_cb);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_hotplug_detach_callbacks
../src/session.cpp:140:2: error: 'libusb_exit' was not declared in this scope
libusb_exit(m_usb_ctx);
^~~~~~~~~~~
../src/session.cpp: At global scope:
../src/session.cpp:153:24: error: variable or field 'attached' declared void
void Session::attached(libusb_device usb_dev)
^~~~~~~~~~~~~
../src/session.cpp:153:24: error: 'libusb_device' was not declared in this scope
../src/session.cpp:153:24: note: suggested alternative: 'libusb_to_errno'
void Session::attached(libusb_device usb_dev)
^~~~~~~~~~~~~
libusb_to_errno
../src/session.cpp:153:39: error: 'usb_dev' was not declared in this scope
void Session::attached(libusb_device usb_dev)
^~~~~~~
../src/session.cpp:172:24: error: variable or field 'detached' declared void
void Session::detached(libusb_device usb_dev)
^~~~~~~~~~~~~
../src/session.cpp:172:24: error: 'libusb_device' was not declared in this scope
../src/session.cpp:172:24: note: suggested alternative: 'libusb_to_errno'
void Session::detached(libusb_device usb_dev)
^~~~~~~~~~~~~
libusb_to_errno
../src/session.cpp:172:39: error: 'usb_dev' was not declared in this scope
void Session::detached(libusb_device usb_dev)
^~~~~~~
../src/session.cpp:190:29: error: variable or field 'samba_usb_write' declared void
static void samba_usb_write(libusb_device_handle usb_handle, const char data) {
^~~~~~~~~~~~~~~~~~~~
../src/session.cpp:190:29: error: 'libusb_device_handle' was not declared in this scope
../src/session.cpp:190:29: note: suggested alternative: 'sl_device_info'
static void samba_usb_write(libusb_device_handle usb_handle, const char data) {
^~~~~~~~~~~~~~~~~~~~
sl_device_info
../src/session.cpp:190:51: error: 'usb_handle' was not declared in this scope
static void samba_usb_write(libusb_device_handle usb_handle, const char data) {
^~~~~~~~~~
../src/session.cpp:190:63: error: expected primary-expression before 'const'
static void samba_usb_write(libusb_device_handle usb_handle, const char data) {
^~~~~
../src/session.cpp:200:28: error: variable or field 'samba_usb_read' declared void
static void samba_usb_read(libusb_device_handle usb_handle, unsigned char data) {
^~~~~~~~~~~~~~~~~~~~
../src/session.cpp:200:28: error: 'libusb_device_handle' was not declared in this scope
../src/session.cpp:200:28: note: suggested alternative: 'sl_device_info'
static void samba_usb_read(libusb_device_handle usb_handle, unsigned char data) {
^~~~~~~~~~~~~~~~~~~~
sl_device_info
../src/session.cpp:200:50: error: 'usb_handle' was not declared in this scope
static void samba_usb_read(libusb_device_handle usb_handle, unsigned char data) {
^~~~~~~~~~
../src/session.cpp:200:62: error: expected primary-expression before 'unsigned'
static void samba_usb_read(libusb_device_handle usb_handle, unsigned char data) {
^~~~~~~~
../src/session.cpp:209:42: error: 'libusb_device' was not declared in this scope
int Session::scan_samba_devs(std::vector<libusb_device>& samba_devs)
^~~~~~~~~~~~~
../src/session.cpp:209:42: note: suggested alternative: 'probe_device'
int Session::scan_samba_devs(std::vector<libusb_device>& samba_devs)
^~~~~~~~~~~~~
probe_device
../src/session.cpp:209:56: error: template argument 1 is invalid
int Session::scan_samba_devs(std::vector<libusb_device>& samba_devs)
^
../src/session.cpp:209:56: error: template argument 2 is invalid
../src/session.cpp:209:42: error: 'libusb_device' was not declared in this scope
int Session::scan_samba_devs(std::vector<libusb_device>& samba_devs)
^~~~~~~~~~~~~
../src/session.cpp:209:42: note: suggested alternative: 'probe_device'
int Session::scan_samba_devs(std::vector<libusb_device>& samba_devs)
^~~~~~~~~~~~~
probe_device
../src/session.cpp:209:56: error: template argument 1 is invalid
int Session::scan_samba_devs(std::vector<libusb_device>& samba_devs)
^
../src/session.cpp:209:56: error: template argument 2 is invalid
../src/session.cpp:209:42: error: 'libusb_device' was not declared in this scope
int Session::scan_samba_devs(std::vector<libusb_device>& samba_devs)
^~~~~~~~~~~~~
../src/session.cpp:209:42: note: suggested alternative: 'probe_device'
int Session::scan_samba_devs(std::vector<libusb_device*>& samba_devs)
^~~~~~~~~~~~~
probe_device
../src/session.cpp:209:56: error: template argument 1 is invalid
int Session::scan_samba_devs(std::vector<libusb_device*>& samba_devs)
^
../src/session.cpp:209:56: error: template argument 2 is invalid
../src/session.cpp:209:35: error: 'int smu::Session::scan_samba_devs' is not a static data member of 'class smu::Session'
int Session::scan_samba_devs(std::vector<libusb_device*>& samba_devs)
^~~~~~
../src/session.cpp:209:42: error: 'libusb_device' was not declared in this scope
int Session::scan_samba_devs(std::vector<libusb_device*>& samba_devs)
^~~~~~~~~~~~~
../src/session.cpp:209:42: note: suggested alternative: 'probe_device'
int Session::scan_samba_devs(std::vector<libusb_device*>& samba_devs)
^~~~~~~~~~~~~
probe_device
../src/session.cpp:209:56: error: template argument 1 is invalid
int Session::scan_samba_devs(std::vector<libusb_device*>& samba_devs)
^
../src/session.cpp:209:56: error: template argument 2 is invalid
../src/session.cpp:209:59: error: 'samba_devs' was not declared in this scope
int Session::scan_samba_devs(std::vector<libusb_device*>& samba_devs)
^~~~~~~~~~
../src/session.cpp:209:59: note: suggested alternative: 'scan_samba_devs'
int Session::scan_samba_devs(std::vector<libusb_device*>& samba_devs)
^~~~~~~~~~
scan_samba_devs
../src/session.cpp: In member function 'int smu::Session::flash_firmware(std::__cxx11::string, std::vectorsmu::Device*)':
../src/session.cpp:260:26: error: 'libusb_device' has not been declared
auto flash_device = [&](libusb_device usb_dev) {
^~~~~~~~~~~~~
../src/session.cpp: In lambda function:
../src/session.cpp:261:3: error: 'libusb_device_handle' was not declared in this scope
libusb_device_handle usb_handle = NULL;
^~~~~~~~~~~~~~~~~~~~
../src/session.cpp:261:3: note: suggested alternative: 'sl_device_info'
libusb_device_handle usb_handle = NULL;
^~~~~~~~~~~~~~~~~~~~
sl_device_info
../src/session.cpp:261:25: error: 'usb_handle' was not declared in this scope
libusb_device_handle usb_handle = NULL;
^~~~~~~~~~
../src/session.cpp:261:25: note: suggested alternative: 'usb_dev'
libusb_device_handle usb_handle = NULL;
^~~~~~~~~~
usb_dev
../src/session.cpp:267:9: error: 'libusb_open' was not declared in this scope
ret = libusb_open(usb_dev, &usb_handle);
^~~~~~~~~~~
../src/session.cpp:267:9: note: suggested alternative: 'libusb_to_errno'
ret = libusb_open(usb_dev, &usb_handle);
^~~~~~~~~~~
libusb_to_errno
../src/session.cpp:269:55: error: use of enum 'libusb_error' without previous declaration
std::string libusb_error_str(libusb_strerror((enum libusb_error)ret));
^~~~~~~~~~~~
../src/session.cpp:269:33: error: 'libusb_strerror' was not declared in this scope
std::string libusb_error_str(libusb_strerror((enum libusb_error)ret));
^~~~~~~~~~~~~~~
../src/session.cpp:269:33: note: suggested alternative: 'libusb_to_errno'
std::string libusb_error_str(libusb_strerror((enum libusb_error)ret));
^~~~~~~~~~~~~~~
libusb_to_errno
../src/session.cpp:276:3: error: 'libusb_claim_interface' was not declared in this scope
libusb_claim_interface(usb_handle, 1);
^~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp:279:32: error: 'samba_usb_write' was not declared in this scope
auto samba_write = std::bind(samba_usb_write, usb_handle, _1);
^~~~~~~~~~~~~~~
../src/session.cpp:279:32: note: suggested alternative: 'samba_write'
auto samba_write = std::bind(samba_usb_write, usb_handle, _1);
^~~~~~~~~~~~~~~
samba_write
../src/session.cpp:280:31: error: 'samba_usb_read' was not declared in this scope
auto samba_read = std::bind(samba_usb_read, usb_handle, usb_data);
^~~~~~~~~~~~~~
../src/session.cpp:280:31: note: suggested alternative: 'samba_read'
auto samba_read = std::bind(samba_usb_read, usb_handle, usb_data);
^~~~~~~~~~~~~~
samba_read
../src/session.cpp:332:3: error: 'libusb_release_interface' was not declared in this scope
libusb_release_interface(usb_handle, 1);
^~~~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp:333:3: error: 'libusb_close' was not declared in this scope
libusb_close(usb_handle);
^~~~~~~~~~~~
../src/session.cpp:333:3: note: suggested alternative: 'libusb_to_errno'
libusb_close(usb_handle);
^~~~~~~~~~~~
libusb_to_errno
../src/session.cpp: In member function 'int smu::Session::flash_firmware(std::__cxx11::string, std::vectorsmu::Device*)':
../src/session.cpp:356:14: error: 'libusb_device' was not declared in this scope
std::vector<libusb_device> samba_devs;
^~~~~~~~~~~~~
../src/session.cpp:356:14: note: suggested alternative: 'flash_device'
std::vector<libusb_device> samba_devs;
^~~~~~~~~~~~~
flash_device
../src/session.cpp:356:28: error: template argument 1 is invalid
std::vector<libusb_device> samba_devs;
^
../src/session.cpp:356:28: error: template argument 2 is invalid
../src/session.cpp:369:29: error: invalid types 'int[int]' for array subscript
flash_device(samba_devs[i]);
^
../src/session.cpp: In member function 'int smu::Session::scan()':
../src/session.cpp:411:2: error: 'libusb_device' was not declared in this scope
libusb_device usb_devs;
^~~~~~~~~~~~~
../src/session.cpp:411:2: note: suggested alternative: 'probe_device'
libusb_device usb_devs;
^~~~~~~~~~~~~
probe_device
../src/session.cpp:411:18: error: 'usb_devs' was not declared in this scope
libusb_device usb_devs;
^~~~~~~~
../src/session.cpp:412:40: error: 'm_usb_ctx' was not declared in this scope
device_count = libusb_get_device_list(m_usb_ctx, &usb_devs);
^~~~~~~~~
../src/session.cpp:412:17: error: 'libusb_get_device_list' was not declared in this scope
device_count = libusb_get_device_list(m_usb_ctx, &usb_devs);
^~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp:419:41: error: expression cannot be used as a function
Device dev = probe_device(usb_devs[i]);
^
../src/session.cpp:428:2: error: 'libusb_free_device_list' was not declared in this scope
libusb_free_device_list(usb_devs, 1);
^~~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp: At global scope:
../src/session.cpp:432:31: error: 'smu::Device smu::Session::probe_device' is not a static data member of 'class smu::Session'
Device Session::probe_device(libusb_device usb_dev)
^~~~~~~~~~~~~
../src/session.cpp:432:31: error: 'libusb_device' was not declared in this scope
../src/session.cpp:432:31: note: suggested alternative: 'probe_device'
Device Session::probe_device(libusb_device usb_dev)
^~~~~~~~~~~~~
probe_device
../src/session.cpp:432:46: error: 'usb_dev' was not declared in this scope
Device Session::probe_device(libusb_device usb_dev)
^~~~~~~
../src/session.cpp:476:39: error: 'smu::Device* smu::Session::find_existing_device' is not a static data member of 'class smu::Session'
Device* Session::find_existing_device(libusb_device* usb_dev)
^~~~~~~~~~~~~
../src/session.cpp:476:39: error: 'libusb_device' was not declared in this scope
../src/session.cpp:476:39: note: suggested alternative: 'probe_device'
Device* Session::find_existing_device(libusb_device* usb_dev)
^~~~~~~~~~~~~
probe_device
../src/session.cpp:476:54: error: 'usb_dev' was not declared in this scope
Device* Session::find_existing_device(libusb_device* usb_dev)
^~~~~~~
../src/session.cpp: In member function 'int smu::Session::cancel()':
../src/session.cpp:678:19: error: 'LIBUSB_TRANSFER_CANCELLED' was not declared in this scope
m_cancellation = LIBUSB_TRANSFER_CANCELLED;
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/session.cpp: In member function 'void smu::Session::handle_error(int, const char*)':
../src/session.cpp:691:42: error: 'LIBUSB_TRANSFER_CANCELLED' was not declared in this scope
if ((m_cancellation == 0) && (status != LIBUSB_TRANSFER_CANCELLED) ) {
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/session.cpp:16:0:
../src/session.cpp:692:59: error: 'libusb_error_name' was not declared in this scope
DEBUG("%s: error condition at %s: %s\n", func, tag, libusb_error_name(status));
^
../src/debug.hpp:14:57: note: in definition of macro 'DEBUG'
#define DEBUG(...) do { if (DEBUG_TEST) fprintf(stderr, VA_ARGS); } while(0);
^~~~~~~~~~~
../src/session.cpp:692:59: note: suggested alternative: 'libusb_errno_or_zero'
DEBUG("%s: error condition at %s: %s\n", func, tag, libusb_error_name(status));
^
../src/debug.hpp:14:57: note: in definition of macro 'DEBUG'
#define DEBUG(...) do { if (DEBUG_TEST) fprintf(stderr, VA_ARGS); } while(0);
^~~~~~~~~~~
[3/46] Building CXX object src/CMakeFiles/smu.dir/signal.cpp.obj
FAILED: src/CMakeFiles/smu.dir/signal.cpp.obj
C:\msys64\mingw32\bin\g++.exe -Dsmu_EXPORTS -I../include -IC:/msys64/mingw32/include -isystem C:/libusb-mingw/include/libusb-1.0 -Wall -pedantic -std=c++11 -Wno-format-extra-args -fopenmp -O3 -DNDEBUG -MD -MT src/CMakeFiles/smu.dir/signal.cpp.obj -MF src\CMakeFiles\smu.dir\signal.cpp.obj.d -o src/CMakeFiles/smu.dir/signal.cpp.obj -c ../src/signal.cpp
In file included from ../src/signal.cpp:12:0:
../include/libsmu/libsmu.hpp:227:35: error: 'libusb_device' was not declared in this scope
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:227:49: error: template argument 1 is invalid
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^
../include/libsmu/libsmu.hpp:227:49: error: template argument 2 is invalid
../include/libsmu/libsmu.hpp:227:35: error: 'libusb_device' was not declared in this scope
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:227:49: error: template argument 1 is invalid
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^
../include/libsmu/libsmu.hpp:227:49: error: template argument 2 is invalid
../include/libsmu/libsmu.hpp:227:35: error: 'libusb_device' was not declared in this scope
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:227:49: error: template argument 1 is invalid
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^
../include/libsmu/libsmu.hpp:227:49: error: template argument 2 is invalid
../include/libsmu/libsmu.hpp:227:28: error: 'std::vector' is not a type
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^~~~~~
../include/libsmu/libsmu.hpp:227:34: error: expected ',' or '...' before '<' token
int scan_samba_devs(std::vector<libusb_device*>& samba_devs);
^
../include/libsmu/libsmu.hpp:242:17: error: 'libusb_device' has not been declared
void attached(libusb_device* usb_dev);
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:244:17: error: 'libusb_device' has not been declared
void detached(libusb_device* usb_dev);
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:292:3: error: 'libusb_context' does not name a type
libusb_context* m_usb_ctx;
^~~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:295:3: error: 'libusb_hotplug_callback_handle' does not name a type
libusb_hotplug_callback_handle m_usb_cb;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:306:11: error: expected ';' at end of member declaration
Device* probe_device(libusb_device* usb_dev);
^~~~~~~~~~~~
../include/libsmu/libsmu.hpp:306:37: error: expected ')' before '' token
Device probe_device(libusb_device* usb_dev);
^
../include/libsmu/libsmu.hpp:313:11: error: expected ';' at end of member declaration
Device* find_existing_device(libusb_device* usb_dev);
^~~~~~~~~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:313:45: error: expected ')' before '' token
Device find_existing_device(libusb_device* usb_dev);
^
In file included from ../src/signal.cpp:12:0:
../include/libsmu/libsmu.hpp:451:22: error: 'libusb_device' has not been declared
Device(Session* s, libusb_device* usb_dev, libusb_device_handle* usb_handle,
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:451:46: error: 'libusb_device_handle' has not been declared
Device(Session* s, libusb_device* usb_dev, libusb_device_handle* usb_handle,
^~~~~~~~~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:496:3: error: 'libusb_device' does not name a type
libusb_device* const m_usb_dev = NULL;
^~~~~~~~~~~~~
../include/libsmu/libsmu.hpp:498:3: error: 'libusb_device_handle' does not name a type; did you mean 'sl_device_info'?
libusb_device_handle* m_usb = NULL;
^~~~~~~~~~~~~~~~~~~~
sl_device_info
ninja: build stopped: subcommand failed.
Some of the errors seem to be related to libusb. I have C:\libusb-mingw installed to the computer by the way from here: http://swdownloads.analog.com/cse/build/libusb-1.0-hp.7z .
Inside C:\libusb-mingw do you have a single folder named libusb-1.0-hp or multiple folders like: include, static, MinGW32 ? If you have a single folder, you need to copy everything inside it below C:\libusb-mingw.
In the build script, the explicit path to libusb is given, and it's something like: C:\libusb-mingw\MinGW32\static\libusb-1.0.a . So, if you have a folder libusb-1.0-hp, this path will fail.
Couldn't find any differences between the log files you provided and the ones I have locally. Based on the errors, it looks to me like the libusb.h file inside C:\libusb-mingw\include\libusb-1.0 has some problems or it's not properly included in usb.hpp. I downloaded the libusb archive again, to be 100% sure we both have the same version and it still works for me. Could you also send the C:\libusb-mingw\include\libusb-1.0\libusb.h file, just to take a look if anything doesn't look ok?
include.zip
There doesn't seem to be a C:\libusb-mingw\include\libusb-1.0 just C:\libusb-mingw\include\libusb
The above zip is everything below include
Hi down loaded a new copy of libusb-1.0-hp.7z from here: http://swdownloads.analog.com/cse/build/libusb-1.0-hp.7z . And when I used WinRAR to extract the files I get these messages:
! C:\Users\Doug\Documents\GNU MCU Build\libusb-1.0-hp.7z: Unknown method in include\libusb-1.0\libusb.h
! C:\Users\Doug\Documents\GNU MCU Build\libusb-1.0-hp.7z: Unknown method in libusb-1.0-hp\include\libusb-1.0\libusb.h
! C:\Users\Doug\Documents\GNU MCU Build\libusb-1.0-hp.7z: Unknown method in libusb-1.0\libusb.h
! C:\Users\Doug\Documents\GNU MCU Build\libusb-1.0-hp.7z: Unknown method in libusb.h
! C:\Users\Doug\Documents\GNU MCU Build\libusb-1.0-hp.7z: Unknown method in libusb-1.0-hp\MinGW32\static\libusb-1.0.a
! C:\Users\Doug\Documents\GNU MCU Build\libusb-1.0-hp.7z: Unknown method in libusb-1.0.a
! C:\Users\Doug\Documents\GNU MCU Build\libusb-1.0-hp.7z: Unknown method in MinGW32\static\libusb-1.0.a
! C:\Users\Doug\Documents\GNU MCU Build\libusb-1.0-hp.7z: Unknown method in static\libusb-1.0.a
! C:\Users\Doug\Documents\GNU MCU Build\libusb-1.0-hp.7z: Error - operation failed
Probably the cause of the missing stuff in libusb?
The cmake command tries to point libsmu to libusb using the following path for the include files: C:\libusb-mingw\include\libusb-1.0. If the folder does not exist, or does not contain a libusb.h, then libsmu will not find some needed symbols and will fail during build.
We extracted the libusb archive using the latest WinRAR and got the following folder structure: