Xaymar/obs-StreamFX

invalid token at start of a preprocessor expression0.9.0 build failure: implicit instantiation of undefined template; #341

yurivict posted onGitHub

/wrkdirs/usr/ports/multimedia/obs-streamfx/work/obs-StreamFX-0.9.0/source/util/util-curl.hpp:93:9: error: implicit instantiation of undefined template 'std::__1::vector<char, std::__1::allocator<char> >'
                        value.resize(buffer_len);
                             ^
In file included from /wrkdirs/usr/ports/multimedia/obs-streamfx/work/obs-StreamFX-0.9.0/source/configuration.cpp:20:
In file included from /wrkdirs/usr/ports/multimedia/obs-streamfx/work/obs-StreamFX-0.9.0/source/configuration.hpp:21:
In file included from /wrkdirs/usr/ports/multimedia/obs-streamfx/work/obs-StreamFX-0.9.0/source/common.hpp:47:
generated/config.hpp:28:21: error: invalid token at start of a preprocessor expression
#if D_PLATFORM_BITS == 64
                    ^
1 error generated.
  • You apparently use std::vector w/out including <vector>.

I'm not sure what your compiler is struggling with. Are you building with gcc-8/clang-9 or gcc-9/clang-10?

Edit: Nevermind, found the problem. Your compiler is treating the include order differently, and considers header-only code to be its own object file. Despite nlohmann/json.hpp including <vector>, your compiler is opting against messing up that files include order.

posted by Xaymar over 4 years ago

I'm unsure about the preprocessor issue. It seems to struggle with replacing the D_PLATFORM_BITS with something useful, what does your generated config.hpp look like?

posted by Xaymar over 4 years ago
$ cat ./work/.build/generated/config.hpp
// Copyright (c) 2020 Michael Fabian Dirks <info@xaymar.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

// Platform Information
#define D_PLATFORM "FreeBSD"
/* #undef D_PLATFORM_WINDOWS */
/* #undef D_PLATFORM_LINUX */
/* #undef D_PLATFORM_MAC */

#define D_PLATFORM_BITS 
#if D_PLATFORM_BITS == 64
#define D_PLATFORM_64BIT
#else
#define D_PLATFORM_32BIT
#endif
posted by yurivict over 4 years ago

It seems that this test is failing on your compiler for unknown reasons. void* doesn't seem to have a known size - this is a bug in either the compiler or cmake.

posted by Xaymar over 4 years ago

Is this still happening on current master?

posted by Xaymar over 4 years ago

Based on the inactivity, I assume that this has been fixed in some way or another.

posted by Xaymar over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests