I use spdlog in my c++ project normally, i meet strange errors, and i don`t know why this happen - fmt

When compile my project, i got there errors, i have no ideas about this error
In file included from /home/wingto/work/openwrt-sdk-g001/package/utils/ricigw/src/../../../..//staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/spdlog/fmt/fmt.h:22:0,
from /home/wingto/work/openwrt-sdk-g001/package/utils/ricigw/src/../../../..//staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/spdlog/common.h:36,
from /home/wingto/work/openwrt-sdk-g001/package/utils/ricigw/src/../../../..//staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/spdlog/spdlog.h:12,
from ./src/common/log/Cspdlog.h:6,
from ./src/include/comm_function.h:15,
from ./src/common/table/TableBase.h:5,
from ./src/common/table/TableUser.h:3,
from ./src/common/sql/RiCiDB.h:3,
from ./src/common/wifi/wifiscan.cpp:3:
/home/wingto/work/openwrt-sdk-g001/package/utils/ricigw/src/../../../..//staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/spdlog/fmt/bundled/core.h: In instantiation of 'fmt::v8::detail::value<Context> fmt::v8::detail::make_arg(const T&) [with bool IS_PACKED = true; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; fmt::v8::detail::type <anonymous> = (fmt::v8::detail::type)15; T = iw_quality; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]':
/home/wingto/work/openwrt-sdk-g001/package/utils/ricigw/src/../../../..//staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/spdlog/fmt/bundled/core.h:1694:69: required from 'fmt::v8::format_arg_store<Context, Args>::format_arg_store(const Args& ...) [with Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {int, int, iw_quality, int, int}]'
/home/wingto/work/openwrt-sdk-g001/package/utils/ricigw/src/../../../..//staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/spdlog/fmt/bundled/core.h:1710:18: required from 'constexpr fmt::v8::format_arg_store<Context, Args ...> fmt::v8::make_format_args(const Args& ...) [with Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {int, int, iw_quality, int, int}]'
/home/wingto/work/openwrt-sdk-g001/package/utils/ricigw/src/../../../..//staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/spdlog/logger.h:285:97: required from 'void spdlog::logger::log_(spdlog::source_loc, spdlog::level::level_enum, const FormatString&, Args&& ...) [with FormatString = char [43]; Args = {int&, int&, iw_quality&, int&, int&}; Char = char; typename std::enable_if<(! std::is_same<Char, wchar_t>::value), Char>::type* <anonymous> = 0u]'
/home/wingto/work/openwrt-sdk-g001/package/utils/ricigw/src/../../../..//staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/spdlog/logger.h:83:9: required from 'void spdlog::logger::log(spdlog::source_loc, spdlog::level::level_enum, const FormatString&, Args&& ...) [with FormatString = char [43]; Args = {int&, int&, iw_quality&, int&, int&}]'
./src/common/wifi/wifiscan.cpp:737:7: required from here
/home/wingto/work/openwrt-sdk-g001/package/utils/ricigw/src/../../../..//staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/spdlog/fmt/bundled/core.h:1567:3: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
static_assert(
^

The error means that an unformattable object is passed to a formatting function. The error message shows that the arguments are:
Args = {int&, int&, iw_quality&, int&, int&}
Since int is formattable it means that iw_quality is the problematic type. To fix this add a formatter specialization for iw_quality:
template <>
struct fmt::formatter<iw_quality> { ... };
See https://fmt.dev/latest/api.html#formatting-user-defined-types for more details on how to implement a formatter.

Related

Impossible to define whether a specific member variable (static const reference) is present in class

After migrating from MS Visual Studio 2008 to MS Visual Studio 2017 and compiling using v140 toolset, I got a problem with defining whether a specific member variable is present in class.
In my case it not a simple variable but a static const reference.
It worked fine in under 2008.
Here is an extract from my code which doesn't compile
#include <iostream>
#include <string>
struct ActivityEntry
{
static const std::string& AutoIncrementName;
};
template< typename Entry >
struct AutoIncrementNameSelect
{
template< const std::string* >
struct TestHasMember;
template< typename T >
static int f( TestHasMember< &T::AutoIncrementName >*, void* );
template< typename T >
static char f( TestHasMember< &T::AutoIncrementName >*, ... );
enum { UseAutoIncrement = ( sizeof( f< Entry >( 0, 0 ) ) == sizeof( int ) ) };
};
std::string s("aaa");
//initialize the reference
const std::string & ActivityEntry::AutoIncrementName(s);
int main()
{
std::cout<<"Use autoinc:"<< AutoIncrementNameSelect<ActivityEntry>::UseAutoIncrement;
return 0;
}
In my original code the error is: "pointer to reference member is illegal" with reference to:
enum { UseAutoIncrement = ( sizeof( f< Entry >( 0, 0 ) ) == sizeof( int ) ) };
Here, the error is
error: '& ActivityEntry::AutoIncrementName' is not a valid template argument for 'const string* {aka const std::basic_string*}' because it is not the address of a variable
You can modify the AutoIncrementName to be a std::string object, not a reference, so that you could take its address. Or change the two f() methods like this:
template< typename T >
static int f( decltype(&T::AutoIncrementName)*, void* );
template< typename T >
static char f( decltype(&T::AutoIncrementName)*, ... );
Non-type template arguments have some limitations [temp.arg.nontype]/2:
2 A template-argument for a non-type template-parameter shall be a converted constant expression (8.20) of the type of the template-parameter. For a non-type template-parameter of reference or pointer type, the value of the constant expression shall not refer to (or for a pointer type, shall not be the address of):
—(2.1) a subobject (4.5),
—(2.2) a temporary object (15.2),
—(2.3) a string literal (5.13.5),
—(2.4) the result of a typeid expression (8.2.8), or
—(2.5) a predefined __func__ variable (11.4.1).

Pass a lamda expression in a thread pool

I try yo compile in C++11 the following piece of code without success. My goal is to use lambda expression instead of bind in order to fill a queue with tasks.
Could you please help me?
Is any case to create a dangling reference ?
#include <iostream>
#include <functional>
#include <queue>
using namespace std;
std::queue<std::function<void()>> funcs;
class A
{
public:
void foo(int a )
{
cout << "Hello word" << endl;
}
};
class ThePool
{
public:
template<typename _Callable, typename Object, typename... _Args>
void QueueFunction(_Callable __f, Object obj, _Args... __args)
{
funcs.push([=]()
{
(obj.*__f)((__args...));
});
}
void print(int i )
{
cout << "Hello Word"<< i <<endl;
}
};
int main(int argc, char** argv) {
ThePool t;
A a ;
t.QueueFunction(&A::foo,a,5);
std::function<void()> func = funcs.back();
func();
return 0;
}
The error that is generated is the following
main.cpp:24:38: error:
parameter packs not expanded with '...':
(obj.__f)((__args...));
^ main.cpp:24:38: note: '__args' main.cpp:24:44: error: expected ')' before '...' token
(obj.__f)((__args...));
^ main.cpp:24:49: error: expected ')' before ';' token
(obj.*__f)((__args...));
^ main.cpp: In function 'int main(int, char**)': main.cpp:39:45: error: conversion
from 'std::function' to non-scalar type
'std::function' requested
std::function func = funcs.back();
^ main.cpp: In instantiation of 'struct ThePool::QueueFunction(_Callable, Object,
_Args ...) [with _Callable = void (A::)(int); Object = A; _Args = {int}]::__lambda0': main.cpp:22:12: required from 'void
ThePool::QueueFunction(_Callable, Object, _Args ...) [with _Callable =
void (A::)(int); Object = A; _Args = {int}]' main.cpp:38:32:
required from here main.cpp:24:38: error: using invalid field
'ThePool::QueueFunction(_Callable, Object, _Args
...)::__lambda0::____args'
(obj.*__f)((__args...));

Semaphore implementation using condition_variable in C++11

I'm trying to implement a counting semaphore in C++11. This is my trial...
#include <iostream>
#include <thread>
#include <mutex>
#include <future>
#include <vector>
using namespace std;
class Semaphore{
private:
int count;
condition_variable cv;
mutex mtx;
public:
Semaphore(int count_):count(count_){}
void take(){
unique_lock<mutex> lck(mtx);
while(count == 0)
cv.wait(lck);
count--;
cout << "Take\n";
}
void release(){
unique_lock<mutex> lck(mtx);
count++;
cout << "Release\n";
cv.notify_one();
}
};
int main() {
Semaphore sem(5);
vector<thread> threads;
for(int i = 0; i < 10; i++){
threads.push_back(thread(&Semaphore::release, sem));
}
for(int i = 0; i < 10; i++){
threads.push_back(thread(&Semaphore::release, sem));
}
for(int i = 0; i < threads.size(); i++)
threads[i].join();
return 0;
}
However, when compiling, it's failing with the following error...
note: 'Semaphore::Semaphore(Semaphore&&)' is implicitly deleted because the default definition would be ill-formed:
class Semaphore{
My best guess is that this is because of using condition_variable inside a class, which is neither copyable nor movable, so it causes a problem when it's passed as a parameter to std::thread. However, I've no idea how to fix that. Any clues?
Update:
This is the full error log...
In file included from /usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/functional:55:0,
from /usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/thread:39,
from /Users/emostafa/Desktop/cpp/A.cpp:2:
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/tuple: In instantiation of 'constexpr std::_Head_base<_Idx, _Head, false>::_Head_base(_UHead&&) [with _UHead = Semaphore; long unsigned int _Idx = 1ul; _Head = Semaphore]':
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/tuple:369:49: required from 'constexpr std::_Tuple_impl<_Idx, _Head>::_Tuple_impl(std::_Tuple_impl<_Idx, _Head>&&) [with long unsigned int _Idx = 1ul; _Head = Semaphore]'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/type_traits:1162:12: required from 'struct std::__is_nt_constructible_impl<std::_Tuple_impl<1ul, Semaphore>, std::_Tuple_impl<1ul, Semaphore>&&>'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/type_traits:137:12: required from 'struct std::__and_<std::is_constructible<std::_Tuple_impl<1ul, Semaphore>, std::_Tuple_impl<1ul, Semaphore>&&>, std::__is_nt_constructible_impl<std::_Tuple_impl<1ul, Semaphore>, std::_Tuple_impl<1ul, Semaphore>&&> >'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/type_traits:1174:12: required from 'struct std::is_nothrow_constructible<std::_Tuple_impl<1ul, Semaphore>, std::_Tuple_impl<1ul, Semaphore>&&>'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/type_traits:1205:12: required from 'struct std::__is_nothrow_move_constructible_impl<std::_Tuple_impl<1ul, Semaphore>, true>'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/type_traits:1211:12: required from 'struct std::is_nothrow_move_constructible<std::_Tuple_impl<1ul, Semaphore> >'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/type_traits:137:12: required from 'struct std::__and_<std::is_nothrow_move_constructible<std::_Mem_fn<void (Semaphore::*)()> >, std::is_nothrow_move_constructible<std::_Tuple_impl<1ul, Semaphore> > >'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/tuple:218:7: required from 'constexpr std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Tuple_impl(std::_Tuple_impl<_Idx, _Head, _Tail ...>&&) [with long unsigned int _Idx = 0ul; _Head = std::_Mem_fn<void (Semaphore::*)()>; _Tail = {Semaphore}]'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/functional:1559:41: required from 'typename std::_Bind_simple_helper<_Func, _BoundArgs>::__type std::__bind_simple(_Callable&&, _Args&& ...) [with _Callable = void (Semaphore::*)(); _Args = {Semaphore&}; typename std::_Bind_simple_helper<_Func, _BoundArgs>::__type = std::_Bind_simple<std::_Mem_fn<void (Semaphore::*)()>(Semaphore)>]'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/thread:142:59: required from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (Semaphore::*)(); _Args = {Semaphore&}]'
/Users/emostafa/Desktop/cpp/A.cpp:37:54: required from here
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/tuple:115:42: error: use of deleted function 'Semaphore::Semaphore(Semaphore&&)'
: _M_head_impl(std::forward<_UHead>(__h)) { }
^
/Users/emostafa/Desktop/cpp/A.cpp:9:7: note: 'Semaphore::Semaphore(Semaphore&&)' is implicitly deleted because the default definition would be ill-formed:
class Semaphore{
^
/Users/emostafa/Desktop/cpp/A.cpp:9:7: error: use of deleted function 'std::condition_variable::condition_variable(const std::condition_variable&)'
In file included from /usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/future:41:0,
from /Users/emostafa/Desktop/cpp/A.cpp:4:
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/condition_variable:81:5: note: declared here
condition_variable(const condition_variable&) = delete;
^
/Users/emostafa/Desktop/cpp/A.cpp:9:7: error: use of deleted function 'std::mutex::mutex(const std::mutex&)'
class Semaphore{
^
In file included from /Users/emostafa/Desktop/cpp/A.cpp:3:0:
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/mutex:129:5: note: declared here
mutex(const mutex&) = delete;
^
In file included from /usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/functional:55:0,
from /usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/thread:39,
from /Users/emostafa/Desktop/cpp/A.cpp:2:
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/tuple: In instantiation of 'constexpr std::_Head_base<_Idx, _Head, false>::_Head_base(const _Head&) [with long unsigned int _Idx = 1ul; _Head = Semaphore]':
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/tuple:357:21: required from 'constexpr std::_Tuple_impl<_Idx, _Head>::_Tuple_impl(const _Head&) [with long unsigned int _Idx = 1ul; _Head = Semaphore]'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/tuple:206:44: required from 'constexpr std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Tuple_impl(const _Head&, const _Tail& ...) [with long unsigned int _Idx = 0ul; _Head = std::_Mem_fn<void (Semaphore::*)()>; _Tail = {Semaphore}]'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/tuple:606:30: required from 'constexpr std::tuple<_T1, _T2>::tuple(const _T1&, const _T2&) [with _T1 = std::_Mem_fn<void (Semaphore::*)()>; _T2 = Semaphore]'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/functional:1510:72: required from 'std::_Bind_simple<_Callable(_Args ...)>::_Bind_simple(_Tp&&, _Up&& ...) [with _Tp = std::_Mem_fn<void (Semaphore::*)()>; _Up = {Semaphore&}; _Callable = std::_Mem_fn<void (Semaphore::*)()>; _Args = {Semaphore}]'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/functional:1559:41: required from 'typename std::_Bind_simple_helper<_Func, _BoundArgs>::__type std::__bind_simple(_Callable&&, _Args&& ...) [with _Callable = void (Semaphore::*)(); _Args = {Semaphore&}; typename std::_Bind_simple_helper<_Func, _BoundArgs>::__type = std::_Bind_simple<std::_Mem_fn<void (Semaphore::*)()>(Semaphore)>]'
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/thread:142:59: required from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (Semaphore::*)(); _Args = {Semaphore&}]'
/Users/emostafa/Desktop/cpp/A.cpp:37:54: required from here
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/tuple:108:25: error: use of deleted function 'Semaphore::Semaphore(const Semaphore&)'
: _M_head_impl(__h) { }
^
/Users/emostafa/Desktop/cpp/A.cpp:9:7: note: 'Semaphore::Semaphore(const Semaphore&)' is implicitly deleted because the default definition would be ill-formed:
class Semaphore{
^
/Users/emostafa/Desktop/cpp/A.cpp:9:7: error: use of deleted function 'std::condition_variable::condition_variable(const std::condition_variable&)'
In file included from /usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/future:41:0,
from /Users/emostafa/Desktop/cpp/A.cpp:4:
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/condition_variable:81:5: note: declared here
condition_variable(const condition_variable&) = delete;
^
/Users/emostafa/Desktop/cpp/A.cpp:9:7: error: use of deleted function 'std::mutex::mutex(const std::mutex&)'
class Semaphore{
^
In file included from /Users/emostafa/Desktop/cpp/A.cpp:3:0:
/usr/local/Cellar/gcc/5.3.0/include/c++/5.3.0/mutex:129:5: note: declared here
mutex(const mutex&) = delete;
You're passing the sem object as a value to the thread constructor. This requires that it be copied, which is what the 'use of deleted function' refers to.
If you want a thread, task, async context, ... to have a reference to your semaphore, either pass it by std::ref(sem), or fall back to plain old pointers and pass it the address of: &sem.

Linker error with shared_ptr_base.h and gnu-libstdc++ 4.9 / 4.8

I try to compile
https://github.com/personalrobotics/OpenChisel/tree/master/open_chisel
to use it for rendering on a google tango device
I've tried to compile it for Android 4.4, ndk r10e and NDK_TOOLCHAIN_VERSION=4.9 (gcc 4.9) with the following flags:
LOCAL_CFLAGS = -std=c++11 -frtti -fexceptions -fopenmp -w
LOCAL_LDLIBS = -llog -lGLESv2 -L$(SYSROOT)/usr/lib
Including the latest Eigen Version 3.2.8
I tried it also with NDK_TOOLCHAIN_VERSION=4.8 and older Eigen Versions.
But I always get for the ChunkManager.cpp file the following linker errors:
Eigen/Eigen/Core
(Unknown) In file included
Eigen/Eigen/src/Core/util/Memory.h: In instantiation of 'void Eigen::aligned_allocator::construct(Eigen::aligned_allocator::pointer, const T&) [with T = std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2u>; Eigen::aligned_allocator::pointer = std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2u>*]':
This is just an information but maybe it tells someone something
android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/alloc_traits.h
Information:(253, 4) :_Require::__construct_helper<_Tp, Args>::type> std::allocator_traits<_Alloc>::_S_construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2u>; _Args = {const Eigen::aligned_allocator}; _Alloc = Eigen::aligned_allocator, (__gnu_cxx::_Lock_policy)2u> >; std::_Require::__construct_helper<_Tp, _Args>::type> = void]'
android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/alloc_traits.h:399:57: required from 'static decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) std::allocator_traits<_Alloc>::construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2u>; _Args = {const Eigen::aligned_allocator}; _Alloc = Eigen::aligned_allocator, (__gnu_cxx::_Lock_policy)2u> >; decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) = ]'
android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/shared_ptr_base.h:620:37: required from 'std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = chisel::Mesh; _Alloc = Eigen::aligned_allocator; _Args = {}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]'
android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/shared_ptr_base.h:1090:35: required from 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = Eigen::aligned_allocator; _Args = {}; _Tp = chisel::Mesh; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]'
android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/shared_ptr.h:316:64: required from 'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = Eigen::aligned_allocator; _Args = {}; _Tp = chisel::Mesh]'
android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/shared_ptr.h:588:39: required from 'std::shared_ptr<_Tp1> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = chisel::Mesh; _Alloc = Eigen::aligned_allocator; _Args = {}]'
OpenChisel/open_chisel/src/ChunkManager.cpp:105:79: required from here
Eigen/Eigen/src/Core/util/Memory.h:733:9: error: use of deleted function 'std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2u>::_Sp_counted_ptr_inplace(const std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2u>&)'
android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/shared_ptr.h
(Unknown) In file included
_Sp_counted_base(_Sp_counted_base const&) = delete;
^
class _Sp_counted_ptr_inplace final : public _Sp_counted_base<_Lp>
^
android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/shared_ptr_base.h
Information:(494, 11) 'std::_Sp_counted_ptr_inplace, (_gnu_cxx::_Lock_policy)2u>::_Sp_counted_ptr_inplace(const std::_Sp_counted_ptr_inplace, (_gnu_cxx::_Lock_policy)2u>&)' is implicitly deleted because the default definition would be ill-formed:
Error:(203, 7) error: 'std::_Sp_counted_base<_Lp>::_Sp_counted_base(const std::_Sp_counted_base<_Lp>&) [with _gnu_cxx::_Lock_policy _Lp = (_gnu_cxx::_Lock_policy)2u]' is private
Error:(494, 11) error: within this context
Error:(494, 11) error: use of deleted function 'std::_Sp_counted_base<_Lp>::_Sp_counted_base(const std::_Sp_counted_base<_Lp>&) [with _gnu_cxx::_Lock_policy _Lp = (_gnu_cxx::_Lock_policy)2u]'
Information:(203, 7) declared here
make: * [app/src/main/obj/local/armeabi-v7a/objs/rgb_point_cloud_builder/////_/third-party/OpenChisel/open_chisel/src/ChunkManager.o] Error 1
I'm completely lost. Any suggestions are appreciated!
It seems that combination of using Eigen and shared_pointer c++11 causes the errors.
Luckily there is a patched version of chisel which uses boost shared pointer instead.

String conversion from System::String ^ to const wchar_t *

I'm trying to open a file using a string parameter, however I'm getting the following error:
error C2664: 'void std::basic_ifstream<_Elem,_Traits>::open(const wchar_t *,std::ios_base::openmode,int)' : cannot convert parameter 1 from 'System::String ^' to 'const wchar_t *'
How do you convert System::String ^ to const wchar_t *?
As Hans points out, simple conversion is necessary. It would look similar to the following:
System::String ^str = L"Blah Blah";
pin_ptr<const wchar_t> convertedValue = PtrToStringChars(str); // <-- #include <vcclr.h>
const wchar_t *constValue = convertedValue; // <-- Unnecessary, but to be completely verbose
void std::basic_ifstream<_Elem, _Traits>::open(constValue, mode, i);

Resources