a8jan / fujinet-pc

FujiNet firmware port to Linux, MacOS and Windows
GNU General Public License v3.0
17 stars 15 forks source link

Build fails on ArchLinux #5

Closed MrAureliusR closed 5 months ago

MrAureliusR commented 8 months ago

Almost at the very end of the build... and then it fails with this error: (followed directions in README exactly)

[ 95%] Building CXX object CMakeFiles/fujinet.dir/lib/slip/ReadBlockRequest.cpp.o
/home/amr/sources/fujinet-pc/lib/slip/ReadBlockRequest.cpp: In member function ‘void ReadBlockRequest::set_block_number_from_ptr(const uint8_t*, size_t)’:
/home/amr/sources/fujinet-pc/lib/slip/ReadBlockRequest.cpp:41:14: error: ‘copy_n’ is not a member of ‘std’; did you mean ‘copy’?
   41 |         std::copy_n(ptr + offset, block_number_.size(), block_number_.begin());
      |              ^~~~~~
      |              copy
make[2]: *** [CMakeFiles/fujinet.dir/build.make:2064: CMakeFiles/fujinet.dir/lib/slip/ReadBlockRequest.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:264: CMakeFiles/fujinet.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

This looks like it might be a GCC version or glibc version thing -- I don't know CMake very well, does it explicitly declare a C++ standard to build to?

MrAureliusR commented 8 months ago

At first glance, it looks like ReadBlockRequest.h needs #include <algorithm> and then that line needs to be changed to std:::copy_n() ... going to give that a try. EDIT: Nope, same error. Strange as std::copy_n is defined in <algorithm> according to all the docs I can see, unless this codebase has defined its own version?

EDIT 2: I read the error wrong! It was for the next file. So adding #include <algorithm> to the headers for those cpp files fixed the issue. I can make a pull request if desired!

a8jan commented 7 months ago

Thank you for reporting that. There was lot of activities in a past days and I'm behind with updating the doc. Major change is that the fujinet-pc code was merged into main fujinet-firmware repository. I've added missing algorithm includes into fujinet-pc repository to fix the errors. However the proper repository for fujinet firmware inluding fuijinet-pc is now at: https://github.com/FujiNetWIFI/fujinet-firmware I will update build instructions soon. For now if you want to build from that repository, there is a build script part of repo. It can be used to get FujiNet-PC :

cd fujinet-firmware
# build FN-PC for ATARI target
build.sh -p ATARI
# or build FN-PC for APPLE target
build.sh -p APPLE
# result is always in build/dist subdirectory