tomlplusplus: Undefined references linker error on nvc++

Environment

toml++ version and/or commit hash: v3.4.0

Compiler: nvc++ 23.11:

nvc++ 23.11-0 64-bit target on x86-64 Linux -tp tigerlake
NVIDIA Compilers and Tools
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES.  All rights reserved.

C++ standard mode: 17, 20 and 23

Target arch: x64

Library configuration overrides:
None.

Relevant compilation flags:
None.

Describe the bug

Every time I try to use the toml::parse_file function I get those undefined references errors:

/usr/bin/ld: build/.objs/simulator/linux/x86_64/release/src/simulator/util/toml.cpp.o: in function `toml::v3::impl::impl_ex::parser::parse_table_header()':                                                                                                                                 
/home/pablo/.xmake/packages/t/toml++/v3.4.0/305579b325f940cbb9bfa2d2a8effc4b/include/toml++/impl/parser.inl:3269:(.text+0x1872c): undefined reference to `toml::v3::node::is_table() const'                                                                                                 
/usr/bin/ld: /home/pablo/.xmake/packages/t/toml++/v3.4.0/305579b325f940cbb9bfa2d2a8effc4b/include/toml++/impl/parser.inl:3269:(.text+0x18738): undefined reference to `toml::v3::node::is_array_of_tables() const'              

Steps to reproduce (or a small repro code sample)

./example.toml

key = "val"

./main.cpp:

#include <iostream>

#include "toml.hpp"

int main() {
  toml::table t = toml::parse_file("example.toml");
  std::cout << t << std::endl;
}

./toml.hpp: toml v3.4.0 header

Additional information

Perhaps is something related to #198?

About this issue

  • Original URL
  • State: open
  • Created 4 months ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

Haha, of course. What’s some compiler bullshit without a missing (and woefully under-documented) flag?

Nvidia’s toolchain has caused me nothing but misery, honestly.

Yes, last week I had the most fierce battle of my entire career with a compiler (nvc++), and it was just a -cuda flag on the linker.

Great! Very helpful, thanks. I’ll try to make use of it soon.

Nvidia’s toolchain has caused me nothing but misery, honestly.