Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling ResourceFile.cc fails #230

Open
cgervais opened this issue Feb 6, 2024 · 5 comments
Open

Compiling ResourceFile.cc fails #230

cgervais opened this issue Feb 6, 2024 · 5 comments

Comments

@cgervais
Copy link

cgervais commented Feb 6, 2024

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
Copy link
Owner

autc04 commented Feb 8, 2024

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
Copy link
Author

cgervais commented Feb 8, 2024

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
Copy link
Owner

autc04 commented Feb 11, 2024

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
Copy link
Author

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
Copy link

dressupgeekout commented Jul 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants