Trying to build on Ubuntu 23.10. Cloned repo, made build directory, ran Cmake twice:
$ cmake -DCMAKE_BUILD_TYPE=Release ..
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
(Note the deprecation warning. Not the big problem, but easy to fix.)
$ make
[ 1%] Building CXX object src/backend/CMakeFiles/lc3core.dir/asm_types.cpp.o
[ 3%] Building CXX object src/backend/CMakeFiles/lc3core.dir/assembler.cpp.o
[ 5%] Building CXX object src/backend/CMakeFiles/lc3core.dir/callback.cpp.o
[ 7%] Building CXX object src/backend/CMakeFiles/lc3core.dir/converter.cpp.o
In file included from /home/aaron/lc3tools/src/backend/converter.cpp:15:
/home/aaron/lc3tools/src/backend/mem.h:18:29: error: expected ‘)’ before ‘value’
18 | MemLocation(uint16_t value, std::string const & line) : MemLocation(value, line, false) { }
| ~ ^~~~~~
| )
/home/aaron/lc3tools/src/backend/mem.h:19:29: error: expected ‘)’ before ‘value’
19 | MemLocation(uint16_t value, std::string const & line, bool is_orig) :
| ~ ^~~~~~
| )
/home/aaron/lc3tools/src/backend/mem.h:22:9: error: ‘uint16_t’ does not name a type
22 | uint16_t getValue(void) const { return value; }
| ^~~~~~~~
/home/aaron/lc3tools/src/backend/mem.h:9:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
8 | #include <iostream>
+++ |+#include <cstdint>
9 |
/home/aaron/lc3tools/src/backend/mem.h:25:23: error: ‘uint16_t’ has not been declared
25 | void setValue(uint16_t value) { this->value = value; }
| ^~~~~~~~
/home/aaron/lc3tools/src/backend/mem.h:33:9: error: ‘uint16_t’ does not name a type
33 | uint16_t value;
| ^~~~~~~~
/home/aaron/lc3tools/src/backend/mem.h:33:9: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/aaron/lc3tools/src/backend/mem.h: In constructor ‘lc3::core::MemLocation::MemLocation()’:
/home/aaron/lc3tools/src/backend/mem.h:17:51: error: no matching function for call to ‘lc3::core::MemLocation::MemLocation(int, const char [1])’
17 | MemLocation(void) : MemLocation(0x0000, "") {}
| ^
/home/aaron/lc3tools/src/backend/mem.h:17:9: note: candidate: ‘lc3::core::MemLocation::MemLocation()’
17 | MemLocation(void) : MemLocation(0x0000, "") {}
| ^~~~~~~~~~~
/home/aaron/lc3tools/src/backend/mem.h:17:9: note: candidate expects 0 arguments, 2 provided
/home/aaron/lc3tools/src/backend/mem.h:14:11: note: candidate: ‘lc3::core::MemLocation::MemLocation(const lc3::core::MemLocation&)’
14 | class MemLocation
| ^~~~~~~~~~~
/home/aaron/lc3tools/src/backend/mem.h:14:11: note: candidate expects 1 argument, 2 provided
/home/aaron/lc3tools/src/backend/mem.h:14:11: note: candidate: ‘lc3::core::MemLocation::MemLocation(lc3::core::MemLocation&&)’
/home/aaron/lc3tools/src/backend/mem.h:14:11: note: candidate expects 1 argument, 2 provided
/home/aaron/lc3tools/src/backend/mem.h: In member function ‘void lc3::core::MemLocation::setValue(int)’:
/home/aaron/lc3tools/src/backend/mem.h:25:47: error: ‘class lc3::core::MemLocation’ has no member named ‘value’
25 | void setValue(uint16_t value) { this->value = value; }
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/c++allocator.h:33,
from /usr/include/c++/13/bits/allocator.h:46,
from /usr/include/c++/13/string:43,
from /usr/include/c++/13/bitset:52,
from /home/aaron/lc3tools/src/backend/converter.cpp:5:
/usr/include/c++/13/bits/new_allocator.h: In instantiation of ‘void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = lc3::core::MemLocation; _Args = {short unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool}; _Tp = lc3::core::MemLocation]’:
/usr/include/c++/13/bits/alloc_traits.h:537:17: required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = lc3::core::MemLocation; _Args = {short unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool}; _Tp = lc3::core::MemLocation; allocator_type = std::allocator<lc3::core::MemLocation>]’
/usr/include/c++/13/bits/vector.tcc:117:30: required from ‘void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {short unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool}; _Tp = lc3::core::MemLocation; _Alloc = std::allocator<lc3::core::MemLocation>]’
/home/aaron/lc3tools/src/backend/converter.cpp:55:30: required from here
/usr/include/c++/13/bits/new_allocator.h:187:11: error: no matching function for call to ‘lc3::core::MemLocation::MemLocation(short unsigned int, std::__cxx11::basic_string<char>&, bool)’
187 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/aaron/lc3tools/src/backend/mem.h:17:9: note: candidate: ‘lc3::core::MemLocation::MemLocation()’
17 | MemLocation(void) : MemLocation(0x0000, "") {}
| ^~~~~~~~~~~
/home/aaron/lc3tools/src/backend/mem.h:17:9: note: candidate expects 0 arguments, 3 provided
/home/aaron/lc3tools/src/backend/mem.h:14:11: note: candidate: ‘lc3::core::MemLocation::MemLocation(const lc3::core::MemLocation&)’
14 | class MemLocation
| ^~~~~~~~~~~
/home/aaron/lc3tools/src/backend/mem.h:14:11: note: candidate expects 1 argument, 3 provided
/home/aaron/lc3tools/src/backend/mem.h:14:11: note: candidate: ‘lc3::core::MemLocation::MemLocation(lc3::core::MemLocation&&)’
/home/aaron/lc3tools/src/backend/mem.h:14:11: note: candidate expects 1 argument, 3 provided
make[2]: *** [src/backend/CMakeFiles/lc3core.dir/build.make:118: src/backend/CMakeFiles/lc3core.dir/converter.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:191: src/backend/CMakeFiles/lc3core.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Build fails.