Unity WebGL build failed, seems something wrong with il2cpp - unity-webgl

It runs good at a windows platform. But when I switch platform to webgl and build it, there is an error as following. As a beginner of Unity, it hard for me to figure out what happened, so I try to search for some answers. But there seems few similar questions.
Building Library\Bee\artifacts\WebGL\il2cpp\master_WebGL_wasm\9tk2_eric0.lump.o failed with output:
In file included from Library/Bee/artifacts/WebGL/il2cpp/master_WebGL_wasm/ipux_Generic0.lump.cpp:3:
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Generic\WaitObject.cpp:94:36: error: 'SetWaitObject' is a private member of 'il2cpp::os::ThreadImpl'
currentThread->SetWaitObject(this);
^
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Posix\ThreadImpl.h:105:14: note: declared private here
void SetWaitObject(posix::PosixWaitObject* waitObject);
^
In file included from Library/Bee/artifacts/WebGL/il2cpp/master_WebGL_wasm/ipux_Generic0.lump.cpp:3:
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Generic\WaitObject.cpp:94:50: error: cannot initialize a parameter of type 'posix::PosixWaitObject *' with an rvalue of type 'il2cpp::os::WaitObject *'
currentThread->SetWaitObject(this);
^~~~
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Posix\ThreadImpl.h:105:52: note: passing argument to parameter 'waitObject' here
void SetWaitObject(posix::PosixWaitObject* waitObject);
^
In file included from Library/Bee/artifacts/WebGL/il2cpp/master_WebGL_wasm/ipux_Generic0.lump.cpp:3:
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Generic\WaitObject.cpp:148:36: error: 'SetWaitObject' is a private member of 'il2cpp::os::ThreadImpl'
currentThread->SetWaitObject(NULL);
^
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Posix\ThreadImpl.h:105:14: note: declared private here
void SetWaitObject(posix::PosixWaitObject* waitObject);
^
In file included from Library/Bee/artifacts/WebGL/il2cpp/master_WebGL_wasm/ipux_Generic0.lump.cpp:3:
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Generic\WaitObject.cpp:161:36: error: 'SetWaitObject' is a private member of 'il2cpp::os::ThreadImpl'
currentThread->SetWaitObject(NULL);
^
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Posix\ThreadImpl.h:105:14: note: declared private here
void SetWaitObject(posix::PosixWaitObject* waitObject);
^
In file included from Library/Bee/artifacts/WebGL/il2cpp/master_WebGL_wasm/ipux_Generic0.lump.cpp:3:
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Generic\WaitObject.cpp:227:17: error: no member named 'AcquireSemaphore' in 'il2cpp::os::ThreadImpl'
thread->AcquireSemaphore();
~~~~~~ ^
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Generic\WaitObject.cpp:238:28: error: no member named 'TryTimedAcquireSemaphore' in 'il2cpp::os::ThreadImpl'
bool ret = thread->TryTimedAcquireSemaphore(timeout);
~~~~~~ ^
D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\il2cpp\libil2cpp\os\Generic\WaitObject.cpp:264:33: error: no member named 'ReleaseSemaphore' in 'il2cpp::os::ThreadImpl'
object->thread->ReleaseSemaphore();
~~~~~~~~~~~~~~ ^
7 errors generated.
emcc2: error: 'D:/1installfiles/unity/Editor/2021.3.12f1c1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/llvm\clang++.exe -target wasm32-unknown-emscripten -DEMSCRIPTEN -fno-inline-functions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=19 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=D:\1installfiles\unity\Editor\2021.3.12f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\cache\sysroot -Xclang -iwithsysroot/include\compat -D__webgl__ -Wno-c++11-extensions -Wno-nonportable-include-path -ffunction-sections -fno-unwind-tables -fomit-frame-pointer -fno-threadsafe-statics -std=c++11 -Wno-#warnings -Wswitch -Wno-trigraphs -Wno-tautological-compare -Wno-invalid-offsetof -Wno-implicitly-unsigned-literal -Wno-integer-overflow -Wno-shift-negative-value -Wno-unknown-attributes -Wno-implicit-function-declaration -Wno-null-conversion -Wno-missing-declarations -Wno-unused-value -Wno-pragma-once-outside-header -fvisibility=hidden -fexceptions -fno-rtti -fno-strict-overflow -ffunction-sections -fdata-sections -fmessage-length=0 -pipe -DBASELIB_INLINE_NAMESPACE=il2cpp_baselib -DIL2CPP_MONO_DEBUGGER_DISABLED -DRUNTIME_IL2CPP -DGC_NOT_DLL -DIL2CPP_DEFAULT_DATA_DIR_PATH=Data -DNDEBUG -I. -ID:/1installfiles/unity/Editor/2021.3.12f1c1/Editor/Data/il2cpp/libil2cpp/pch -ID:/1installfiles/unity/Editor/2021.3.12f1c1/Editor/Data/il2cpp/libil2cpp -ID:/1installfiles/unity/Editor/2021.3.12f1c1/Editor/Data/il2cpp/external/baselib/Include -ID:/1installfiles/unity/Editor/2021.3.12f1c1/Editor/Data/il2cpp/external/baselib/Platforms/WebGL/Include -ID:/1installfiles/unity/Editor/2021.3.12f1c1/Editor/Data/il2cpp/external/bdwgc/include -Oz -fcolor-diagnostics -fdiagnostics-absolute-paths -UGC_THREADS -UUSE_MMAP -UUSE_MUNMAP -c -xc++ Library/Bee/artifacts/WebGL/il2cpp/master_WebGL_wasm/ipux_Generic0.lump.cpp -o Library/Bee/artifacts/WebGL/il2cpp/master_WebGL_wasm/9tk2_eric0.lump.o' failed (1)
I tried to change settings in player settings\seeting for webgl. But it didn't work.

