Hello,
wanted to chime in here, had the same build error with Scanything V2.0.24-64 under the current stable LinuxCNC 2.9.3 as well as latest master branch (2.10), both on Bookworm:
21:00:46: Started
21:00:46: Loading plugins
21:00:46: Timed out calling function
21:00:46: Checking for LinuxCNC server...
21:00:46: LinuxCNC version is 2.9.3
21:00:46: Building src/linuxcnc.cpp
21:00:46: Building src/main.cpp
21:00:48: In file included from src/linuxcnc.cpp:20:
21:00:48: include/linuxcnc.h:68:24: error: âEMC_TASK_MODE_ENUMâ does not name a type; did you mean âEMC_TASK_MODEâ?
21:00:48: 68 | bool SetMode(const EMC_TASK_MODE_ENUM mode);
21:00:48: | ^~~~~~~~~~~~~~~~~~
21:00:48: | EMC_TASK_MODE
21:00:49: src/linuxcnc.cpp: In member function âint LinuxCnc::IniLoad(const char*)â:
21:00:49: src/linuxcnc.cpp:136:42: error: cannot convert âstd::optional<const char*>â to âconst char*â in assignment
21:00:49: 136 | if (NULL != (inistring = inifile.Find("DEBUG", "EMC")))
21:00:49: | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
21:00:49: | |
21:00:49: | std::optional<const char*>
21:00:49: src/linuxcnc.cpp:150:42: error: cannot convert âstd::optional<const char*>â to âconst char*â in assignment
21:00:49: 150 | if (NULL != (inistring = inifile.Find("NML_FILE", "EMC")))
21:00:49: | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
21:00:49: | |
21:00:49: | std::optional<const char*>
21:00:49: src/linuxcnc.cpp:171:42: error: cannot convert âstd::optional<const char*>â to âconst char*â in assignment
21:00:49: 171 | if (NULL != (inistring = inifile.Find("LINEAR_UNITS", "DISPLAY")))
21:00:49: | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
21:00:49: | |
21:00:49: | std::optional<const char*>
21:00:49: In file included from src/main.cpp:31:
21:00:49: include/linuxcnc.h:68:24: error: âEMC_TASK_MODE_ENUMâ does not name a type; did you mean âEMC_TASK_MODEâ?
21:00:49: 68 | bool SetMode(const EMC_TASK_MODE_ENUM mode);
21:00:49: | ^~~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_MODE
21:00:49: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::UpdateState(CncRemote::State&)â:
21:00:49: src/linuxcnc.cpp:411:35: error: âEMC_TASK_STATE_ONâ was not declared in this scope; did you mean âEMC_TASK_STATEâ?
21:00:49: 411 | if(m_emcStatus->task.state == EMC_TASK_STATE_ON)
21:00:49: | ^~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_STATE
21:00:49: src/linuxcnc.cpp:422:44: error: âEMC_TASK_INTERP_IDLEâ was not declared in this scope; did you mean âEMC_TASK_INTERPâ?
21:00:49: 422 | if(m_emcStatus->task.interpState > EMC_TASK_INTERP_IDLE)
21:00:49: | ^~~~~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_INTERP
21:00:49: src/linuxcnc.cpp:424:42: error: âEMC_TASK_MODE_MDIâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:00:49: 424 | if(m_emcStatus->task.mode == EMC_TASK_MODE_MDI)
21:00:49: | ^~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_MODE
21:00:49: src/linuxcnc.cpp: At global scope:
21:00:49: src/linuxcnc.cpp:568:30: error: âEMC_TASK_MODE_ENUMâ does not name a type; did you mean âEMC_TASK_MODEâ?
21:00:49: 568 | bool LinuxCnc::SetMode(const EMC_TASK_MODE_ENUM mode)
21:00:49: | ^~~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_MODE
21:00:49: src/linuxcnc.cpp: In member function âbool LinuxCnc::SetMode(int)â:
21:00:49: src/linuxcnc.cpp:571:31: error: no match for âoperator==â (operand types are âEMC_TASK_MODEâ and âconst intâ)
21:00:49: 571 | if(m_emcStatus->task.mode == mode) return true;
21:00:49: | ~~~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~
21:00:49: | | |
21:00:49: | | const int
21:00:49: | EMC_TASK_MODE
21:00:49: src/linuxcnc.cpp:574:21: error: cannot convert âconst intâ to âEMC_TASK_MODEâ in assignment
21:00:49: 574 | mode_msg.mode = mode;
21:00:49: | ^~~~
21:00:49: | |
21:00:49: | const int
21:00:49: src/linuxcnc.cpp: In member function âvoid LinuxCnc::SendJog(int, double)â:
21:00:49: src/linuxcnc.cpp:593:45: error: âEMC_TRAJ_MODE_FREEâ was not declared in this scope; did you mean âEMC_TRAJ_MODEâ?
21:00:49: 593 | if(m_emcStatus->motion.traj.mode == EMC_TRAJ_MODE_FREE) emc_jog_cont_msg.jjogmode = JOGJOINT;
21:00:49: | ^~~~~~21:03:15: Started
21:03:15: Loading plugins
21:03:15: Timed out calling function
21:03:15: Checking for LinuxCNC server...
21:03:15: LinuxCNC version is 2.9.3
21:03:15: Creating include/version.h
21:03:15: Building src/linuxcnc.cpp
21:03:15: Building src/main.cpp
21:03:15: Building src/cnccomms.cpp
21:03:16: src/linuxcnc.cpp: In member function âint LinuxCnc::IniLoad(const char*)â:
21:03:16: src/linuxcnc.cpp:136:42: error: cannot convert âstd::optional<const char*>â to âconst char*â in assignment
21:03:16: 136 | if (NULL != (inistring = inifile.Find("DEBUG", "EMC")))
21:03:16: | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
21:03:16: | |
21:03:16: | std::optional<const char*>
21:03:16: src/linuxcnc.cpp:150:42: error: cannot convert âstd::optional<const char*>â to âconst char*â in assignment
21:03:16: 150 | if (NULL != (inistring = inifile.Find("NML_FILE", "EMC")))
21:03:16: | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
21:03:16: | |
21:03:16: | std::optional<const char*>
21:03:16: src/linuxcnc.cpp:171:42: error: cannot convert âstd::optional<const char*>â to âconst char*â in assignment
21:03:16: 171 | if (NULL != (inistring = inifile.Find("LINEAR_UNITS", "DISPLAY")))
21:03:16: | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
21:03:16: | |
21:03:16: | std::optional<const char*>
21:03:16: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::UpdateState(CncRemote::State&)â:
21:03:16: src/linuxcnc.cpp:411:35: error: âEMC_TASK_STATE_ONâ was not declared in this scope; did you mean âEMC_TASK_STATEâ?
21:03:16: 411 | if(m_emcStatus->task.state == EMC_TASK_STATE_ON)
21:03:16: | ^~~~~~~~~~~~~~~~~
21:03:16: | EMC_TASK_STATE
21:03:16: src/linuxcnc.cpp:422:44: error: âEMC_TASK_INTERP_IDLEâ was not declared in this scope; did you mean âEMC_TASK_INTERPâ?
21:03:16: 422 | if(m_emcStatus->task.interpState > EMC_TASK_INTERP_IDLE)
21:03:16: | ^~~~~~~~~~~~~~~~~~~~
21:03:16: | EMC_TASK_INTERP
21:03:16: src/linuxcnc.cpp:424:42: error: âEMC_TASK_MODE_MDIâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:03:16: 424 | if(m_emcStatus->task.mode == EMC_TASK_MODE_MDI)
21:03:16: | ^~~~~~~~~~~~~~~~~
21:03:16: | EMC_TASK_MODE
21:03:17: src/linuxcnc.cpp: At global scope:
21:03:17: src/linuxcnc.cpp:568:30: error: âEMC_TASK_MODE_ENUMâ does not name a type; did you mean âEMC_TASK_MODEâ?
21:03:17: 568 | bool LinuxCnc::SetMode(const EMC_TASK_MODE_ENUM mode)
21:03:17: | ^~~~~~~~~~~~~~~~~~
21:03:17: | EMC_TASK_MODE
21:03:17: src/linuxcnc.cpp:568:6: error: no declaration matches âbool LinuxCnc::SetMode(int)
21:03:17: 568 | bool LinuxCnc::SetMode(const EMC_TASK_MODE_ENUM mode)
21:03:17: | ^~~~~~~~
21:03:17: In file included from src/linuxcnc.cpp:20:
21:03:17: include/linuxcnc.h:68:10: note: candidate is: âbool LinuxCnc::SetMode(EMC_TASK_MODE)
21:03:17: 68 | bool SetMode(const EMC_TASK_MODE mode);
21:03:17: | ^~~~~~~
21:03:17: include/linuxcnc.h:56:7: note: âclass LinuxCncâ defined here
21:03:17: 56 | class LinuxCnc : public CncRemote::Server
21:03:17: | ^~~~~~~~
21:03:17: src/linuxcnc.cpp: In member function âvoid LinuxCnc::SendJog(int, double)â:
21:03:17: src/linuxcnc.cpp:593:45: error: âEMC_TRAJ_MODE_FREEâ was not declared in this scope; did you mean âEMC_TRAJ_MODEâ?
21:03:17: 593 | if(m_emcStatus->motion.traj.mode == EMC_TRAJ_MODE_FREE) emc_jog_cont_msg.jjogmode = JOGJOINT;
21:03:17: | ^~~~~~~~~~~~~~~~~~
21:03:17: | EMC_TRAJ_MODE
21:03:17: src/linuxcnc.cpp:610:45: error: âEMC_TRAJ_MODE_FREEâ was not declared in this scope; did you mean âEMC_TRAJ_MODEâ?
21:03:17: 610 | if(m_emcStatus->motion.traj.mode == EMC_TRAJ_MODE_FREE) emc_jog_stop_msg.jjogmode = JOGJOINT;
21:03:17: | ^~~~~~~~~~~~~~~~~~
21:03:17: | EMC_TRAJ_MODE
21:03:17: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::DrivesOn(bool)â:
21:03:17: src/linuxcnc.cpp:668:27: error: âEMC_TASK_STATE_ESTOP_RESETâ was not declared in this scope; did you mean âEMC_TASK_STAT_TYPEâ?
21:03:17: 668 | state_msg.state = EMC_TASK_STATE_ESTOP_RESET;
21:03:17: | ^~~~~~~~~~~~~~~~~~~~~~~~~~
21:03:17: | EMC_TASK_STAT_TYPE
21:03:17: src/linuxcnc.cpp:670:27: error: âEMC_TASK_STATE_ONâ was not declared in this scope; did you mean âEMC_TASK_STATEâ?
21:03:17: 670 | state_msg.state = EMC_TASK_STATE_ON;
21:03:17: | ^~~~~~~~~~~~~~~~~
21:03:17: | EMC_TASK_STATE
21:03:17: src/linuxcnc.cpp:675:27: error: âEMC_TASK_STATE_OFFâ was not declared in this scope; did you mean âEMC_TASK_STAT_MSGâ?
21:03:17: 675 | state_msg.state = EMC_TASK_STATE_OFF;
21:03:17: | ^~~~~~~~~~~~~~~~~~
21:03:17: | EMC_TASK_STAT_MSG
21:03:17: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::JogVel(CncRemote::Axes)â:
21:03:17: src/linuxcnc.cpp:684:13: error: âEMC_TASK_MODE_MANUALâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:03:17: 684 | SetMode(EMC_TASK_MODE_MANUAL);
21:03:17: | ^~~~~~~~~~~~~~~~~~~~
21:03:17: | EMC_TASK_MODE
21:03:17: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::JogStep(CncRemote::Axes, double)â:
21:03:17: src/linuxcnc.cpp:692:13: error: âEMC_TASK_MODE_MANUALâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:03:17: 692 | SetMode(EMC_TASK_MODE_MANUAL);
21:03:17: | ^~~~~~~~~~~~~~~~~~~~
21:03:17: | EMC_TASK_MODE
21:03:17: src/linuxcnc.cpp: In member function âvirtual bool LinuxCnc::Mdi(std::string)â:
21:03:17: src/linuxcnc.cpp:709:13: error: âEMC_TASK_MODE_MDIâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:03:17: 709 | SetMode(EMC_TASK_MODE_MDI);
21:03:17: | ^~~~~~~~~~~~~~~~~
21:03:17: | EMC_TASK_MODE
21:03:17: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::CycleStart()â:
21:03:17: src/linuxcnc.cpp:795:13: error: âEMC_TASK_MODE_AUTOâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:03:17: 795 | SetMode(EMC_TASK_MODE_AUTO);
21:03:17: | ^~~~~~~~~~~~~~~~~~
21:03:17: | EMC_TASK_MODE
21:03:17: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::Home(CncRemote::BoolAxes)â:
21:03:17: src/linuxcnc.cpp:856:13: error: âEMC_TASK_MODE_MANUALâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:03:17: 856 | SetMode(EMC_TASK_MODE_MANUAL);
21:03:17: | ^~~~~~~~~~~~~~~~~~~~
21:03:17: | EMC_TASK_MODE
21:03:17: Building src/cncplugin.cpp
21:03:17: make: *** [makefile:34: obj/linuxcnc.o] Error 1
21:03:17: make: *** Waiting for unfinished jobs....
21:03:18: Failed to build the server
21:03:18: ./cncremote-linuxcnc_2.9.3_6.1.0-26-rt-amd64
21:03:18: Pre-built server not found
~~~~~~~~~~~~
21:00:49: | EMC_TRAJ_MODE
21:00:49: src/linuxcnc.cpp:610:45: error: âEMC_TRAJ_MODE_FREEâ was not declared in this scope; did you mean âEMC_TRAJ_MODEâ?
21:00:49: 610 | if(m_emcStatus->motion.traj.mode == EMC_TRAJ_MODE_FREE) emc_jog_stop_msg.jjogmode = JOGJOINT;
21:00:49: | ^~~~~~~~~~~~~~~~~~
21:00:49: | EMC_TRAJ_MODE
21:00:49: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::DrivesOn(bool)â:
21:00:49: src/linuxcnc.cpp:668:27: error: âEMC_TASK_STATE_ESTOP_RESETâ was not declared in this scope; did you mean âEMC_TASK_STAT_TYPEâ?
21:00:49: 668 | state_msg.state = EMC_TASK_STATE_ESTOP_RESET;
21:00:49: | ^~~~~~~~~~~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_STAT_TYPE
21:00:49: src/linuxcnc.cpp:670:27: error: âEMC_TASK_STATE_ONâ was not declared in this scope; did you mean âEMC_TASK_STATEâ?
21:00:49: 670 | state_msg.state = EMC_TASK_STATE_ON;
21:00:49: | ^~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_STATE
21:00:49: src/linuxcnc.cpp:675:27: error: âEMC_TASK_STATE_OFFâ was not declared in this scope; did you mean âEMC_TASK_STAT_MSGâ?
21:00:49: 675 | state_msg.state = EMC_TASK_STATE_OFF;
21:00:49: | ^~~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_STAT_MSG
21:00:49: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::JogVel(CncRemote::Axes)â:
21:00:49: src/linuxcnc.cpp:684:13: error: âEMC_TASK_MODE_MANUALâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:00:49: 684 | SetMode(EMC_TASK_MODE_MANUAL);
21:00:49: | ^~~~~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_MODE
21:00:49: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::JogStep(CncRemote::Axes, double)â:
21:00:49: src/linuxcnc.cpp:692:13: error: âEMC_TASK_MODE_MANUALâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:00:49: 692 | SetMode(EMC_TASK_MODE_MANUAL);
21:00:49: | ^~~~~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_MODE
21:00:49: src/linuxcnc.cpp: In member function âvirtual bool LinuxCnc::Mdi(std::string)â:
21:00:49: src/linuxcnc.cpp:709:13: error: âEMC_TASK_MODE_MDIâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:00:49: 709 | SetMode(EMC_TASK_MODE_MDI);
21:00:49: | ^~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_MODE
21:00:49: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::CycleStart()â:
21:00:49: src/linuxcnc.cpp:795:13: error: âEMC_TASK_MODE_AUTOâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:00:49: 795 | SetMode(EMC_TASK_MODE_AUTO);
21:00:49: | ^~~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_MODE
21:00:49: make: *** [makefile:34: obj/main.o] Error 1
21:00:49: make: *** Waiting for unfinished jobs....
21:00:49: src/linuxcnc.cpp: In member function âvirtual void LinuxCnc::Home(CncRemote::BoolAxes)â:
21:00:49: src/linuxcnc.cpp:856:13: error: âEMC_TASK_MODE_MANUALâ was not declared in this scope; did you mean âEMC_TASK_MODEâ?
21:00:49: 856 | SetMode(EMC_TASK_MODE_MANUAL);
21:00:49: | ^~~~~~~~~~~~~~~~~~~~
21:00:49: | EMC_TASK_MODE
21:00:50: make: *** [makefile:34: obj/linuxcnc.o] Error 1
21:00:50: Failed to build the server
21:00:50: ./cncremote-linuxcnc_2.9.3_6.1.0-26-rt-amd64
21:00:50: Pre-built server not found
I took a closer look into the affected files include/linuxcnc.h and src/linuxcnc.cpp and noticed that most of the errors should have their origin in differing naming conventions. Heading over to their github repository and having a quick glimpse over some source files revealed that instead of an underscore, in the newer versions the last attributes seem to get separated by two colons, f.e.
EMC_TASK_MODE_MDI is now EMC_TASK_MODE::MDI
EMC_TASK_STATE_ON is now EMC_TASK_STATE::ON
etc.
Well, these were quickly changed and after that only 3 error messages remained, yay:
21:38:09: Started
21:38:09: Loading plugins
21:38:09: Timed out calling function
21:38:09: Checking for LinuxCNC server...
21:38:09: LinuxCNC version is 2.9.3
21:38:09: Creating include/version.h
21:38:09: Building src/linuxcnc.cpp
21:38:09: Building src/main.cpp
21:38:09: Building src/cnccomms.cpp
21:38:11: src/linuxcnc.cpp: In member function âint LinuxCnc::IniLoad(const char*)â:
21:38:11: src/linuxcnc.cpp:136:42: error: cannot convert âstd::optional<const char*>â to âconst char*â in assignment
21:38:11: 136 | if (NULL != (inistring = inifile.Find("DEBUG", "EMC")))
21:38:11: | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
21:38:11: | |
21:38:11: | std::optional<const char*>
21:38:11: src/linuxcnc.cpp:150:42: error: cannot convert âstd::optional<const char*>â to âconst char*â in assignment
21:38:11: 150 | if (NULL != (inistring = inifile.Find("NML_FILE", "EMC")))
21:38:11: | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
21:38:11: | |
21:38:11: | std::optional<const char*>
21:38:11: src/linuxcnc.cpp:171:42: error: cannot convert âstd::optional<const char*>â to âconst char*â in assignment
21:38:11: 171 | if (NULL != (inistring = inifile.Find("LINEAR_UNITS", "DISPLAY")))
21:38:11: | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
21:38:11: | |
21:38:11: | std::optional<const char*>
21:38:11: Building src/cncplugin.cpp
21:38:11: Building src/cncserver.cpp
21:38:12: make: *** [makefile:34: obj/linuxcnc.o] Error 1
21:38:12: make: *** Waiting for unfinished jobs....
21:38:17: Failed to build the server
21:38:17: ./cncremote-linuxcnc_2.9.3_6.1.0-26-rt-amd64
21:38:17: Pre-built server not found
I tried to find references to these messages, but quickly realized that these will need more insight… so i took the quick’n’dirty road and just commented out these lines as well as the following else-if loops. And that brought me to the known old error mentioned here before about a version mismatch in line 46 of main.cpp.
Commented that out as well…and et voila: Scanything was up and running together with LinuxCNC 2.9.3 and 2.10 
I get constant messages about the client reconnecting to the server, but at least on a simulated machine this seems to work, the virtual machine in LinuxCNC moves while i manually move a camera.
If this helpful for further testing, here are the patches:
linuxcnc.h.patch.txt (535 Bytes)
main.cpp.patch.txt (277 Bytes)
linuxcnc.cpp.patch.txt (6.2 KB)
Best Regards,
-lgitano