Skip to content

Compilation issues on latest llvm 19 #9

@ghost

Description

[build] /usr/bin/ld: tooling/CMakeFiles/metareflect.dir/reflect.cpp.o:(.data.rel.ro._ZTI11ClassFinder[_ZTI11ClassFinder]+0x10): undefined reference to `typeinfo for clang::ast_matchers::MatchFinder::MatchCallback'
[build] /usr/bin/ld: tooling/CMakeFiles/metareflect.dir/reflect.cpp.o:(.data.rel.ro._ZTIZN5clang7tooling24newFrontendActionFactoryINS_12ast_matchers11MatchFinderEEESt10unique_ptrINS0_21FrontendActionFactoryESt14default_deleteIS5_EEPT_PNS0_19SourceFileCallbacksEE28FrontendActionFactoryAdapter[_ZTIZN5clang7tooling24newFrontendActionFactoryINS_12ast_matchers11MatchFinderEEESt10unique_ptrINS0_21FrontendActionFactoryESt14default_deleteIS5_EEPT_PNS0_19SourceFileCallbacksEE28FrontendActionFactoryAdapter]+0x10): undefined reference to `typeinfo for clang::tooling::FrontendActionFactory'
[build] /usr/bin/ld: tooling/CMakeFiles/metareflect.dir/reflect.cpp.o:(.data.rel.ro._ZTIZN5clang7tooling24newFrontendActionFactoryINS_12ast_matchers11MatchFinderEEESt10unique_ptrINS0_21FrontendActionFactoryESt14default_deleteIS5_EEPT_PNS0_19SourceFileCallbacksEEN28FrontendActionFactoryAdapter22ConsumerFactoryAdaptorE[_ZTIZN5clang7tooling24newFrontendActionFactoryINS_12ast_matchers11MatchFinderEEESt10unique_ptrINS0_21FrontendActionFactoryESt14default_deleteIS5_EEPT_PNS0_19SourceFileCallbacksEEN28FrontendActionFactoryAdapter22ConsumerFactoryAdaptorE]+0x10): undefined reference to `typeinfo for clang::ASTFrontendAction'
[build] clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[build] ninja: build stopped: subcommand failed.
[proc] The command: cmake --build metareflect/build --config Debug --target all -- exited with code: 1
[driver] Build completed: 00:00:04.742
[build] Build finished with exit code 1

I added all the libs I could find, but the error remains. What am I missing?

target_link_libraries(metareflect
    PRIVATE
    clangBasic
    clangFrontend
    clangSerialization
    clangTooling
    clangFrontend
    clangSerialization
    clangDriver
    clangParse
    clangSema
    clangAnalysis
    clangAST
    clangASTMatchers
    clangDynamicASTMatchers
    clangBasic
    clangEdit
    clangLex
    clangTooling
    LLVMBitstreamReader
    LLVMRemarks
    LLVMBinaryFormat
    LLVMCore
    LLVMipo
    LLVMScalarOpts
    LLVMInstCombine
    LLVMFrontendDriver
    LLVMTransformUtils
    LLVMAnalysis
    LLVMTarget
    LLVMOption
    LLVMMCParser
    LLVMMC 
    LLVMObject 
    LLVMBitReader
    LLVMCore
    LLVMSupport
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions