autc04 / Retro68

a gcc-based cross-compiler for classic 68K and PPC Macintoshes
GNU General Public License v3.0
537 stars 51 forks source link

Compiling ResourceFile.cc fails #230

Open cgervais opened 5 months ago

cgervais commented 5 months ago

I'm trying to compile the latest Retro68 on Mac OS X Tiger 10.4.11 on a Titanium PowerBook G4/500MHz. I have Tigerbrew installed with all the dependencies necessary to build Retro68. When using the instructions to build on Tiger, I get the following error:

-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   unit_test_framework
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   filesystem
--   system
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   filesystem
--   system
-- Boost version: 1.58.0
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   system
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/cgervais/Documents/Retro68-build/build-host
[ 67%] Built target ELF
Scanning dependencies of target ResourceFiles
[ 68%] Building CXX object ResourceFiles/CMakeFiles/ResourceFiles.dir/ResourceFile.cc.o
/Users/cgervais/Documents/Retro68/ResourceFiles/ResourceFile.cc: In lambda function:
/Users/cgervais/Documents/Retro68/ResourceFiles/ResourceFile.cc:83:38: error: expected '{' before '->' token
     auto timestamp = std::invoke([&] -> std::chrono::system_clock::time_point {
                                      ^~
/Users/cgervais/Documents/Retro68/ResourceFiles/ResourceFile.cc: In function 'void writeMacBinary(std::ostream&, std::__cxx11::string, ResType, ResType, const Resources&, const string&)':
/Users/cgervais/Documents/Retro68/ResourceFiles/ResourceFile.cc:83:38: error: base operand of '->' has non-pointer type 'writeMacBinary(std::ostream&, std::__cxx11::string, ResType, ResType, const Resources&, const string&)::<lambda()>'
make[2]: *** [ResourceFiles/CMakeFiles/ResourceFiles.dir/ResourceFile.cc.o] Error 1
make[1]: *** [ResourceFiles/CMakeFiles/ResourceFiles.dir/all] Error 2
make: *** [all] Error 2

In a previous life I did a bunch of C++ engineering but have mostly blocked it out with the help of a lot of therapy. I'm not seeing the syntactical issue because I haven't used the style above before, but I patched line 83 to:

auto timestamp = std::invoke([&]() -> std::chrono::system_clock::time_point {

And it will now compile successfully, but I'm not sure if that's the appropriate syntax (again, thanks to therapy). It reveals another compilation error, but I'm investigating that before commenting further.

autc04 commented 5 months ago
auto timestamp = std::invoke([&]() -> std::chrono::system_clock::time_point {

Is fine. The () was made optional in some newer language standard, I'll have to look it up again.

cgervais commented 5 months ago

Is fine. The () was made optional in some newer language standard, I'll have to look it up again.

Cool cool - I can submit a PR at some point (unless you get there first). I'm also dealing with a compilation error related to boost (again, same setup on Tiger) that I'm researching and will submit an issue and/or PR if I can figure it out.

autc04 commented 5 months ago

I'd also be grateful for feedback on how wrong the 'building on tiger' section of the README has become in the meantime, and what the most convenient way to get those dependencies installed currently is.

cgervais commented 5 months ago

I'd also be grateful for feedback on how wrong the 'building on tiger' section of the README has become in the meantime, and what the most convenient way to get those dependencies installed currently is.

You bet -- I'll go through it and see if anything needs to be updated or changed.

dressupgeekout commented 1 day ago

For whatever it's worth, this exact same issue happens on Debian 11 "bullseye", too.

My host compiler is gcc (Debian 10.2.1-6) 10.2.1 20210110

Edit: Also, adding the missing parens like @cgervais previously mentioned was all I needed to do in order for build-toolchain.bash to complete for me.