openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.98k stars 2.55k forks source link

ofSingleton errors in macOS 15, Xcode 16 and M1 #8140

Closed moebiussurfing closed 1 month ago

moebiussurfing commented 1 month ago

I am having these errors:

Screenshot 2024-10-08 at 4 34 54 AM
/Users/manumolina/Documents/of_v20241007_osx_release/libs/openFrameworks/utils/ofSingleton.h:27:9 no member named 'lock_guard' in namespace 'std'

/Users/manumolina/Documents/of_v20241007_osx_release/libs/openFrameworks/utils/ofSingleton.h:27:19 expected ';' after expression

/Users/manumolina/Documents/of_v20241007_osx_release/libs/openFrameworks/utils/ofSingleton.h:27:20 use of undeclared identifier 'lock'; did you mean 'clock'?

/Users/manumolina/Documents/of_v20241007_osx_release/libs/openFrameworks/utils/ofSingleton.h:27:24 expected ';' after expression

/Users/manumolina/Documents/of_v20241007_osx_release/libs/openFrameworks/utils/ofSingleton.h:27:33 expected ';' after expression

/Users/manumolina/Documents/of_v20241007_osx_release/libs/openFrameworks/utils/ofSingleton.h:37:9 no member named 'lock_guard' in namespace 'std'

/Users/manumolina/Documents/of_v20241007_osx_release/libs/openFrameworks/utils/ofSingleton.h:37:19 expected ';' after expression

/Users/manumolina/Documents/of_v20241007_osx_release/libs/openFrameworks/utils/ofSingleton.h:37:20 use of undeclared identifier 'lock'; did you mean 'clock'?

/Users/manumolina/Documents/of_v20241007_osx_release/libs/openFrameworks/utils/ofSingleton.h:37:24 expected ';' after expression

/Users/manumolina/Documents/of_v20241007_osx_release/libs/openFrameworks/utils/ofSingleton.h:37:33 expected ';' after expression

This happens in master branch and of_v20241007_osx_release nigthly build too.

moebiussurfing commented 1 month ago

0.12.0 zip it's working fine.

dimitre commented 1 month ago

this is meant to close this one https://github.com/openframeworks/openFrameworks/pull/8129 cc: @artificiel

dimitre commented 1 month ago

@moebiussurfing can you test this PR? if it fixes for you I'll be merging it

artificiel commented 1 month ago

not yet setup with Xcode 16 unfortunetely (current on a linux run). i will be able to upgrade a MacBook Pro next week.

but the missing include should do the trick!

roymacdonald commented 1 month ago

why do we even have a singleton class in OF´s core? I think that we have not had such a thing on purpose. The C++ guidelines say to avoid these and what they recommend instead can be seen in several places in OF's core.

2bbb commented 1 month ago

@dimitre @artificiel I did build emptyExample (in 20241008_release) with macOS sequoia + Xcode 16, and it succeeds.

fyi: ofSingleton.h exists in utils directory, but ofSingleton.h isn't in file navigator of Xcode.

roymacdonald commented 1 month ago

fyi: ofSingleton.h exists in utils directory, but ofSingleton.h isn't in file navigator of Xcode.

It should not matter since the utils dir is already in the include paths. Maybe it is a good idea to leave "hidden"?

dimitre commented 1 month ago

closed by https://github.com/openframeworks/openFrameworks/pull/8129

moebiussurfing commented 1 month ago

@moebiussurfing can you test this PR? if it fixes for you I'll be merging it

It works now on macOS 14.7.1 and Xcode 16.0.

dimitre commented 1 month ago

@2bbb I've now checked here and ofSingleton.h appears in file navigator of XCode. Just not appearing in OF Core project which uses gray folders (manually added files) instead of OF project blue folders (actually listing files and folders)