Skip to content

Can't compile with nvcc 9.0.176 or 10.0.130 #43

Description

@dean-shaff

I'm trying to compile a simple CUDA file using tinytoml:

// test_toml.cu

#include <iostream>

#include "toml.h"

int main ()
{
  std::cerr << "TOML in .cu file!" << std::endl;
  return 0;
}

using

nvcc --std=c++11 test_toml.cu -o test_toml

I get a compiler error like the following:

toml.h: In member function ‘toml::Value toml::internal::Parser::parse()’:
toml.h:1775:24: error: cannot convert ‘toml::Value (*)(toml::Table (*)()) {aka toml::Value (*)(std::map<std::__cxx11::basic_string<char>, toml::Value> (*)())}’ to ‘toml::Value*’ in initialization
     Value* currentValue = &root;
                        ^~~~
toml.h:1782:41: error: no matching function for call to ‘toml::internal::Parser::parseGroupKey(toml::Value (*)(toml::Table (*)()))’
             currentValue = parseGroupKey(&root);
                                         ^
toml.h:356:15: note: candidate: toml::Value* toml::internal::Parser::parseGroupKey(toml::Value*)
     Value* parseGroupKey(Value* root);
               ^~~~~~~~~~~~~
toml.h:356:15: note:   no known conversion for argument 1 from ‘toml::Value (*)(toml::Table (*)()) {aka toml::Value (*)(std::map<std::__cxx11::basic_string<char>, toml::Value> (*)())}’ to ‘toml::Value*’
toml.h: In member function ‘bool toml::internal::Parser::parseInlineTable(toml::Value*)’:
toml.h:2033:7: error: request for member ‘has’ in ‘toml::internal::t’, which is of non-class type ‘toml::Value(toml::Table (*)()) {aka toml::Value(std::map<std::__cxx11::basic_string<char>, toml::Value> (*)())}’
         if (t.has(key)) {
       ^ ~
toml.h:2038:3: error: request for member ‘set’ in ‘toml::internal::t’, which is of non-class type ‘toml::Value(toml::Table (*)()) {aka toml::Value(std::map<std::__cxx11::basic_string<char>, toml::Value> (*)())}’
         t.set(key, v);
   ^
[dshaff@farnarkle1 sandbox]$ nvcc --std=c++11 test_toml.cu -o test_toml
toml.h: In member function ‘toml::Value toml::internal::Parser::parse()’:
toml.h:1775:24: error: cannot convert ‘toml::Value (*)(toml::Table (*)()) {aka toml::Value (*)(std::map<std::__cxx11::basic_string<char>, toml::Value> (*)())}’ to ‘toml::Value*’ in initialization
     Value* currentValue = &root;
                        ^~~~
toml.h:1782:41: error: no matching function for call to ‘toml::internal::Parser::parseGroupKey(toml::Value (*)(toml::Table (*)()))’
             currentValue = parseGroupKey(&root);
                                         ^
toml.h:356:15: note: candidate: toml::Value* toml::internal::Parser::parseGroupKey(toml::Value*)
     Value* parseGroupKey(Value* root);
               ^~~~~~~~~~~~~
toml.h:356:15: note:   no known conversion for argument 1 from ‘toml::Value (*)(toml::Table (*)()) {aka toml::Value (*)(std::map<std::__cxx11::basic_string<char>, toml::Value> (*)())}’ to ‘toml::Value*’
toml.h: In member function ‘bool toml::internal::Parser::parseInlineTable(toml::Value*)’:
toml.h:2033:7: error: request for member ‘has’ in ‘toml::internal::t’, which is of non-class type ‘toml::Value(toml::Table (*)()) {aka toml::Value(std::map<std::__cxx11::basic_string<char>, toml::Value> (*)())}’
         if (t.has(key)) {
       ^ ~
toml.h:2038:3: error: request for member ‘set’ in ‘toml::internal::t’, which is of non-class type ‘toml::Value(toml::Table (*)()) {aka toml::Value(std::map<std::__cxx11::basic_string<char>, toml::Value> (*)())}’
         t.set(key, v);
   ^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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