Skip to content

Problem when building the examples for the slaves #70

@sagilar

Description

@sagilar

Hi there,
I'm trying to recreate the examples provided in the repo, but unfortunately, those for the slaves are not building on my machine. Weirdly, the DCPLib and the examples for the masters were built smoothly, but all the examples for the slaves are showing many errors.
I haven't modified anything in the source or the CMakeLists, which makes me think there is something wrong with the examples, the library, or my PC settings.

I'm running on Ubuntu 24.04 with all the dependencies (explained in the the wiki) installed.

The log is quite long but it looks like this when running the cmake --build . in the root folder of the slave example:

[ 50%] Building CXX object CMakeFiles/dcpslave.dir/src/Main.cpp.o
In file included from /usr/local/include/DCPLib/core/dcp/helper/Helper.hpp:13,
                 from /home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp:5,
                 from /home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Main.cpp:1:
/usr/local/include/DCPLib/core/dcp/model/constant/DcpDataType.hpp:19:24: error: found ‘:’ in nested-name-specifier, expected ‘::’
   19 | enum class DcpDataType : uint8_t {
      |                        ^
      |                        ::
/usr/local/include/DCPLib/core/dcp/model/constant/DcpDataType.hpp:19:12: error: ‘DcpDataType’ has not been declared
   19 | enum class DcpDataType : uint8_t {
      |            ^~~~~~~~~~~
/usr/local/include/DCPLib/core/dcp/model/constant/DcpDataType.hpp:19:34: error: expected unqualified-id before ‘{’ token
   19 | enum class DcpDataType : uint8_t {
      |                                  ^
/usr/local/include/DCPLib/core/dcp/model/constant/DcpDataType.hpp:90:51: error: ‘DcpDataType’ has not been declared
   90 | static std::ostream &operator<<(std::ostream &os, DcpDataType type) {
      |                                                   ^~~~~~~~~~~
/usr/local/include/DCPLib/core/dcp/model/constant/DcpDataType.hpp: In function ‘std::ostream& operator<<(std::ostream&, int)’:
/usr/local/include/DCPLib/core/dcp/model/constant/DcpDataType.hpp:92:14: error: ‘DcpDataType’ has not been declared
   92 |         case DcpDataType::uint8:
      |              ^~~~~~~~~~~
/usr/local/include/DCPLib/core/dcp/model/constant/DcpDataType.hpp:94:14: error: ‘DcpDataType’ has not been declared
   94 |         case DcpDataType::uint16:

...



/usr/local/include/DCPLib/ethernet/dcp/driver/ethernet/udp/UdpDriver.hpp: In member function ‘void UdpDriver::registerSuccessfull()’:
/usr/local/include/DCPLib/ethernet/dcp/driver/ethernet/udp/UdpDriver.hpp:176:22: error: no match for call to ‘(std::string {aka std::__cxx11::basic_string<char>}) (asio::ip::udp::endpoint&)’
  176 |             to_string(masterEndpoint));
      |             ~~~~~~~~~^~~~~~~~~~~~~~~~
/home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp: At global scope:
/home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp:138:14: error: ‘DcpDataType’ was not declared in this scope
  138 |             {DcpDataType::float64, DcpDataType::uint64, DcpDataType::float64, DcpDataType::float64});
      |              ^~~~~~~~~~~
/home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp:138:36: error: ‘DcpDataType’ was not declared in this scope
  138 |             {DcpDataType::float64, DcpDataType::uint64, DcpDataType::float64, DcpDataType::float64});
      |                                    ^~~~~~~~~~~
/home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp:138:57: error: ‘DcpDataType’ was not declared in this scope
  138 |             {DcpDataType::float64, DcpDataType::uint64, DcpDataType::float64, DcpDataType::float64});
      |                                                         ^~~~~~~~~~~
/home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp:138:79: error: ‘DcpDataType’ was not declared in this scope
  138 | taType::float64, DcpDataType::uint64, DcpDataType::float64, DcpDataType::float64});
      |                                                             ^~~~~~~~~~~

/home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp:135:44: error: expected primary-expression before ‘(’ token
  135 |     const LogTemplate SIM_LOG = LogTemplate(
      |                                            ^
/home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp:138:14: error: ‘DcpDataType’ has not been declared
  138 |             {DcpDataType::float64, DcpDataType::uint64, DcpDataType::float64, DcpDataType::float64});
      |              ^~~~~~~~~~~
/home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp:138:36: error: ‘DcpDataType’ has not been declared
  138 |             {DcpDataType::float64, DcpDataType::uint64, DcpDataType::float64, DcpDataType::float64});
      |                                    ^~~~~~~~~~~
/home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp:138:57: error: ‘DcpDataType’ has not been declared
  138 |             {DcpDataType::float64, DcpDataType::uint64, DcpDataType::float64, DcpDataType::float64});
      |                                                         ^~~~~~~~~~~
/home/au698550/Aarhus/DCP/DCPLib/example/slave/src/Slave.hpp:138:79: error: ‘DcpDataType’ has not been declared
  138 | taType::float64, DcpDataType::uint64, DcpDataType::float64, DcpDataType::float64});
      |                                                             ^~~~~~~~~~~

gmake[2]: *** [CMakeFiles/dcpslave.dir/build.make:76: CMakeFiles/dcpslave.dir/src/Main.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/dcpslave.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

I'm attaching the full log for more information.

Thanks in advance.
log_slave.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions