Created
July 27, 2024 01:39
-
-
Save ObserverHerb/9c3c52f9912ad8c6dce669cb25709feb to your computer and use it in GitHub Desktop.
(clang-19) declaration 'vtkNew' attached to named module can't be attached to other modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.28) | |
project(vtk19 LANGUAGES CXX) | |
set(CMAKE_CXX_STANDARD 23) | |
set(CMAKE_CXX_STANDARD_REQUIRED ON) | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) | |
add_executable(vtk19 main.cpp) | |
find_package(VTK REQUIRED COMPONENTS CommonCore CommonMath ViewsCore RenderingOpenGL2 FiltersTexture) | |
target_link_libraries(vtk19 PRIVATE | |
${VTK_LIBRARIES} | |
) | |
target_sources(vtk19 PUBLIC FILE_SET modules TYPE CXX_MODULES FILES | |
test.cpp | |
one.cpp | |
two.cpp | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
import Test; | |
int main() | |
{ | |
Test(); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module; | |
#include <vtkCubeSource.h> | |
#include <vtkSmartPointer.h> | |
export module Test:One; | |
void TestOne() | |
{ | |
vtkNew<vtkCubeSource> cube; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export module Test; | |
import :One; | |
import :Two; | |
export void Test() | |
{ | |
TestOne(); | |
TestTwo(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module; | |
#include <vtkCubeSource.h> | |
#include <vtkSmartPointer.h> | |
export module Test:Two; | |
void TestTwo() | |
{ | |
vtkNew<vtkCubeSource> cube; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you managed to fix the issue? I encountered the same on a project of mine.