Related

build numba from source on Windows 64x machine

I'm trying to build build NUMBA package form its source to generate a wheel out of it. I know there is a wheel for windows but I want to do some test on my local Windows 64X machine. I have installed NUMPY, LLVMLITE dependencies and I'm using MinGW c++ compiler and not visual studio. I get a below error, what am I missing here?
py : C:\Workspace\Python_Runtime\Python\lib\site-packages\setuptools\distutils_patch.py:25:
UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.In Zeile:1 Zeichen:1
+ py setup.py bdist_wheel 2>&1 > error.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (C:\Workspace\Py...tuptools first.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
warnings.warn(TBB not found Using OpenMP from: True running bdist_wheel running build got version from file C:\Workspace\Python_Runtime\numba-0.54.1\numba/_version.py {'version': '0.54.1', 'full': '39aef3deb073a67b0bf121e099ecf5b33d799f40'}
running build_py
running build_ext
building 'numba._dispatcher' extension
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
compile options: '-D__MSVCRT_VERSION__=0x1927 -
IC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\include -
IC:\Workspace\Python_Runtime\Python\include -IC:\Workspace\Python_Runtime\Python\include -c'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1927 -
IC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\include -
IC:\Workspace\Python_Runtime\Python\include -IC:\Workspace\Python_Runtime\Python\include -c
numba/_dispatcher.cpp -o build\temp.win-amd64-3.9\Release\numba\_dispatcher.o
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1927 -
IC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\include -
IC:\Workspace\Python_Runtime\Python\include -IC:\Workspace\Python_Runtime\Python\include -c numba/_hashtable.c -o build\temp.win-amd64-3.9\Release\numba\_hashtable.o
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1927 -
IC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\include -
IC:\Workspace\Python_Runtime\Python\include -IC:\Workspace\Python_Runtime\Python\include -c numba/core/typeconv/typeconv.cpp -o build\temp.win-amd64 3.9\Release\numba\core\typeconv\typeconv.o
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1927 -
IC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\include -
IC:\Workspace\Python_Runtime\Python\include -IC:\Workspace\Python_Runtime\Python\include -c numba/_typeof.c -o build\temp.win-amd64-3.9\Release\numba\_typeof.o
cc1plus.exe: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
numba/_hashtable.c:102:1: warning: '_Numba_hashtable_hash_int' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_hash_int(const void *key)
^
numba/_hashtable.c:108:1: warning: '_Numba_hashtable_hash_ptr' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_hash_ptr(const void *key)
^
numba/_hashtable.c:114:1: warning: '_Numba_hashtable_compare_direct' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_compare_direct(const void *key, const _Numba_hashtable_entry_t *entry)
^
numba/_hashtable.c:133:1: warning: '_Numba_hashtable_new_full' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_new_full(size_t data_size, size_t init_size,
^
numba/_hashtable.c:178:1: warning: '_Numba_hashtable_new' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_new(size_t data_size,
^
numba/_hashtable.c:188:1: warning: '_Numba_hashtable_size' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_size(_Numba_hashtable_t *ht)
^
numba/_hashtable.c:259:1: warning: '_Numba_hashtable_get_entry' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_get_entry(_Numba_hashtable_t *ht, const void *key)
^
numba/_hashtable.c:312:1: warning: '_Numba_hashtable_set' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_set(_Numba_hashtable_t *ht, const void *key,
^
numba/_hashtable.c:354:1: warning: '_Numba_hashtable_get' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_get(_Numba_hashtable_t *ht, const void *key, void *data, size_t data_size)
^
numba/_hashtable.c:368:1: warning: '_Numba_hashtable_pop' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_pop(_Numba_hashtable_t *ht, const void *key, void *data, size_t data_size)
^
numba/_hashtable.c:377:1: warning: '_Numba_hashtable_delete' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_delete(_Numba_hashtable_t *ht, const void *key)
^
numba/_hashtable.c:391:1: warning: '_Numba_hashtable_foreach' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_foreach(_Numba_hashtable_t *ht,
^
numba/_hashtable.c:451:1: warning: '_Numba_hashtable_clear' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_clear(_Numba_hashtable_t *ht)
^
numba/_hashtable.c:470:1: warning: '_Numba_hashtable_destroy' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_destroy(_Numba_hashtable_t *ht)
^
numba/_hashtable.c:491:1: warning: '_Numba_hashtable_copy' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_copy(_Numba_hashtable_t *src)
^
In file included from C:/Program Files/R/Rtools/mingw_64/x86_64-w64 mingw32/include/c++/cassert:43:0,
from numba/_dispatcher.cpp:5:
numba/_dispatcher.cpp: In function 'PyObject* call_cfunc(Dispatcher*, PyObject*, PyObject*, PyObject*, PyObject*)':
numba/_dispatcher.cpp:383:41: warning: suggest parentheses around comparison in operand of '|' [-Wparentheses]
assert(PyCFunction_GET_FLAGS(cfunc) == METH_VARARGS | METH_KEYWORDS);
^
g++ -g -shared build\temp.win-amd64-3.9\Release\numba\_dispatcher.o build\temp.win-amd64 3.9\Release\numba\_hashtable.o build\temp.win-amd64-3.9\Release\numba\_typeof.o build\temp.win amd64-3.9\Release\numba\core\typeconv\typeconv.o -
LC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\lib -
LC:\Workspace\Python_Runtime\Python\libs -LC:\Workspace\Python_Runtime\Python\PCbuild\amd64 -lnpymath -lpython39 -o build\lib.win-amd64-3.9\numba\_dispatcher.cp39-win_amd64.pyd build\temp.win-amd64-3.9\Release\numba\_typeof.o: In function `typecode_using_fingerprint': C:\Workspace\Python_Runtime\numba-0.54.1/numba/_typeof.c:617: undefined reference to `__imp__Numba_hashtable_get'
C:\Workspace\Python_Runtime\numba-0.54.1/numba/_typeof.c:639: undefined reference to `__imp__Numba_hashtable_set' build\temp.win-amd64-3.9\Release\numba\_typeof.o: In function `typeof_init':
C:\Workspace\Python_Runtime\numba-0.54.1/numba/_typeof.c:1115: undefined reference to `__imp__Numba_hashtable_new'
collect2.exe: error: ld returned 1 exit status
error: Command "g++ -g -shared build\temp.win-amd64-3.9\Release\numba\_dispatcher.o build\temp.win-amd64-3.9\Release\numba\_hashtable.o build\temp.win-amd64 3.9\Release\numba\_typeof.o build\temp.win-amd64-3.9\Release\numba\core\typeconv\typeconv.o
-LC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\lib -
LC:\Workspace\Python_Runtime\Python\libs -LC:\Workspace\Python_Runtime\Python\PCbuild\amd64 -lnpymath -lpython39 -o build\lib.win-amd64-3.9\numba\_dispatcher.cp39-win_amd64.pyd" failed with
exit status 1

Error building CXX object gnuradio-runtime

I am trying to install a specific version of gnuradio (3.7.10.1). To do so I am not using Pybombs, but I try to do it from source (I am following this).
First I've cloned the github repository, then checkout the appropriate version. It worked fine until I've tried to invoke CMake and build GNU Radio:
mkdir build
cd build
cmake ../
make
During the make, after 6% done, I have the following error:
In file included from /usr/include/c++/7/type_traits:35:0,
from /usr/include/cppunit/tools/StringHelper.h:7,
from /usr/include/cppunit/TestAssert.h:8,
from /usr/include/cppunit/TestCase.h:6,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/c++/7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
^~~~~
In file included from /usr/include/cppunit/TestAssert.h:8:0,
from /usr/include/cppunit/TestCase.h:6,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/tools/StringHelper.h:22:15: error: ‘enable_if’ in namespace ‘std’ does not name a template type
typename std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x)
^~~~~~~~~
/usr/include/cppunit/tools/StringHelper.h:22:24: error: expected unqualified-id before ‘<’ token
typename std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x)
^
/usr/include/cppunit/tools/StringHelper.h:31:15: error: ‘enable_if’ in namespace ‘std’ does not name a template type
typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x)
^~~~~~~~~
/usr/include/cppunit/tools/StringHelper.h:31:24: error: expected unqualified-id before ‘<’ token
typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x)
In file included from /usr/include/cppunit/TestCase.h:6:0,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestAssert.h: In static member function ‘static std::__cxx11::string CppUnit::assertion_traits<T>::toString(const T&)’:
/usr/include/cppunit/TestAssert.h:74:42: error: ‘toString’ is not a member of ‘CppUnit::StringHelper’
return CPPUNIT_NS::StringHelper::toString(x);
^~~~~~~~
In file included from /usr/include/cppunit/extensions/HelperMacros.h:9:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestCaller.h: At global scope:
/usr/include/cppunit/TestCaller.h:159:37: error: ‘std::function’ has not been declared
TestCaller(std::string name, std::function<void()> test_function, Fixture* fixture):
^~~~~~~~
/usr/include/cppunit/TestCaller.h:159:45: error: expected ‘,’ or ‘...’ before ‘<’ token
TestCaller(std::string name, std::function<void()> test_function, Fixture* fixture):
^
/usr/include/cppunit/TestCaller.h:200:8: error: ‘function’ in namespace ‘std’ does not name a template type
std::function<void()> m_test_function;
^~~~~~~~
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod)’:
/usr/include/cppunit/TestCaller.h:121:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, m_fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:121:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, m_fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:121:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, m_fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod, Fixture&)’:
/usr/include/cppunit/TestCaller.h:138:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, &fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:138:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, &fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:138:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, &fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod, Fixture*)’:
/usr/include/cppunit/TestCaller.h:155:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:155:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:155:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, int)’:
/usr/include/cppunit/TestCaller.h:162:17: error: ‘fixture’ was not declared in this scope
m_fixture(fixture),
^~~~~~~
/usr/include/cppunit/TestCaller.h:162:17: note: suggested alternative: ‘Fixture’
m_fixture(fixture),
^~~~~~~
Fixture
/usr/include/cppunit/TestCaller.h:163:7: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function(test_function)
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:163:23: error: ‘test_function’ was not declared in this scope
m_test_function(test_function)
^~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h: In member function ‘void CppUnit::TestCaller<Fixture>::runTest()’:
/usr/include/cppunit/TestCaller.h:175:7: error: there are no arguments to ‘m_test_function’ that depend on a template parameter, so a declaration of ‘m_test_function’ must be available [-fpermissive]
m_test_function();
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:175:7: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from /usr/include/cppunit/extensions/HelperMacros.h:14:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/extensions/TestNamer.h: In member function ‘std::__cxx11::string CppUnit::TestNamer::getTestNameFor(const string&, const E&) const’:
/usr/include/cppunit/extensions/TestNamer.h:70:95: error: ‘toString’ is not a member of ‘CppUnit::StringHelper’
return getTestNameFor(testMethodName) + " with parameter: " + CPPUNIT_NS::StringHelper::toString(val);
^~~~~~~~
In file included from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h: In static member function ‘static CppUnit::TestSuite* qa_fxpt::suite()’:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: ‘unique_ptr’ is not a member of ‘std’
CPPUNIT_TEST_SUITE_END();
^
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: expected primary-expression before ‘>’ token
CPPUNIT_TEST_SUITE_END();
^
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: ‘guard’ was not declared in this scope
CPPUNIT_TEST_SUITE_END();
^
In file included from /usr/include/cppunit/extensions/HelperMacros.h:9:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestCaller.h: In instantiation of ‘void CppUnit::TestCaller<Fixture>::runTest() [with Fixture = qa_fxpt]’:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:102:1: required from here
/usr/include/cppunit/TestCaller.h:175:22: error: ‘m_test_function’ was not declared in this scope
m_test_function();
~~~~~~~~~~~~~~~^~
/usr/include/cppunit/TestCaller.h:175:22: note: suggested alternative: ‘__fortify_function’
m_test_function();
~~~~~~~~~~~~~~~^~
__fortify_function
gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/build.make:62: recipe for target 'gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/math/qa_fxpt.cc.o' failed
make[2]: *** [gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/math/qa_fxpt.cc.o] Error 1
CMakeFiles/Makefile2:726: recipe for target 'gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/all' failed
make[1]: *** [gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
I am not a Linux expert and I am not very familiar to this compiler/library support. I don't really understand where the error comes from and how to correct it.
I use Ubuntu 18.04.
Coud you give me a hand on this please?
Any help would be very appreciated.
Thanks a lot.
/usr/include/c++/7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
To resolve the above error you need to compile with -std=c++11 flag. Open CMakeLists.txt, find all occurrences or -std=c++98 and change them to -std=c++11. Then go to the build directory, remove CMakeCache.txt and rebuild
sed -i 's/-std=c++98/-std=c++11/g' CMakeLists.txt
cd build
rm CMakeCache.txt
cmake ..
make
Also as the error is in the cppunit and it's used for testing you can try disabling all tests
cd build
rm CMakeCache.txt
cmake -DENABLE_TESTING=OFF ..
make

How to link .so library properly in C++?

I have project structure like this,
a.pb.h --- includes --> protobuf.h
b.grpc.pb.h --- includes --> a.pb.h & grpcpp.h
Also there are a.pb.cc and b.grpc.cc files.
A C++ wrapper with extern C which is wrapper.cc and wrapper.h which includes b.grpc.pb.h and grpcpp.h.
The function inside extern C is char* helloWorld(const char*, const char*, const char*);
Creating .o of a.pb.h and b.grpc.pb.h:
g++ -fpic -std=c++11 `pkg-config --cflags protobuf grpc` -c -o a.pb.o a.pb.cc
g++ -fpic -std=c++11 `pkg-config --cflags protobuf grpc` -c -o b.grpc.pb.o b.grpc.pb.cc
Steps to create libcombined.so:
The grpc and protobuf so are already provided under /usr/local/lib.
First created .so of a.pb.o and b.grpc.pb.o to compile wrapper file as:
g++ -shared -o libcombined.so *.o
Compiled wrapper as:
g++ -fpic wrapper.cc -l:./libcombined.so -c -o wrapper.o -std=c++11
.so of a.pb.o, b.grpc.pb.o and wrapper.o as libcombined.so:
g++ -shared -o libcombinedwrapper.so *.o
Compiled main.c as:
gcc main.c -l:./libcombinedwrapper.so -o main -ldl
I am calling helloWorld from my main.c file which is:
#include <stdio.h>
#include <dlfcn.h>
int main(){
char* (*fn)(const char*,const char*,const char*);
void *handle = dlopen("path_to/libcombined.so",RTLD_NOW);
if(handle==NULL){
fprintf(stderr, "Error: %s\n", dlerror());
}
fn = (char* (*)(const char*,const char*,const char*))dlsym(handle, "helloWorld");
if (!fn) {
/* no such symbol */
fprintf(stderr, "Error: %s\n", dlerror());
dlclose(handle);
return 0;
}
char* msg = fn("asd","asdas","asdasd");
printf("%s",msg);
return 0;
}
Error after executing: ./main
Error: path_to/libcombinedwrapper.so: undefined symbol: _ZN6google8protobuf2io20ZeroCopyOutputStream15WriteAliasedRawEPKvi
Error: ./main: undefined symbol: helloWorld
Segmentation fault (core dumped)
The first above error is from symbol from protobuf.h file.
Can someone please suggest what I am doing wrong while linking or is there something I am doing wrong in main.c file?
g++ -shared -o libcombined.so *.o
You need to also link in all dependencies of the objects (libgrpc here).
You can add -Wl,--no-allow-shlib-undefined to verify that libcombined.so is linking everything it needs.
P.S. To avoid core dump, you should exit or return once dlopen fails.
P.P.S. It is generally a very bad idea(TM) to link *.o. Use proper Makefile to avoid unnecessary compilations and explicitly list objects that you are intending to put into libcombined.so.

pip install matplotlib gives error

I use Mac OSX Sierra, and am trying to install matplotlib in python 3.7, and therefore use
pip3.7 install matplotlib
But that gives me an error
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/include -I/usr/X11/include -I/opt/X11/include -I/opt/local/include -I. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/_macosx.m -o build/temp.macosx-10.11-x86_64-3.7/src/_macosx.o
In file included from src/_macosx.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:15: error: expected ';' after #class
#class NSArray<ObjectType>;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:16: error: cannot find protocol declaration for 'ObjectType'
#class NSArray<ObjectType>;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:25: error: cannot find protocol declaration for 'ObjectType'
#interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:37: error: expected identifier or '('
#interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:36:13: error: expected ')'
- (nullable ObjectType)nextObject;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:36:3: note: to match this '('
- (nullable ObjectType)nextObject;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:25: error: cannot find protocol declaration for 'ObjectType'
#interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:1: error: duplicate interface definition for class 'NSEnumerator'
#interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:12: note: previous definition is here
#interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:37: error: method type specifier must start with '-' or '+'
#interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:38: error: expected a type
#interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:1: error: expected selector for Objective-C method
#property (readonly, copy) NSArray<ObjectType> *allObjects;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:36: error: cannot find protocol declaration for 'ObjectType'
#property (readonly, copy) NSArray<ObjectType> *allObjects;
^
In file included from src/_macosx.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:32: error: cannot find protocol declaration for 'ObjectType'
#interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:44: error: expected identifier or '('
#interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:19:4: error: expected a type
- (ObjectType)objectAtIndex:(NSUInteger)index;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:40: error: expected ')'
- (instancetype)initWithObjects:(const ObjectType [])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:33: note: to match this '('
- (instancetype)initWithObjects:(const ObjectType [])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:20: error: cannot find protocol declaration for 'ObjectType'
#interface NSArray<ObjectType> (NSExtendedArray)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:1: error: duplicate interface definition for class 'NSArray'
#interface NSArray<ObjectType> (NSExtendedArray)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:12: note: previous definition is here
#interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:32: error: method type specifier must start with '-' or '+'
#interface NSArray<ObjectType> (NSExtendedArray)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:33: error: expected a type
#interface NSArray<ObjectType> (NSExtendedArray)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for matplotlib
Any suggestions on how to fix this would be really appreciated.

Linking QSsh Botan-2 std::thread

I compiled successfully BOTAN-2 (botan.exe BOTAN-test.exe runnable).
When I build QSsh's Project under Qt Creator I've got a linking error on std::thead (Compiler MinGW32)
rsa.cpp:-1: erreur : undefined reference to std::thread::_State::~_State()
rsa.cpp:-1: erreur : undefined reference to std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())
A added unsuccessfully in the file qssh/src/libs/ssh.pro :
LIBS += -lbotan-2
LIBS += -lpthread
QMAKE_CXXFLAGS += -std=c++11 -pthread
QMAKE_CFLAGS += -std=c++11 -pthread
Note : I made a simple program ("hello world" style) using pthread with success.
g++ main.cpp -o build32/prog.exe -std=c++11 -pthread (MSYS2/MinGW32)
What's wrong with QSsh ?
Thanks

Resources