I know what linking errors are, no need to explain to me. this is an annoying one though. I think its something wrong with LLVM. The entire project is on github, compile it and run for yourself if you want.
#Linking Error
21 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
@uneven obsidian
Screenshots!
Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!
void ExecutableModule::write_obj_file(const std::filesystem::path& path)
{
auto target_triple = llvm::sys::getDefaultTargetTriple();
this->module->setTargetTriple(target_triple);
std::string error;
auto target = llvm::TargetRegistry::lookupTarget(target_triple, error);
if (target == nullptr)
{
throw std::runtime_error(error);
}
const char* cpu = "generic";
const char* features = "";
llvm::TargetOptions options;
auto machine = target->createTargetMachine(target_triple, cpu, features, options, llvm::Reloc::PIC_);
// TODO finish
}
click expand to see the logs
I link with LLVM like so:
find_package(LLVM REQUIRED CONFIG)
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
llvm_map_components_to_libnames(LLVM_LIBS support core irreader)
target_link_libraries(requite PRIVATE ${LLVM_LIBS})
I have not had any issues so far until trying to use the target stuff from LLVM in the function write_obj_file. If you try commenting that stuff out, it should compile fine without linking errors.
I think I am missing a component. I used the command line to get a list of all of them
^ need to do horizontal scrolling
After a lot of invetigation I figured out I was indeed missing a component, and it was mc
.solved
++done
.done
oh fine, whatever
just stay open then
!done
!done
good job you baited me
You're looking for !solved
!solved