Skip to content

googletest, POWERSHELL_PATH-NOTFOUND and other errors on Linux #133

Description

@expenses

Here's what happens when I try and build this on Arch Linux:
cmake -S . -B build -G Ninja; and cmake --build build:

FAILED: GeneratedFiles/SchemaJson.h /home/ashley/projects/glTF-SDK/build/GeneratedFiles/SchemaJson.h
cd /home/ashley/projects/glTF-SDK/GLTFSDK && POWERSHELL_PATH-NOTFOUND -ExecutionPolicy Bypass /home/ashley/projects/glTF-SDK/GLTFSDK/GenerateSchemaJsonHeader.ps1 -outPath /home/ashley/projects/glTF-SDK/build/GeneratedFiles
/bin/sh: line 1: POWERSHELL_PATH-NOTFOUND: command not found
[3/55] Building CXX object googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
FAILED: googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
/usr/bin/c++  -I/home/ashley/projects/glTF-SDK/build/googletest-src/googletest/include -I/home/ashley/projects/glTF-SDK/build/googletest-src/googletest -std=c++11 -Wall -Wshadow -Werror -Wno-error=dangling-else -DGTEST_HAS_PTHREAD=1 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -MD -MT googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -MF googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o.d -o googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -c /home/ashley/projects/glTF-SDK/build/googletest-src/googletest/src/gtest-all.cc
In file included from /home/ashley/projects/glTF-SDK/build/googletest-src/googletest/src/gtest-all.cc:42:
/home/ashley/projects/glTF-SDK/build/googletest-src/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/home/ashley/projects/glTF-SDK/build/googletest-src/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
 1301 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/ashley/projects/glTF-SDK/build/googletest-src/googletest/src/gtest-death-test.cc:1290:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here
 1290 | static void StackLowerThanAddress(const void* ptr, bool* result) {
      |             ^~~~~~~~~~~~~~~~~~~~~
/home/ashley/projects/glTF-SDK/build/googletest-src/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here
 1299 |   int dummy;
      |       ^~~~~
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.

The powershell issue can be worked around by installing the powershell-bin AUR package. I'm not sure why I should need to install a special shell to build a SDK like this, but whatever. I then commented out the gtest stuff and tried to build it again:

FAILED: GLTFSDK/CMakeFiles/GLTFSDK.dir/Source/AnimationUtils.cpp.o
/usr/bin/c++  -I/home/ashley/projects/glTF-SDK/GLTFSDK/Inc -I/home/ashley/projects/glTF-SDK/Built/Int -I/home/ashley/projects/glTF-SDK/build/GeneratedFiles -I/home/ashley/projects/glTF-SDK/build/RapidJSON-src/include -O2 -g -DNDEBUG -std=gnu++14 -MD -MT GLTFSDK/CMakeFiles/GLTFSDK.dir/Source/AnimationUtils.cpp.o -MF GLTFSDK/CMakeFiles/GLTFSDK.dir/Source/AnimationUtils.cpp.o.d -o GLTFSDK/CMakeFiles/GLTFSDK.dir/Source/AnimationUtils.cpp.o -c /home/ashley/projects/glTF-SDK/GLTFSDK/Source/AnimationUtils.cpp
In file included from /home/ashley/projects/glTF-SDK/GLTFSDK/Inc/GLTFSDK/GLTFResourceReader.h:8,
                 from /home/ashley/projects/glTF-SDK/GLTFSDK/Source/AnimationUtils.cpp:7:
/home/ashley/projects/glTF-SDK/GLTFSDK/Inc/GLTFSDK/ResourceReaderUtils.h: In function ‘std::vector<unsigned char> Microsoft::glTF::GetDecodeTable()’:
/home/ashley/projects/glTF-SDK/GLTFSDK/Inc/GLTFSDK/ResourceReaderUtils.h:99:56: error: ‘numeric_limits’ is not a member of ‘std’
   99 |             std::vector<uint8_t> decodeTable(128, std::numeric_limits<uint8_t>::max());
      |                                                        ^~~~~~~~~~~~~~
/home/ashley/projects/glTF-SDK/GLTFSDK/Inc/GLTFSDK/ResourceReaderUtils.h:99:78: error: expected primary-expression before ‘>’ token
   99 |             std::vector<uint8_t> decodeTable(128, std::numeric_limits<uint8_t>::max());
      |                                                                              ^
/home/ashley/projects/glTF-SDK/GLTFSDK/Inc/GLTFSDK/ResourceReaderUtils.h:99:81: error: ‘::max’ has not been declared; did you mean ‘std::max’?
   99 |             std::vector<uint8_t> decodeTable(128, std::numeric_limits<uint8_t>::max());
      |                                                                                 ^~~
      |                                                                                 std::max

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions