• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • About
  • Life
  • Tech
  • Travel
  • Work
  • Questions
  • Contact

Welcome

.

How to use llvm FormatVariadic?

April 10, 2020 by

Questions › How to use llvm FormatVariadic?
0
Vote Up
Vote Down
Garmaine asked 3 years ago

I'm trying to use the llvm framework to output formatted text using the llvm::formatv() function.

E.g. I want to output a double to a llvm raw_ostream, basically using this code:

someStream << llvm::formatv("{0}", someDouble);

I think, that I'm including the right headers for this to work, obviously I need both llvm/Support/raw_ostream.h and llvm/Support/FormatVariadic.h. Additionally I tried to include other headers, like e.g. llvm/Support/FormatAdapters.h.

Unfortunately I'm getting the following error, when I try to build:

Undefined symbols for architecture x86_64:
  "typeinfo for llvm::detail::format_adapter", referenced from:
      typeinfo for llvm::detail::provider_format_adapter<double> in libjuiceDiagnostics.a(Diagnostics.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What could be the problem? Unfortunately the llvm documentation didn't help me with this problem.


If it matters, I'm linking the llvm libraries like this in my CMakeLists.txt:

set(LLVM_CONFIG_CMD "${LLVM_INSTALL_DIR}/bin/llvm-config")
execute_process(COMMAND ${LLVM_CONFIG_CMD} --libfiles
        OUTPUT_VARIABLE LLVM_LIBS
        OUTPUT_STRIP_TRAILING_WHITESPACE)
separate_arguments(LLVM_LIBS)

target_link_libraries(myTarget ${LLVM_LIBS})

Therefore no library should be missing.

Are you looking for the answer?
Original Question and Possible Answers can be found on `http://stackoverflow.com`

Question Tags: c++, linker-errors, llvm-c++-api

Please login or Register to submit your answer




Primary Sidebar

Tags

Advancements architecture beautiful life best building calling city commercial convenience employment Finances Cognitive decline Future gadgets Hidden Gems highway Home houses hydration Impact Innovations lamp lighting Mental health military tech Must-See New York City occupation Productivity recreation romance sepia shopping sippy cups smartphones social Technological breakthroughs technology toddlers Treasures turns Uncover Well-being Wonders Work Young onset dementia

Newsletter

Complete the form below, and we'll send you all the latest news.

Footer

Footer Funnies

Who knew that reading the footer could be such a hilarious adventure? As we navigate websites, books, and documents, we often stumble upon the unassuming space at the bottom, only to discover a treasure trove of amusement. In this side-splitting compilation, we present 100 jokes that celebrate the unsung hero of content – the footer. Get ready to chuckle, giggle, and maybe even snort as we dive into the world of footnotes, disclaimers, and hidden comedic gems. Brace yourself for a wild ride through the footer!

Recent

  • Unveiling the Enigma: Almost-Magical Lamp Lights Highway Turns
  • The Impact of Young Onset Dementia on Employment and Finances: Optimizing Post-Diagnostic Approaches
  • 11 Wonders of 2023 Technological Breakthrough – Unveiling the Future
  • Work from Home and Stay Mentally Sane – Achieve Productivity and Well-being
  • Hidden Gems of New York City – Uncover the Must-See Treasures!

Search

Tags

Advancements architecture beautiful life best building calling city commercial convenience employment Finances Cognitive decline Future gadgets Hidden Gems highway Home houses hydration Impact Innovations lamp lighting Mental health military tech Must-See New York City occupation Productivity recreation romance sepia shopping sippy cups smartphones social Technological breakthroughs technology toddlers Treasures turns Uncover Well-being Wonders Work Young onset dementia

Copyright © 2023