Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile errors with VS 2017 #97

Closed
ckaminski opened this issue Apr 2, 2020 · 4 comments
Closed

Compile errors with VS 2017 #97

ckaminski opened this issue Apr 2, 2020 · 4 comments
Assignees

Comments

@ckaminski
Copy link

ckaminski commented Apr 2, 2020

Using the following tools:

Visual C++ 2017 00369-60000-00001-AA270 (Community) 15.8.5

Cmake:
C:\repos\cpp\cppgraphqlgen>"C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" --version
cmake version 3.11.18040201-MSVC_2

I have installed vcpkg with packages gtest, rapidjson, and boost.

Attempting to build cppgraphqlgen gives me the following errors, which I get from my own project schema in both Visual Studio 2017 and 2019. (x86) I have tested versions 3.1.1, 3.2.0 and master

  [16/58] C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1415~1.267\bin\HostX86\x86\cl.exe  /nologo /TP  -Isrc\..\include -IC:\repos\cpp\cppgraphqlgen\src\..\include -IC:\repos\cpp\cppgraphqlgen\src\..\PEGTL\include -IC:\repos\cpp\vcpkg\installed\x86-windows\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Zi /O2 /Ob1 /DNDEBUG   -std:c++17 /showIncludes /Fosrc\CMakeFiles\graphqlservice.dir\__\IntrospectionSchema.cpp.obj /Fdsrc\CMakeFiles\graphqlservice.dir\graphqlservice.pdb /FS -c IntrospectionSchema.cpp
  FAILED: src/CMakeFiles/graphqlservice.dir/__/IntrospectionSchema.cpp.obj 
  C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1415~1.267\bin\HostX86\x86\cl.exe  /nologo /TP  -Isrc\..\include -IC:\repos\cpp\cppgraphqlgen\src\..\include -IC:\repos\cpp\cppgraphqlgen\src\..\PEGTL\include -IC:\repos\cpp\vcpkg\installed\x86-windows\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Zi /O2 /Ob1 /DNDEBUG   -std:c++17 /showIncludes /Fosrc\CMakeFiles\graphqlservice.dir\__\IntrospectionSchema.cpp.obj /Fdsrc\CMakeFiles\graphqlservice.dir\graphqlservice.pdb /FS -c IntrospectionSchema.cpp
C:\repos\cpp\cppgraphqlgen\include\graphqlservice\GraphQLService.h(583): error C3539: a template-argument cannot be a type that contains 'auto'
  IntrospectionSchema.cpp(137): note: see reference to function template instantiation 'std::future<graphql::response::Value> graphql::service::ModifiedResult<graphql::introspection::object::Type>::convert<graphql::service::TypeModifier::List,>(graphql::service::FieldResult<std::vector<std::shared_ptr<graphql::introspection::object::Type>,std::allocator<_Ty>>> &&,graphql::service::ResolverParams &&)' being compiled
          with
          [
              _Ty=std::shared_ptr<graphql::introspection::object::Type>
          ]
  IntrospectionSchema.cpp(137): note: see reference to function template instantiation 'std::future<graphql::response::Value> graphql::service::ModifiedResult<graphql::introspection::object::Type>::convert<graphql::service::TypeModifier::List,>(graphql::service::FieldResult<std::vector<std::shared_ptr<graphql::introspection::object::Type>,std::allocator<_Ty>>> &&,graphql::service::ResolverParams &&)' being compiled
          with
          [
              _Ty=std::shared_ptr<graphql::introspection::object::Type>
          ]
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\type_traits(616): note: see reference to class template instantiation 'std::basic_string_view<char,std::char_traits<char>>' being compiled
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\xstring(2124): note: see reference to class template instantiation 'std::is_convertible<const _StringViewIsh (&),std::basic_string_view<char,std::char_traits<char>>>' being compiled
          with
          [
              _StringViewIsh=char [2]
          ]
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\xstring(2122): note: see reference to variable template 'const bool conjunction_v<std::is_convertible<char const (&)[2],std::basic_string_view<char,std::char_traits<char> > >,std::negation<std::is_convertible<char const (&)[2],char const *> > >' being compiled
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\xstring(3774): note: see reference to alias template instantiation '_Is_string_view_ish<char[2]>' being compiled
C:\repos\cpp\cppgraphqlgen\include\graphqlservice\GraphQLService.h(592): error C2510: 'decay_t<int>': left of '::' must be a class/struct/union
C:\repos\cpp\cppgraphqlgen\include\graphqlservice\GraphQLService.h(583): error C2146: syntax error: missing '>' before identifier 'reference'

I'm assuming I have some environment setup issue wrong here? This seems like something the package authors would have run into, especially since it's pervasive across versions?

Regards!

@wravery
Copy link
Contributor

wravery commented Apr 2, 2020

No, I haven't seen that before, although I've been using VS 2019 all the time and haven't tried VS 2017 in a while.

@wravery wravery self-assigned this Apr 2, 2020
@ckaminski
Copy link
Author

Hello:

I tested master on a clean install on linux, and had no issues building. I'll try a clean install in VS2019 later tonight with a fresh vcpkg install and report back.

Regards,
-Chris

@ckaminski
Copy link
Author

I tested on a fresh VS2019, but was having issues with VS finding the right triplet. It kept wanting to build x64 even though I was a 32bit shell. I gave up and rebuild in 64-bit and cppgraphqlgen built without error. I will retry with my project from scratch in VS2019-x64 instead of VS2017.

I'll close this for now.

Regards.

@wravery wravery changed the title Compile errors with generated schema Compile errors with VS 2017 Apr 9, 2020
@wravery wravery reopened this Apr 9, 2020
@wravery
Copy link
Contributor

wravery commented Apr 9, 2020

Got a repro on another machine with an older version of Visual Studio and found a workaround. It didn't like using std::decay_t<decltype(wrappedResult)> because wrappedResult was declared with auto. It doesn't seem to be problem on any other compilers I've tried, so I think this is specific to VS 2017.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants