Unknown type name 'va_list'

1.4k views Asked by At

Using Android Studio 4.1 with ndk version 21.3.6528147 and c++, experiencing the following errors during the build process:

  In file included from G:/Repos/JTPieterse/jtpvk/android/jtpvkad/app/src/main/cpp/../../../../../../headers/Instance.hpp:4:
In file included from G:\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\vector:273:
In file included from G:\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\iosfwd:95:
In file included from G:\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\wchar.h:118:
In file included from G:\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\local\include\wchar.h:32:
In file included from G:\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\wchar.h:33:
In file included from G:\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\stdio.h:107:
G:\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\stdio.h:140:45: error: unknown type name 'va_list'; did you mean 'jtpvk::va_list'?

When I open file stdio.h in the editor and click ctrl-b on va_list, it presents the file stdarg.h where the typedef is defined in. So the editor seems to be working correctly. Also there is no definition defined in my project jtpvk for va_list as the question suggests e.g. 'jtpvk::va_list'

Somehow I suspect a path or environment variable that is not set for the compiler/linker.

The above list occurs multiple times as each file is built. Some additional lines:

G:/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include\stdio.h:302:62: error: unknown type name 'va_list'; did you mean 'jtpvk::va_list'?

  int vsnprintf(char* __buf, size_t __size, const char* __fmt, va_list __args) __printflike(3, 0);   

G:\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\9.0.8\include\stdarg.h:14:27: note: 'jtpvk::va_list' declared here
  typedef __builtin_va_list va_list;  G:/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include\stdio.h:303:49: error: unknown type name 'va_list'; did you mean 'jtpvk::va_list'?
  int vsscanf(const char* __s, const char* __fmt, va_list __args) __scanflike(2, 0);
                                                  ^
  G:\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\9.0.8\include\stdarg.h:14:27: note: 'jtpvk::va_list' declared here
  typedef __builtin_va_list va_list;  

fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.  

ninja: build stopped: subcommand failed.

Instance.hpp:

#pragma once

#include <VkLib.hpp>
#include <vector>
#include "Confirm.hpp"
#include "Settings.hpp"

namespace jtpvk
{
  class Instance
  {
  public:

    auto vk_instance() -> VkInstance;

    auto initialize(Settings* settings_p) -> void;

    auto finalize() -> void;

    auto create() -> void;

    auto add_layers(std::vector<const char*> instance_layers_p)->void;

  private:
    Settings* settings_m = nullptr;

    VkInstance vk_instance_m = nullptr;

    std::vector<const char*> instance_layers_m = {};

    static auto create_application_info()->VkApplicationInfo;

    static auto create_info()->VkInstanceCreateInfo;
  };
}
0

There are 0 answers