I'm trying to maintain a communication between node JS server and Arduino using SocketIO, I tried to test this example (arduinoChat) https://github.com/quentinpigne/socket.io-arduino-client and I get this error:
arduinochat.ino:6:16: error: no matching function for call to ‘SocketIOClient::SocketIOClient()’
arduinochat.ino:6:16: note: candidates are:
In file included from arduinochat.ino:4:0:
/home/nourhene/sketchbook/libraries/SocketIOClient/SocketIOClient.h:52:3: note: SocketIOClient::SocketIOClient(Client&)
SocketIOClient(Client& client);
^
/home/nourhene/sketchbook/libraries/SocketIOClient/SocketIOClient.h:52:3: note: candidate expects 1 argument, 0 provided
/home/nourhene/sketchbook/libraries/SocketIOClient/SocketIOClient.h:50:7: note: SocketIOClient::SocketIOClient(const SocketIOClient&)
class SocketIOClient {
^
/home/nourhene/sketchbook/libraries/SocketIOClient/SocketIOClient.h:50:7: note: candidate expects 1 argument, 0 provided
arduinochat.ino: In function ‘void setup()’:
arduinochat.ino:30:55: error: invalid conversion from ‘void (*)(EthernetClient, char*)’ to ‘void (*)(Client&, ArduinoJson::JsonArray&)’ [-fpermissive]
In file included from arduinochat.ino:4:0:
/home/nourhene/sketchbook/libraries/SocketIOClient/SocketIOClient.h:56:8: note: initializing argument 2 of ‘void SocketIOClient::setEventHandler(char*, void (*)(Client&, ArduinoJson::JsonArray&))’
void setEventHandler(char* eventName, void (*handler)(Client& client, JsonArray& data));
^
arduinochat.ino : 6 : 16 =>
SocketIOClient client;
SocketIOClient.h:52:3: =>
class SocketIOClient {
public:
SocketIOClient(Client& client);
Related
I have an object qp that is defined as
#include <proxsuite/proxqp/dense/dense.hpp>
namespace fr3_ros {
class WaypointController : public controller_interface::MultiInterfaceController<franka_hw::FrankaModelInterface,
hardware_interface::EffortJointInterface,
franka_hw::FrankaStateInterface> {
...
private:
proxsuite::proxqp::isize dim = 14;
proxsuite::proxqp::isize n_eq = 7;
proxsuite::proxqp::isize n_in = 0;
proxsuite::proxqp::dense::QP<double> qp(dim, n_eq, n_in);
...
}
From the documetation here controller_interface::MultiInterfaceController has the constructor
MultiInterfaceController (bool allow_optional_interfaces=false)
Since I did not define a new constructor, that would be the only constructor WaypointController has.
However, if I put this in the header file it would give me an error when compiling:
In file included from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:113:43: error: ‘dim’ is not a type
113 | proxsuite::proxqp::dense::QP<double> qp(dim, n_eq, n_in);
| ^~~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:113:48: error: ‘n_eq’ is not a type
113 | proxsuite::proxqp::dense::QP<double> qp(dim, n_eq, n_in);
| ^~~~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:113:54: error: ‘n_in’ is not a type
113 | proxsuite::proxqp::dense::QP<double> qp(dim, n_eq, n_in);
| ^~~~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp: In member function ‘virtual void fr3_ros::WaypointController::update(const ros::Time&, const ros::Duration&)’:
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:225:5: error: invalid use of member function ‘proxsuite::proxqp::dense::QP<double> fr3_ros::WaypointController::qp(int, int, int)’ (did you forget the ‘()’ ?)
225 | qp.update(qp_H, qp_g, qp_A, qp_b, std::nullopt, std::nullopt, std::nullopt);
| ^~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:227:5: error: invalid use of member function ‘proxsuite::proxqp::dense::QP<double> fr3_ros::WaypointController::qp(int, int, int)’ (did you forget the ‘()’ ?)
227 | qp.init(qp_H, qp_g, qp_A, qp_b, std::nullopt, std::nullopt, std::nullopt);
| ^~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:230:3: error: invalid use of member function ‘proxsuite::proxqp::dense::QP<double> fr3_ros::WaypointController::qp(int, int, int)’ (did you forget the ‘()’ ?)
230 | qp.solve();
| ^~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:232:13: error: invalid use of member function ‘proxsuite::proxqp::dense::QP<double> fr3_ros::WaypointController::qp(int, int, int)’ (did you forget the ‘()’ ?)
232 | torques = qp.results.x.bottomLeftCorner(7, 1);
| ^~
I also tried separating the declaration and definition, in the header file I have
proxsuite::proxqp::isize dim = 14;
proxsuite::proxqp::isize n_eq = 7;
proxsuite::proxqp::isize n_in = 0;
proxsuite::proxqp::dense::QP<double> qp;
and in the source file I have
qp = proxsuite::proxqp::dense::QP<double>(dim, n_eq, n_in);
this gives me another error
In file included from /opt/ros/noetic/include/class_loader/class_loader_core.hpp:45,
from /opt/ros/noetic/include/class_loader/class_loader.hpp:46,
from /opt/ros/noetic/include/pluginlib/class_list_macros.hpp:40,
from /opt/ros/noetic/include/pluginlib/class_list_macros.h:35,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:13:
/opt/ros/noetic/include/class_loader/meta_object.hpp: In instantiation of ‘B* class_loader::impl::MetaObject<C, B>::create() const [with C = fr3_ros::WaypointController; B = controller_interface::ControllerBase]’:
/opt/ros/noetic/include/class_loader/meta_object.hpp:196:7: required from here
/opt/ros/noetic/include/class_loader/meta_object.hpp:198:12: error: use of deleted function ‘fr3_ros::WaypointController::WaypointController()’
198 | return new C;
| ^~~~~
In file included from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:36:7: note: ‘fr3_ros::WaypointController::WaypointController()’ is implicitly deleted because the default definition would be ill-formed:
36 | class WaypointController : public controller_interface::MultiInterfaceController<franka_hw::FrankaModelInterface,
| ^~~~~~~~~~~~~~~~~~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:36:7: error: no matching function for call to ‘proxsuite::proxqp::dense::QP<double>::QP()’
In file included from /home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/dense.hpp:8,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:31,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:94:3: note: candidate: ‘proxsuite::proxqp::dense::QP<T>::QP(proxsuite::linalg::veg::isize, proxsuite::linalg::veg::isize, proxsuite::linalg::veg::isize) [with T = double; proxsuite::linalg::veg::isize = long int]’
94 | QP(isize _dim, isize _n_eq, isize _n_in)
| ^~
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:94:3: note: candidate expects 3 arguments, 0 provided
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate: ‘proxsuite::proxqp::dense::QP<double>::QP(const proxsuite::proxqp::dense::QP<double>&)’
81 | struct QP
| ^~
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate expects 1 argument, 0 provided
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate: ‘proxsuite::proxqp::dense::QP<double>::QP(proxsuite::proxqp::dense::QP<double>&&)’
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate expects 1 argument, 0 provided
If I add extern in the header file, I get the error
In file included from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:113:3: error: storage class specified for ‘qp’
113 | extern proxsuite::proxqp::dense::QP<double> qp;
| ^~~~~~
In file included from /opt/ros/noetic/include/class_loader/class_loader_core.hpp:45,
from /opt/ros/noetic/include/class_loader/class_loader.hpp:46,
from /opt/ros/noetic/include/pluginlib/class_list_macros.hpp:40,
from /opt/ros/noetic/include/pluginlib/class_list_macros.h:35,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:13:
/opt/ros/noetic/include/class_loader/meta_object.hpp: In instantiation of ‘B* class_loader::impl::MetaObject<C, B>::create() const [with C = fr3_ros::WaypointController; B = controller_interface::ControllerBase]’:
/opt/ros/noetic/include/class_loader/meta_object.hpp:196:7: required from here
/opt/ros/noetic/include/class_loader/meta_object.hpp:198:12: error: use of deleted function ‘fr3_ros::WaypointController::WaypointController()’
198 | return new C;
| ^~~~~
In file included from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:36:7: note: ‘fr3_ros::WaypointController::WaypointController()’ is implicitly deleted because the default definition would be ill-formed:
36 | class WaypointController : public controller_interface::MultiInterfaceController<franka_hw::FrankaModelInterface,
| ^~~~~~~~~~~~~~~~~~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:36:7: error: no matching function for call to ‘proxsuite::proxqp::dense::QP<double>::QP()’
In file included from /home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/dense.hpp:8,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:31,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:94:3: note: candidate: ‘proxsuite::proxqp::dense::QP<T>::QP(proxsuite::linalg::veg::isize, proxsuite::linalg::veg::isize, proxsuite::linalg::veg::isize) [with T = double; proxsuite::linalg::veg::isize = long int]’
94 | QP(isize _dim, isize _n_eq, isize _n_in)
| ^~
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:94:3: note: candidate expects 3 arguments, 0 provided
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate: ‘proxsuite::proxqp::dense::QP<double>::QP(const proxsuite::proxqp::dense::QP<double>&)’
81 | struct QP
| ^~
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate expects 1 argument, 0 provided
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate: ‘proxsuite::proxqp::dense::QP<double>::QP(proxsuite::proxqp::dense::QP<double>&&)’
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate expects 1 argument, 0 provided
Is it possible for someone to help me understand what is the issue here? Is the a universal issue in C++ or is it just this package?
Thanks in advance!
If I were to intialize qp using a member initialize list, should it look like:
public:
WaypointController()
: dim(14), neq(7), n_in(0), qp(dim, n_eq, n_in)
{
}
The error message you're getting is not particularly helpful here, but let me explain it anyways, so you understand what's going on.
C++ believes that you're trying to declare a function, not define a variable.
proxsuite::proxqp::dense::QP<double> qp(dim, n_eq, n_in);
The return type is proxsuite::proxqp::dense::QP<double>, the function's name is qp, and it takes 3 parameters, of types dim, n_eq, and n_in.
The fact that this is not what you intended in entirely irrelevant.
Knowing this, your error messages make a lot more sense.
The solution to this is to declare the field in the header file, like so:
proxsuite::proxqp::dense::QP<double> qp;
And then to you need to initialize qp in your constructor. Use a member initialization list for this.
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
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
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 :)
I am trying to compile 3 files total and can not get it to. The code works in visual++. I have uploaded all 3 files in the same dir and used the following command.
g++ -o edit Album.cpp lab8.cpp
My file names are listed below
Album.cpp
Album.h
lab8.cpp
Note the code was written in visual studio C++ and compiled just fine there.
Results in the following
lab8.cpp: In function ‘std::vector read_album_file(std::string)’:
lab8.cpp:142:25: error: no matching function for call to ‘std::basic_ifstream::basic_ifstream(std::string&)’
ifstream read (filename);// the ifstream is used to read from the file
^
lab8.cpp:142:25: note: candidates are:
In file included from lab8.cpp:38:0:
/usr/include/c++/4.8/fstream:467:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
/usr/include/c++/4.8/fstream:467:7: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string}’ to ‘const char*’
/usr/include/c++/4.8/fstream:453:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits]
basic_ifstream() : __istream_type(), _M_filebuf()
^
/usr/include/c++/4.8/fstream:453:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/4.8/fstream:427:11: note: std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/4.8/fstream:427:11: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string}’ to ‘const std::basic_ifstream&’
Look at the constructor prototype of ifstream. It takes a const char * and a optional argument, soyou need to write filename.c_str()