ve been developing a C++ application designated to work on Linux SO, I've tested my application on Ubuntu 20.04.2 LTS, Kali GNU/Linux Rolling 2021.3 and it work correctly but I'm getting some compile problem on my Raspberry Pi, with Raspbian GNU/Linux 10 (buster).
Compilation is done through a Makefile:
pi2@raspberrypi:~/Desktop/program $ make
...
...
/usr/include/c++/8/bits/stl_uninitialized.h:115:5: note: parameter passing for argument of type ‘std::move_iterator<Frame*>’ changed in GCC 7.1
/usr/include/c++/8/bits/stl_uninitialized.h:134:15: note: parameter passing for argument of type ‘std::move_iterator<Frame*>’ changed in GCC 7.1
return std::__uninitialized_copy<__is_trivial(_ValueType1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&& __is_trivial(_ValueType2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&& __assignable>::
~~~~~~~~~~~~~~~~~~
__uninit_copy(__first, __last, __result);
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/8/bits/stl_uninitialized.h: In static member function ‘static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator<Frame*>; _ForwardIterator = Frame*; bool _TrivialValueTypes = false]’:
/usr/include/c++/8/bits/stl_uninitialized.h:76:9: note: parameter passing for argument of type ‘std::move_iterator<Frame*>’ changed in GCC 7.1
__uninit_copy(_InputIterator __first, _InputIterator __last,
^~~~~~~~~~~~~
/usr/include/c++/8/bits/stl_uninitialized.h:76:9: note: parameter passing for argument of type ‘std::move_iterator<Frame*>’ changed in GCC 7.1
/usr/bin/ld: /tmp/ccRXo7Xc.o: in function `get_last_log[abi:cxx11](int)':
/home/pi/Desktop/luca_rpi_development/Parsing_log.cpp:8: undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: /home/pi/Desktop/luca_rpi_development/Parsing_log.cpp:8: undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: /tmp/ccRXo7Xc.o: in function `std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&)':
/usr/include/c++/8/bits/fs_dir.h:361: undefined reference to `std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*)'
/usr/bin/ld: /tmp/ccRXo7Xc.o: in function `std::filesystem::__cxx11::path::path<char [3], std::filesystem::__cxx11::path>(char const (&) [3], std::filesystem::__cxx11::path::format)':
/usr/include/c++/8/bits/fs_path.h:184: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: /tmp/cc5ZCMUE.o: in function `get_ini_file_name[abi:cxx11](int)':
/home/pi/Desktop/luca_rpi_development/utilities.cpp:23: undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: /home/pi/Desktop/luca_rpi_development/utilities.cpp:23: undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: /tmp/cc5ZCMUE.o: in function `get_last_logging_file[abi:cxx11]()':
/home/pi/Desktop/luca_rpi_development/utilities.cpp:39: undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: /home/pi/Desktop/luca_rpi_development/utilities.cpp:39: undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: /tmp/cc5ZCMUE.o: in function `get_ini_files[abi:cxx11]()':
/home/pi/Desktop/luca_rpi_development/utilities.cpp:71: undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: /home/pi/Desktop/luca_rpi_development/utilities.cpp:71: undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: /tmp/cc5ZCMUE.o: in function `std::filesystem::__cxx11::path::path<char [6], std::filesystem::__cxx11::path>(charconst (&) [6], std::filesystem::__cxx11::path::format)':
/usr/include/c++/8/bits/fs_path.h:184: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
collect2: error: ld returned 1 exit status
make: *** [Makefile:11: validNet] Error 1
On some versions of G++ your local cpp files must be referenced before system library flags (This is determined by the build commands of whoever built and maintains the actual G++ binary, so it can change between versions of linux, but rarely changes between updates of G++ or the OS itself, though it could happen in theory if they modify their build scripts or similar).
In your makefile try moving {prog}.cpp and ${FILES.CPP} to the front of the command like this:
> /usr/bin/ld: /tmp/ccRXo7Xc.o: in function `get_last_log[abi:cxx11](int)':
If you're passing in -std=c++17, how come all the linker errors are related to c++11 ?