-
Notifications
You must be signed in to change notification settings - Fork 45
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
Issue with standard headers cstddef on Ubuntu 22.04 #282
Comments
TL;DR: Add this to your command line Full explanation: I've managed to reproduce your issue on Ubuntu Jammy ❯ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy with the following project: main.cpp#include <QCoreApplication>
#include <boost/uuid/uuid.hpp>
namespace my_app {
struct A {};
struct B : public A {};
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
boost::uuids::uuid tag;
return a.exec();
} CMakeLists.txtcmake_minimum_required(VERSION 3.14)
project(issue282 LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
FIND_PACKAGE(Boost REQUIRED)
add_executable(issue282
main.cpp
)
target_link_libraries(issue282 Qt${QT_VERSION_MAJOR}::Core)
target_include_directories(issue282 PUBLIC ${Boost_INCLUDE_DIRS})
include(GNUInstallDirs)
install(TARGETS issue282
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
) .clang-umlcompilation_database_dir: build
output_directory: docs/diagrams
diagrams:
my_app_class_diagram:
type: class
glob:
- "*.cpp"
using_namespace:
- my_app
exclude:
namespaces:
- std Then when I ran clang-uml like this: clang-uml -vvv it worked. However if I added: clang-uml -vvv --query-driver . I was getting the same errors as you. The Fortunately using these low level optimizations can be disabled in Boost, like this (of course this will not affect your actual build - only diagram generation): clang-uml -vvv --add-compile-flag "-DBOOST_UUID_NO_SIMD" You can also try to remove the include flags you added manually from the config and just run: clang-uml -vvv --query-driver . --add-compile-flag "-DBOOST_UUID_NO_SIMD" With the latter on my system I get the diagram: @startuml
class "A" as C_0001961966708590071804
class C_0001961966708590071804 {
__
+tag : boost::uuids::uuid
}
class "B" as C_0000521024381453213179
class C_0000521024381453213179 {
__
}
C_0001961966708590071804 <|-- C_0000521024381453213179
'Generated with clang-uml, version 0.5.2-31-ge21c2d2
'LLVM version Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)
@enduml If this doesn't help please share if possible a sample entry from your |
Many thanks for the fast response. Unfortunately, it didn't solve the issue. I have appended the I have done some additional tests if I add the option Adding the compile flag solves the issue with
|
@TheWorldOfCode That I cannot reproduce - if possible you could try to install newer LLVM (e.g. 17) and rebuild LLVM_VERSION=17 make release and then try with both |
@TheWorldOfCode Also, are you able to reproduce the problem using the above simple project, for instance by modifying the #include <QCoreApplication>
#include <boost/uuid/uuid.hpp>
#include <optional>
namespace my_app {
struct AAA {};
struct A {
boost::uuids::uuid tag;
void foo(const std::optional<AAA> arg1 = std::nullopt) {
}
};
struct B : public A {};
} // namespace my_app
int main(int argc, char *argv[]) {
QCoreApplication a(argc, argv);
return a.exec();
} ? |
Hello
Clang UML is a great tool and I have been using it for a couple of years on work-related projects. We have just updated from Ubuntu Focal to Ubuntu Jammy.
On Ubuntu Jammy it complaining that it cannot locate cstddef when processing boost/uuid/uuid.hpp. When I attempt to solve the issue new errors are generated.
--add-compile-flag '-I/usr/include/c++/11'
--add-compile-flag '-I/usr/include/x86_64-linux-gnu/c++/11'
--add-compile-flag '-I/usr/lib/gcc/x86_64-linux-gnu/11/include
Clang - UML
Configuration dump
The text was updated successfully, but these errors were encountered: