-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
ERROR: format.cc.o is of type CXX_MODULES
but does not provide a module interface unit or partition
#4255
Comments
If I try to use in in an other project I get this: bash-5.2$ ninja -C build
ninja: Entering directory `build'
[0/1] Re-running CMake...
-- use ccache
-- CPM: fmt-module: Adding package [email protected] (11.0.2 at /Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455)
-- CPM: Adding package fmt-module@ (develop at /Users/clausklein/.cache/CPM/fmt-module/540a12df97be7d01b82964ac4ce4347c33344eb9)
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/clausklein/Workspace/cpp/cxx20/spllog/build
[12/20] Building CXX object CMakeFiles/spllog_configs.dir/Configs/SplLog.cppm.o
FAILED: CMakeFiles/spllog_configs.dir/Configs/SplLog.cppm.o CMakeFiles/spllog_configs.dir/spllog_configs.pcm
/usr/local/bin/ccache /usr/local/opt/llvm/bin/clang++ -DUSE_MODULES -isystem /Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include -Wall -Wextra -Wpedantic -Wno-error -std=gnu++23 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -MD -MT CMakeFiles/spllog_configs.dir/Configs/SplLog.cppm.o -MF CMakeFiles/spllog_configs.dir/Configs/SplLog.cppm.o.d @CMakeFiles/spllog_configs.dir/Configs/SplLog.cppm.o.modmap -o CMakeFiles/spllog_configs.dir/Configs/SplLog.cppm.o -c /Users/clausklein/Workspace/cpp/cxx20/spllog/Configs/SplLog.cppm
In file included from /Users/clausklein/Workspace/cpp/cxx20/spllog/Configs/SplLog.cppm:3:
/Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/color.h:570:13: error: no member named 'copy' in namespace 'std'; did you mean 'bcopy'?
570 | out = std::copy(emphasis.begin(), emphasis.end(), out);
| ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/usr/include/_strings.h:71:7: note: 'bcopy' declared here
71 | void bcopy(const void *, void *, size_t) __POSIX_C_DEPRECATED(200112L);
| ^
In file included from /Users/clausklein/Workspace/cpp/cxx20/spllog/Configs/SplLog.cppm:3:
/Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/color.h:576:13: error: no member named 'copy' in namespace 'std'; did you mean 'bcopy'?
576 | out = std::copy(foreground.begin(), foreground.end(), out);
| ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/usr/include/_strings.h:71:7: note: 'bcopy' declared here
71 | void bcopy(const void *, void *, size_t) __POSIX_C_DEPRECATED(200112L);
| ^
In file included from /Users/clausklein/Workspace/cpp/cxx20/spllog/Configs/SplLog.cppm:3:
/Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/color.h:582:13: error: no member named 'copy' in namespace 'std'; did you mean 'bcopy'?
582 | out = std::copy(background.begin(), background.end(), out);
| ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/usr/include/_strings.h:71:7: note: 'bcopy' declared here
71 | void bcopy(const void *, void *, size_t) __POSIX_C_DEPRECATED(200112L);
| ^
In file included from /Users/clausklein/Workspace/cpp/cxx20/spllog/Configs/SplLog.cppm:3:
/Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/color.h:587:13: error: no member named 'copy' in namespace 'std'; did you mean 'bcopy'?
587 | out = std::copy(reset_color.begin(), reset_color.end(), out);
| ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/usr/include/_strings.h:71:7: note: 'bcopy' declared here
71 | void bcopy(const void *, void *, size_t) __POSIX_C_DEPRECATED(200112L);
| ^
4 errors generated.
[13/20] Building CXX object _deps/fmt-module-build/CMakeFiles/fmt.dir/module/fmt.cppm.o
In file included from /Users/clausklein/.cache/CPM/fmt-module/540a12df97be7d01b82964ac4ce4347c33344eb9/module/fmt.cppm:107:
In file included from /Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/args.h:17:
In file included from /Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/format.h:41:
/Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/base.h:17:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
17 | # include <stdio.h> // FILE
| ^
In file included from /Users/clausklein/.cache/CPM/fmt-module/540a12df97be7d01b82964ac4ce4347c33344eb9/module/fmt.cppm:107:
In file included from /Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/args.h:17:
/Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/format.h:59:14: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
59 | # include <bit> // std::bit_cast
| ^
In file included from /Users/clausklein/.cache/CPM/fmt-module/540a12df97be7d01b82964ac4ce4347c33344eb9/module/fmt.cppm:113:
/Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/os.h:20:14: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
20 | # include <xlocale.h> // LC_NUMERIC_MASK on macOS
| ^
/Users/clausklein/.cache/CPM/fmt/cccb77ae9609d2768ed80dd42cec54f77b1f1455/include/fmt/os.h:33:14: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
33 | # include <fcntl.h> // for O_RDONLY
| ^
4 warnings generated.
ninja: build stopped: subcommand failed.
bash-5.2$ |
Could you provide a self-contained repro illustrating what you are trying to do and the problem? Also check out https://vitaut.net/posts/2023/simple-cxx20-modules/. |
Sure; |
I mean without any external projects, just the minimal code snippet and build commands. We are not going to debug your CMake configs. |
It seems to me, the code is a bad mixture between std c++ std code and a c++20
CXX_MODULE
?fmt module
in my own c++20 modules?cmake export config package
?The text was updated successfully, but these errors were encountered: