Boost 1.5.8 issue - c++

I've got lots of bugs in my old compilation machine so I decided to create a new one.
Boh project doesn't have any issue about compiling in BOOST 1.55, but in 1.5.7 or highter, only one project can compile. (Before, both are using boost 1.5.7 without problem)
Here's the bug when i'm using 1.5.8 (at char_skill.cpp)
http://i.stack.imgur.com/sh8vO.png
Text mode :
/usr/src/blabla/Extern/include/boost/functional/hash/extensions.hpp:193:24: note: template argument deduction/substitution failed:
In file included from /usr/src/blabla/Extern/include/boost/functional/hash/hash.hpp:558:0,
from /usr/src/blabla/Extern/include/boost/functional/hash.hpp:6,
from /usr/src/blabla/Extern/include/boost/unordered/unordered_map.hpp:21,
from /usr/src/blabla/Extern/include/boost/unordered_map.hpp:17,
from char.h:4,
from char_skill.cpp:7:
/usr/src/blabla/Extern/include/boost/functional/hash/extensions.hpp:262:34: note: 'const VID' is not derived from 'const std::shared_ptr<_Tp1>'
return hash_value(val);
^
In file included from /usr/src/blabla/Extern/include/boost/functional/hash/hash.hpp:558:0,
from /usr/src/blabla/Extern/include/boost/functional/hash.hpp:6,
from /usr/src/blabla/Extern/include/boost/unordered/unordered_map.hpp:21,
from /usr/src/blabla/Extern/include/boost/unordered_map.hpp:17,
from char.h:4,
from char_skill.cpp:7:
/usr/src/blabla/Extern/include/boost/functional/hash/extensions.hpp:198:24: note: template<class T, class Deleter> std::size_t boost::hash_value(const std::unique_ptr<_Tp, _Dp>&)
inline std::size_t hash_value(std::unique_ptr<T, Deleter> const& x) {
^
/usr/src/blabla/Extern/include/boost/functional/hash/extensions.hpp:198:24: note: template argument deduction/substitution failed:
In file included from /usr/src/blabla/Extern/include/boost/functional/hash/hash.hpp:558:0,
from /usr/src/blabla/Extern/include/boost/functional/hash.hpp:6,
from /usr/src/blabla/Extern/include/boost/unordered/unordered_map.hpp:21,
from /usr/src/blabla/Extern/include/boost/unordered_map.hpp:17,
from char.h:4,
from char_skill.cpp:7:
/usr/src/blabla/Extern/include/boost/functional/hash/extensions.hpp:262:34: note: 'const VID' is not derived from 'const std::unique_ptr<_Tp, _Dp>'
return hash_value(val);
^
/usr/src/blabla/Extern/include/boost/functional/hash/extensions.hpp: In member function 'std::size_t boost::hash<T>::operator()(const T&) const [with T = VID; std::size_t = unsigned int]':
/usr/src/blabla/Extern/include/boost/functional/hash/extensions.hpp:263:9: warning: control reaches end of non-void function [-Wreturn-type]
}
^
gmake: *** [OBJDIR/char_skill.o] Error 1
I don't know why I have this problem :x
PS : If anyone know how to install boost-all (1.5.7 or +) using freebsd ^^
Have a nice day :)

Related

pcl::VoxelGrid How to get number of points in each voxel grid?

I understand that pcl::VoxelGrid<PointT> can be used to downsample a PointCloud. In my use case, I want to get the number of points within each voxel grid. From PCL docs I found the leaf struct allows me to get the number of points in one voxel by calling getPointCount(). And pcl::VoxelGridCovariance allows me to get a leaf by calling getLeaf(). But I don't know how to apply all of these to a point cloud. I tried to initialize a pcl::VoxelGridCovariance<PointT> by pcl::VoxelGridCovariance<pcl::PCLPointCloud2> grid; but got the error as below. Could anyone know what's the problem here? Or is there any other way to get the number of points in each voxel? Any advice is appreciated!
/usr/local/include/pcl-1.11/pcl/point_struct_traits.h: In instantiation of ‘struct pcl::traits::fieldList<pcl::PCLPointCloud2>’:
/usr/local/include/pcl-1.11/pcl/filters/voxel_grid_covariance.h:79:70: required from ‘class pcl::VoxelGridCovariance<pcl::PCLPointCloud2>’
/home/linux/Documents/waymo_onTheGo/cart_boundary.cpp:549:60: required from here
/usr/local/include/pcl-1.11/pcl/point_struct_traits.h:198:8: error: invalid use of incomplete type ‘struct pcl::traits::fieldList<pcl::PCLPointCloud2>’
struct fieldList /** \cond NO_WARN_RECURSIVE */ : fieldList<typename POD<PointT>::type> /** \endcond */
^~~~~~~~~
/usr/local/include/pcl-1.11/pcl/point_struct_traits.h:198:8: note: declaration of ‘struct pcl::traits::fieldList<pcl::PCLPointCloud2>’
In file included from /usr/local/include/pcl-1.11/pcl/point_struct_traits.h:42:0,
from /usr/local/include/pcl-1.11/pcl/type_traits.h:40,
from /usr/local/include/pcl-1.11/pcl/memory.h:46,
from /usr/local/include/pcl-1.11/pcl/io/pcd_io.h:42,
from /home/linux/Documents/waymo_onTheGo/cart_boundary.cpp:8:
/usr/local/include/pcl-1.11/pcl/point_struct_traits.h:204:3: error: no matching function for call to ‘assertion_failed<false>(mpl_::failed************ (pcl::traits::fieldList<pcl::PCLPointCloud2>::POINT_TYPE_NOT_PROPERLY_REGISTERED::************)(pcl::PCLPointCloud2&))’
BOOST_MPL_ASSERT_MSG((!std::is_same<PointT, typename POD<PointT>::type>::value),
^
/usr/include/boost/mpl/assert.hpp:83:5: note: candidate: template<bool C> int mpl_::assertion_failed(typename mpl_::assert<C>::type)
int assertion_failed( typename assert<C>::type );
^~~~~~~~~~~~~~~~
/usr/include/boost/mpl/assert.hpp:83:5: note: template argument deduction/substitution failed:
/usr/local/include/pcl-1.11/pcl/point_struct_traits.h:204:3: note: cannot convert ‘pcl::traits::fieldList<pcl::PCLPointCloud2>::POINT_TYPE_NOT_PROPERLY_REGISTERED205::assert_arg()’ (type ‘mpl_::failed************ (pcl::traits::fieldList<pcl::PCLPointCloud2>::POINT_TYPE_NOT_PROPERLY_REGISTERED::************)(pcl::PCLPointCloud2&)’) to type ‘mpl_::assert<false>::type {aka mpl_::assert<false>}’
BOOST_MPL_ASSERT_MSG((!std::is_same<PointT, typename POD<PointT>::type>::value),
^
In file included from /home/linux/Documents/waymo_onTheGo/cart_boundary.cpp:40:0:
/usr/local/include/pcl-1.11/pcl/filters/voxel_grid_covariance.h: In instantiation of ‘class pcl::VoxelGridCovariance<pcl::PCLPointCloud2>’:
/home/linux/Documents/waymo_onTheGo/cart_boundary.cpp:549:60: required from here
/usr/local/include/pcl-1.11/pcl/filters/voxel_grid_covariance.h:79:70: error: no type named ‘type’ in ‘struct pcl::traits::fieldList<pcl::PCLPointCloud2>’
using FieldList = typename pcl::traits::fieldList<PointT>::type;
^
/usr/local/include/pcl-1.11/pcl/filters/voxel_grid_covariance.h:80:61: error: no type named ‘PointCloud’ in ‘class pcl::Filter<pcl::PCLPointCloud2>’
using PointCloud = typename Filter<PointT>::PointCloud;
^
/usr/local/include/pcl-1.11/pcl/filters/voxel_grid_covariance.h:56:9: error: ‘std::__cxx11::string pcl::Filter<pcl::PCLPointCloud2>::filter_name_’ is protected within this context
class VoxelGridCovariance : public VoxelGrid<PointT>
^~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/pcl-1.11/pcl/filters/filter_indices.h:42:0,
from /usr/local/include/pcl-1.11/pcl/filters/extract_indices.h:42,
from /home/linux/Documents/waymo_onTheGo/cart_boundary.cpp:13:
/usr/local/include/pcl-1.11/pcl/filters/filter.h:240:19: note: declared protected here
std::string filter_name_;
^~~~~~~~~~~~
In file included from /home/linux/Documents/waymo_onTheGo/cart_boundary.cpp:40:0:
/usr/local/include/pcl-1.11/pcl/filters/voxel_grid_covariance.h:56:9: error: ‘const string& pcl::Filter<pcl::PCLPointCloud2>::getClassName() const’ is protected within this context
class VoxelGridCovariance : public VoxelGrid<PointT>
^~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/pcl-1.11/pcl/filters/filter_indices.h:42:0,
from /usr/local/include/pcl-1.11/pcl/filters/extract_indices.h:42,
from /home/linux/Documents/waymo_onTheGo/cart_boundary.cpp:13:
/usr/local/include/pcl-1.11/pcl/filters/filter.h:253:7: note: declared protected here
getClassName () const
^~~~~~~~~~~~
In file included from /home/linux/Documents/waymo_onTheGo/cart_boundary.cpp:40:0:
/usr/local/include/pcl-1.11/pcl/filters/voxel_grid_covariance.h: In instantiation of ‘pcl::VoxelGridCovariance<PointT>::VoxelGridCovariance() [with PointT = pcl::PCLPointCloud2]’:
/home/linux/Documents/waymo_onTheGo/cart_boundary.cpp:549:60: required from here
/usr/local/include/pcl-1.11/pcl/filters/voxel_grid_covariance.h:205:18: error: using invalid field ‘pcl::VoxelGridCovariance<PointT>::voxel_centroids_’
kdtree_ ()
^
To just access the number of points, use OctreePointCloudDensity
To also access the points inside each voxel, use OctreePointCloudPointVector

Error During Compiling Arduino Code (NodeMCU)

I have been working with NodeMCU for 1 week but suddenly yesterday, while compiling NodeMCU again, as usual, it is showing error during compiling and not uploading the code. Please help me get out of it.
This is the error coming
Arduino: 1.8.12 (Windows 8.1), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
In file included from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/BlynkApiArduino.h:14:0,
from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/BlynkSimpleEsp8266.h:24,
from C:\Users\Govind\Desktop\Stepper_Motor_Joystick_2.21\Stepper_Motor_Joystick_2.21.ino:3:
C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkApi.h: In instantiation of 'void BlynkApi<Proto>::syncVirtual(Args ...) [with Args = {}; Proto = BlynkProtocol<BlynkArduinoClientGen<Client> >]':
C:\Users\Govind\Desktop\Stepper_Motor_Joystick_2.21\Stepper_Motor_Joystick_2.21.ino:69:25: required from here
C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkApi.h:143:9: error: no matching function for call to 'BlynkParam::add_multi()'
cmd.add_multi(pins...);
^
C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkApi.h:143:9: note: candidates are:
In file included from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkApi.h:16:0,
from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/BlynkApiArduino.h:14,
from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/BlynkSimpleEsp8266.h:24,
from C:\Users\Govind\Desktop\Stepper_Motor_Joystick_2.21\Stepper_Motor_Joystick_2.21.ino:3:
C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkParam.h:111:10: note: template<class T, class ... Args> void BlynkParam::add_multi(T)
void add_multi(T last) {
^
C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkParam.h:111:10: note: template argument deduction/substitution failed:
In file included from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/BlynkApiArduino.h:14:0,
from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/BlynkSimpleEsp8266.h:24,
from C:\Users\Govind\Desktop\Stepper_Motor_Joystick_2.21\Stepper_Motor_Joystick_2.21.ino:3:
C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkApi.h:143:9: note: candidate expects 1 argument, 0 provided
cmd.add_multi(pins...);
^
In file included from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkApi.h:16:0,
from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/BlynkApiArduino.h:14,
from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/BlynkSimpleEsp8266.h:24,
from C:\Users\Govind\Desktop\Stepper_Motor_Joystick_2.21\Stepper_Motor_Joystick_2.21.ino:3:
C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkParam.h:116:10: note: template<class T, class ... Args> void BlynkParam::add_multi(T, Args ...)
void add_multi(T head, Args... tail) {
^
C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkParam.h:116:10: note: template argument deduction/substitution failed:
In file included from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/BlynkApiArduino.h:14:0,
from C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/BlynkSimpleEsp8266.h:24,
from C:\Users\Govind\Desktop\Stepper_Motor_Joystick_2.21\Stepper_Motor_Joystick_2.21.ino:3:
C:\Users\Govind\Documents\Arduino\libraries\arduino_238892\src/Blynk/BlynkApi.h:143:9: note: candidate expects 2 arguments, 0 provided
cmd.add_multi(pins...);
^
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I am currently trying to run stepper motors using the AccelStepper library and Blynk Library and also included Esp8266 Library for connectivity. I am not able to understand the problem
Looks like you called Blynk.syncVirtual() without any arguments. You need to include at least one virtual pin, like this:
Blynk.syncVirtual(V4);

Platformio compile error: ArduinoJson6100_100::DynamicJsonDocument has no member named 'nestingLimit'

I'm new to c++, and trying to compile simple arduino project in the Platformio.
platformio.ini file:
[platformio]
src_dir = .
lib_extra_dirs = .piolibdeps/, ../../
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps =
# PubSubClient
painlessMesh
main.ino file:
#include <Arduino.h>
#include <painlessMesh.h>
void setup()
{
}
void loop()
{
}
Should be something simple, but I'm getting next error:
'ArduinoJson6100_100::DynamicJsonDocument' has no member named
'nestingLimit'
Full compiler stack:
Executing task in folder test4: platformio run <
Processing nodemcuv2 (platform: espressif8266; board: nodemcuv2;
framework: arduino)
------------------------------------------------------------------------------------------------------------ Verbose mode can be enabled via -v, --verbose option CONFIGURATION:
https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 > NodeMCU 1.0 (ESP-12E Module) HARDWARE:
ESP8266 80MHz 80KB RAM (4MB Flash) Converting main.ino Library
Dependency Finder -> LDF MODES:
FINDER(chain) COMPATIBILITY(soft) Collected 35 compatible libraries
Scanning dependencies... Dependency Graph |-- 1.3.0 |
|-- 6.10.0 | |-- 3.0.2 | |--
1.2.0 | | |-- 1.0 | |--
1.0 Compiling .pioenvs/nodemcuv2/src/main.ino.cpp.o
Generating LD script
.pioenvs/nodemcuv2/ld/local.eagle.app.v6.common.ld Archiving
.pioenvs/nodemcuv2/libef5/libArduinoJson_ID64.a Archiving
.pioenvs/nodemcuv2/libca3/libTaskScheduler_ID721.a Indexing
.pioenvs/nodemcuv2/libef5/libArduinoJson_ID64.a Indexing
.pioenvs/nodemcuv2/libca3/libTaskScheduler_ID721.a Compiling
.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/BearSSLHelpers.cpp.o Compiling
.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/CertStoreBearSSL.cpp.o Compiling
.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFi.cpp.o Compiling
.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFiAP.cpp.o Compiling
.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
Compiling .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
Compiling
.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
Compiling .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
Compiling .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFiScan.cpp.o
Compiling .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiClient.cpp.o
Compiling
.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o
Compiling
.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
Compiling .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiServer.cpp.o
Compiling
.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o
Compiling
.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
Compiling .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiUdp.cpp.o
Compiling
.pioenvs/nodemcuv2/lib129/ESPAsyncTCP_ID305/AsyncPrinter.cpp.o
Compiling
.pioenvs/nodemcuv2/lib129/ESPAsyncTCP_ID305/ESPAsyncTCP.cpp.o
Compiling
.pioenvs/nodemcuv2/lib129/ESPAsyncTCP_ID305/ESPAsyncTCPbuffer.cpp.o
Archiving .pioenvs/nodemcuv2/lib6c2/libESP8266WiFi.a Indexing
.pioenvs/nodemcuv2/lib6c2/libESP8266WiFi.a Compiling
.pioenvs/nodemcuv2/lib129/ESPAsyncTCP_ID305/SyncClient.cpp.o Compiling
.pioenvs/nodemcuv2/lib129/ESPAsyncTCP_ID305/tcp_axtls.c.o Compiling
.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/TaskScheduler.cpp.o
Compiling
.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMesh.cpp.o
Compiling
.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMeshAP.cpp.o
Archiving .pioenvs/nodemcuv2/lib129/libESPAsyncTCP_ID305.a Indexing
.pioenvs/nodemcuv2/lib129/libESPAsyncTCP_ID305.a Compiling
.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMeshComm.cpp.o
Compiling
.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMeshConnection.cpp.o
Compiling
.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMeshDebug.cpp.o
Compiling
.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMeshJson.cpp.o
.piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp: In member
function 'String painlessMesh::buildMeshPackage(uint32_t, uint32_t,
meshPackageType, String&)':
.piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp:68:25: error:
no matching function for call to
'ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument()'
DynamicJsonDocument jsonBuffer; ^
.piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp:68:25: note:
candidates are: In file included from
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/DynamicJsonDocument.hpp:7:0,
from .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.hpp:21, from
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson.h:9, from
.piolibdeps/painlessMesh_ID1269/src/painlessMesh.h:12, from
.piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp:8:
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:50:3:
note:
ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(ArduinoJson6100_100::VariantRef)
[with TAllocator = ArduinoJson6100_100::DefaultAllocator]
BasicJsonDocument(VariantRef src) ^
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:50:3:
note: candidate expects 1 argument, 0 provided
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:43:3:
note: template
ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(const
T&, typename
ArduinoJson6100_100::enable_if::value>::type*)
BasicJsonDocument(const T& src, ^
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:43:3:
note: template argument deduction/substitution failed:
.piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp:68:25: note:
candidate expects 2 arguments, 0 provided DynamicJsonDocument
jsonBuffer; ^ In file included from
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/DynamicJsonDocument.hpp:7:0,
from .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.hpp:21, from
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson.h:9, from
.piolibdeps/painlessMesh_ID1269/src/painlessMesh.h:12, from
.piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp:8:
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:36:3:
note:
ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(const
ArduinoJson6100_100::BasicJsonDocument&) [with TAllocator
= ArduinoJson6100_100::DefaultAllocator] BasicJsonDocument(const BasicJsonDocument& src) ^
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:36:3:
note: candidate expects 1 argument, 0 provided
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:33:12:
note:
ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(size_t,
TAllocator) [with TAllocator = ArduinoJson6100_100::DefaultAllocator;
size_t = unsigned int] explicit BasicJsonDocument(size_t capa,
TAllocator allocator = TAllocator()) ^
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:33:12:
note: candidate expects 2 arguments, 0 provided
.piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp: In
member function 'void MeshConnection::handleMessage(String&,
uint32_t)':
.piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:543:25:
error: no matching function for call to
'ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument()'
DynamicJsonDocument jsonBuffer; ^
.piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:543:25:
note: candidates are: In file included from
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/DynamicJsonDocument.hpp:7:0,
from .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.hpp:21, from
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson.h:9, from
.piolibdeps/painlessMesh_ID1269/src/painlessMesh.h:12, from
.piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:9:
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:50:3:
note:
ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(ArduinoJson6100_100::VariantRef)
[with TAllocator = ArduinoJson6100_100::DefaultAllocator]
BasicJsonDocument(VariantRef src) ^
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:50:3:
note: candidate expects 1 argument, 0 provided
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:43:3:
note: template
ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(const
T&, typename
ArduinoJson6100_100::enable_if::value>::type*)
BasicJsonDocument(const T& src, ^
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:43:3:
note: template argument deduction/substitution failed:
.piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:543:25:
note: candidate expects 2 arguments, 0 provided DynamicJsonDocument
jsonBuffer; ^ In file included from
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/DynamicJsonDocument.hpp:7:0,
from .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.hpp:21, from
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson.h:9, from
.piolibdeps/painlessMesh_ID1269/src/painlessMesh.h:12, from
.piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:9:
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:36:3:
note:
ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(const
ArduinoJson6100_100::BasicJsonDocument&) [with TAllocator
= ArduinoJson6100_100::DefaultAllocator] BasicJsonDocument(const BasicJsonDocument& src) ^
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:36:3:
note: candidate expects 1 argument, 0 provided
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:33:12:
note:
ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(size_t,
TAllocator) [with TAllocator = ArduinoJson6100_100::DefaultAllocator;
size_t = unsigned int] explicit BasicJsonDocument(size_t capa,
TAllocator allocator = TAllocator()) ^
.piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/BasicJsonDocument.hpp:33:12:
note: candidate expects 2 arguments, 0 provided
.piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:544:16:
error: 'ArduinoJson6100_100::DynamicJsonDocument' has no member named
'nestingLimit' jsonBuffer.nestingLimit = 255; ^
* [.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMeshComm.cpp.o]
Error 1
* [.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMeshConnection.cpp.o]
Error 1
======================================== [ERROR] Took 10.54 seconds ======================================== The terminal process terminated with exit code: 1
What am I doing wrong?
Thanks!
Solved in the library source: https://gitlab.com/painlessMesh/painlessMesh/issues/253
Author comment:
Thanks for reporting. This should be fixed in the latest version
(1.3.1). Let me know if you still have problems

Why does this use of boost::none fail to compile with nvcc?

I'm trying to compile the following code:
#include <boost/optional.hpp>
void foo(boost::optional<unsigned> x = boost::none);
placed in the file a.cu, with the CUDA compiler, using the following command line:
nvcc a.cu -c --std=c++11 -I/opt/boost/include
but I get a bunch of errors:
a.cu:2:53: error: conversion from ‘const boost::none_t(boost::none_t::init_tag (*)())’ to ‘boost::optional<unsigned int>’ is ambiguous
void foo(boost::optional<unsigned> x = boost::none);
^
/opt/boost/include/boost/optional/optional.hpp:805:1: note: candidate: boost::optional<T>::optional(boost::optional<T>::rval_reference_type) [with T = unsigned int; boost::optional<T>::rval_reference_type = unsigned int&&] <near match>
optional ( rval_reference_type val ) : base( boost::forward<T>(val) )
^ ~~~~
/opt/boost/include/boost/optional/optional.hpp:805:1: note: conversion of argument 1 would be ill-formed:
a.cu:2:53: error: invalid conversion from ‘const boost::none_t (*)(boost::none_t::init_tag (*)())’ to ‘unsigned int’ [-fpermissive]
void foo(boost::optional<unsigned> x = boost::none);
^
/opt/boost/include/boost/optional/optional.hpp:800:1: note: candidate: boost::optional<T>::optional(boost::optional<T>::argument_type) [with T = unsigned int; boost::optional<T>::argument_type = const unsigned int&] <near match>
optional ( argument_type val ) : base(val) {}
^ ~~~~
/opt/boost/include/boost/optional/optional.hpp:800:1: note: conversion of argument 1 would be ill-formed:
a.cu:2:53: error: invalid conversion from ‘const boost::none_t (*)(boost::none_t::init_tag (*)())’ to ‘unsigned int’ [-fpermissive]
void foo(boost::optional<unsigned> x = boost::none);
Why does this happen, and can I circumvent the problem while still actually using boost::optional in (host-side) code compiled with nvcc?
Additional information:
The code compiles fine with g++ 6.3.0 (my distribution's compiler).
This code (or rather, similar code) used to compile and work on an earlier Linux distribution I was using, where the compiler was g++ 5.4.x .
I've tried this with Boost versions 1.65.1 and 1.69.0 .
I've tried this with CUDA versions 9.2.88 and 10.0.130 .
I had the exact same error and was able to get this to work with this modification:
#define BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
#include <boost/optional.hpp>
This is using CUDA 10.0.130, g++ 7.3.0, and Boost 1.68.0.
A partial answer to the second question:
You could consider using Andrzej Krzemieński's neat and self-contained implementation of an optional instead of boost::optional. It works with C++11, which is what you seem to be doing.

Objective-C++ ARC and C++ containers

I'm trying to compile my legacy-free libFoundation project, located at https://github.com/chmeeedalf/lf-foundation but running into problems using clang 3.4 and libc++. It appears something is not happy with ARC in the containers, and I see the following error excerpt:
In file included from /home/chmeee/git-lffoundation/src/Collections/NSCoreArray.mm:34:
In file included from /home/chmeee/git-lffoundation/src/../Headers/Foundation/NSArray.h:31:
In file included from /home/chmeee/git-lffoundation/src/../Headers/Foundation/NSObject.h:40:
In file included from /home/chmeee/git-lffoundation/src/../Headers/Foundation/NSRange.h:192:
In file included from /usr/include/c++/v1/algorithm:627:
/usr/include/c++/v1/memory:913:17: error: call to 'addressof' is ambiguous
{return _VSTD::addressof(__r);}
^~~~~~~~~~~~~~~~
/usr/include/c++/v1/__config:341:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
^
/usr/include/c++/v1/vector:1678:65: note: in instantiation of member function 'std::__1::pointer_traits<const __strong id *>::pointer_to' requested here
const_pointer __xr = pointer_traits<const_pointer>::pointer_to(__x);
^
/home/chmeee/git-lffoundation/src/Collections/NSCoreArray.mm:115:8: note: in instantiation of member function 'std::__1::vector<id, std::__1::allocator<id> >::insert' requested here
items.insert(items.begin() + index, anObject);
^
/usr/include/c++/v1/__functional_base:96:1: note: candidate function [with _Tp = const id]
addressof(__strong _Tp& __x) _NOEXCEPT
^
/usr/include/c++/v1/__functional_base:122:1: note: candidate function [with _Tp = const id]
addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
^
/usr/include/c++/v1/__functional_base:83:1: note: candidate function [with _Tp = const id]
addressof(_Tp& __x) _NOEXCEPT
^
1 error generated.
*** Error code 1
Stop.
make: stopped in /home/chmeee/git-lffoundation/src
Exit 1
The file in this example has a std::vector declared as:
std::vector<id> items;
Can someone shed some light onto this problem? I tried adding an explicit __strong in the std::vector declaration, to no avail, however __unsafe_unretained does eliminate the error.
I'm building on FreeBSD -CURRENT, using the libc++ and clang 3.4 that is in base.
Answering my own question, in case others are interested. Clang defines __weak as a preprocessor macro for ARC. However, FreeBSD's <sys/cdefs.h> also defines __weak itself. The workaround I found for this was to add to my local <sys/cdefs.h>:
#ifndef __weak
#define __weak what_freebsd_defines_ass
#endif