Scnaything - failed to build server

Les,
I’m attempting to get Scanything working on a linux butser machine running linuxcnc 2.9.1 and am having some issues. I commented out line 46 of main.cpp and am now getting this:

11:37:13: Checking for LinuxCNC server...
11:37:13: LinuxCNC version is 2.9.1
11:37:13: Building src/main.cpp
11:37:13: Building src/timer.cpp
11:37:15: linking cncremote-linuxcnc
11:37:15: /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib/liblinuxcnc.a(iniaxis.o): in function `iniAxis(int, char const*)':
11:37:15: (.text+0x5bf): undefined reference to `emcAxisSetMinPositionLimit(int, double)'
11:37:15: /usr/bin/ld: (.text+0x613): undefined reference to `old_inihal_data'
11:37:15: /usr/bin/ld: (.text+0xa77): undefined reference to `emcAxisSetMaxPositionLimit(int, double)'
11:37:15: /usr/bin/ld: (.text+0xacb): undefined reference to `old_inihal_data'
11:37:15: /usr/bin/ld: (.text+0x1432): undefined reference to `emcAxisSetMaxVelocity(int, double, double)'
11:37:15: /usr/bin/ld: (.text+0x1473): undefined reference to `old_inihal_data'
11:37:15: /usr/bin/ld: (.text+0x1aed): undefined reference to `emcAxisSetMaxAcceleration(int, double, double)'
11:37:15: /usr/bin/ld: (.text+0x1b33): undefined reference to `old_inihal_data'
11:37:15: /usr/bin/ld: (.text+0x1f2d): undefined reference to `emcAxisSetLockingJoint(int, int)'
11:37:15: collect2: error: ld returned 1 exit status
11:37:15: make: *** [makefile:26: cncremote-linuxcnc] Error 1
11:37:15: Failed to build the server
11:37:15: ./cncremote-linuxcnc_2.9.1_4.19.0-25-rt-amd64
11:37:15: Pre-built server not found

Why did you need to comment out line 46?

Do you have a run-in-place LinuxCNC installation? At a guess you have more than one LinuxCNC installation and the CNCRemote make file is getting confused as to which version is being used. Try running Scanything from within a RIP environment.

I commented line 46 because I get the error below and that’s what you suggested to do on another post.

10:25:32: Building src/main.cpp
10:25:34: src/main.cpp:46:12: error: ‘PACKAGE_VERSION’ was not declared in this scope
10:25:34:  string a = PACKAGE_VERSION;
10:25:34:             ^~~~~~~~~~~~~~~
10:25:34: src/main.cpp:46:12: note: suggested alternative: ‘MSGPACK_VERSION
10:25:34:  string a = PACKAGE_VERSION;
10:25:34:             ^~~~~~~~~~~~~~~
10:25:34:             MSGPACK_VERSION
10:25:35: make: *** [makefile:34: obj/main.o] Error 1
10:25:35: Failed to build the server

I tried again, changing line 46 to the suggested alternative ‘MSGPACK_VERSION’ and got the same other errors:

10:36:37: /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib/liblinuxcnc.a(iniaxis.o): in function `iniAxis(int, char const*)':
10:36:37: (.text+0x5bf): undefined reference to `emcAxisSetMinPositionLimit(int, double)'
10:36:37: /usr/bin/ld: (.text+0x613): undefined reference to `old_inihal_data'
10:36:37: /usr/bin/ld: (.text+0xa77): undefined reference to `emcAxisSetMaxPositionLimit(int, double)'
10:36:37: /usr/bin/ld: (.text+0xacb): undefined reference to `old_inihal_data'
10:36:37: /usr/bin/ld: (.text+0x1432): undefined reference to `emcAxisSetMaxVelocity(int, double, double)'
10:36:37: /usr/bin/ld: (.text+0x1473): undefined reference to `old_inihal_data'
10:36:37: /usr/bin/ld: (.text+0x1aed): undefined reference to `emcAxisSetMaxAcceleration(int, double, double)'
10:36:37: /usr/bin/ld: (.text+0x1b33): undefined reference to `old_inihal_data'
10:36:37: /usr/bin/ld: (.text+0x1f2d): undefined reference to `emcAxisSetLockingJoint(int, int)'
10:36:37: collect2: error: ld returned 1 exit status
10:36:37: make: *** [makefile:26: cncremote-linuxcnc] Error 1
10:36:37: Failed to build the server

Why do you think I have multiple linuxcnc versions installed? I have only upgraded from 2.9.0Pre to 2.9.1. That was done by removing the 2.9.0Pre install first, then, installing 2.9.0. Do you think there are residual files left from the original 2.9.0 install causing my issue? I would like to get this running on my current installation without having to port everything to a RIP install environment. There’s only 1 liblinuxcnc.a file. It looks like references are compiled into milltask. There is only 1 of them.

I also tried a fresh install of linuxcnc master 2.10 and got these errors:

11:59:20: Started
11:59:20: Loading plugins
11:59:20: Timed out calling function
11:59:20: Checking for LinuxCNC server...
11:59:20: LinuxCNC version is 2.10.0
11:59:20: Building src/main.cpp
11:59:20: Building src/linuxcnc.cpp
11:59:20: Building src/timer.cpp
11:59:22: In file included from src/linuxcnc.cpp:20:
11:59:22: include/linuxcnc.h:68:24: error: ‘EMC_TASK_MODE_ENUM’ does not name a type; did you mean ‘EMC_TASK_MODE’?
11:59:22:      bool SetMode(const EMC_TASK_MODE_ENUM mode);
11:59:22:                         ^~~~~~~~~~~~~~~~~~
11:59:22:                         EMC_TASK_MODE
11:59:22: src/linuxcnc.cpp: In member function ‘virtual void LinuxCnc::UpdateState(CncRemote::State&)’:
11:59:22: src/linuxcnc.cpp:411:35: error: ‘EMC_TASK_STATE_ON’ was not declared in this scope
11:59:22:      if(m_emcStatus->task.state == EMC_TASK_STATE_ON)
11:59:22:                                    ^~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:411:35: note: suggested alternative: ‘EMC_TASK_STATE
11:59:22:      if(m_emcStatus->task.state == EMC_TASK_STATE_ON)
11:59:22:                                    ^~~~~~~~~~~~~~~~~
11:59:22:                                    EMC_TASK_STATE
11:59:22: src/linuxcnc.cpp:422:44: error: ‘EMC_TASK_INTERP_IDLE’ was not declared in this scope
11:59:22:          if(m_emcStatus->task.interpState > EMC_TASK_INTERP_IDLE)
11:59:22:                                             ^~~~~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:422:44: note: suggested alternative: ‘EMC_TASK_INTERP
11:59:22:          if(m_emcStatus->task.interpState > EMC_TASK_INTERP_IDLE)
11:59:22:                                             ^~~~~~~~~~~~~~~~~~~~
11:59:22:                                             EMC_TASK_INTERP
11:59:22: src/linuxcnc.cpp:424:42: error: ‘EMC_TASK_MODE_MDI’ was not declared in this scope
11:59:22:              if(m_emcStatus->task.mode == EMC_TASK_MODE_MDI)
11:59:22:                                           ^~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:424:42: note: suggested alternative: ‘EMC_TASK_MODE
11:59:22:              if(m_emcStatus->task.mode == EMC_TASK_MODE_MDI)
11:59:22:                                           ^~~~~~~~~~~~~~~~~
11:59:22:                                           EMC_TASK_MODE
11:59:22: In file included from src/main.cpp:31:
11:59:22: include/linuxcnc.h:68:24: error: ‘EMC_TASK_MODE_ENUM’ does not name a type; did you mean ‘EMC_TASK_MODE’?
11:59:22:      bool SetMode(const EMC_TASK_MODE_ENUM mode);
11:59:22:                         ^~~~~~~~~~~~~~~~~~
11:59:22:                         EMC_TASK_MODE
11:59:22: src/main.cpp:46:12: error: ‘PACKAGE_VERSION’ was not declared in this scope
11:59:22:  string a = PACKAGE_VERSION;
11:59:22:             ^~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp: At global scope:
11:59:22: src/linuxcnc.cpp:568:30: error: ‘EMC_TASK_MODE_ENUM’ does not name a type; did you mean ‘EMC_TASK_MODE’?
11:59:22:  bool LinuxCnc::SetMode(const EMC_TASK_MODE_ENUM mode)
11:59:22:                               ^~~~~~~~~~~~~~~~~~
11:59:22:                               EMC_TASK_MODE
11:59:22: src/linuxcnc.cpp: In member function ‘bool LinuxCnc::SetMode(int)’:
11:59:22: src/linuxcnc.cpp:571:31: error: no match for ‘operator==’ (operand types are ‘EMC_TASK_MODE’ and ‘const int’)
11:59:22:      if(m_emcStatus->task.mode == mode) return true;
11:59:22:         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
11:59:22: src/linuxcnc.cpp:574:21: error: cannot convert ‘const int’ to ‘EMC_TASK_MODE’ in assignment
11:59:22:      mode_msg.mode = mode;
11:59:22:                      ^~~~
11:59:22: src/linuxcnc.cpp: In member function ‘void LinuxCnc::SendJog(int, double)’:
11:59:22: src/linuxcnc.cpp:593:45: error: ‘EMC_TRAJ_MODE_FREE’ was not declared in this scope
11:59:22:          if(m_emcStatus->motion.traj.mode == EMC_TRAJ_MODE_FREE) emc_jog_cont_msg.jjogmode = JOGJOINT;
11:59:22:                                              ^~~~~~~~~~~~~~~~~~
11:59:22: src/main.cpp:46:12: note: suggested alternative: ‘MSGPACK_VERSION
11:59:22:  string a = PACKAGE_VERSION;
11:59:22:             ^~~~~~~~~~~~~~~
11:59:22:             MSGPACK_VERSION
11:59:22: src/linuxcnc.cpp:593:45: note: suggested alternative: ‘EMC_TRAJ_MODE
11:59:22:          if(m_emcStatus->motion.traj.mode == EMC_TRAJ_MODE_FREE) emc_jog_cont_msg.jjogmode = JOGJOINT;
11:59:22:                                              ^~~~~~~~~~~~~~~~~~
11:59:22:                                              EMC_TRAJ_MODE
11:59:22: src/linuxcnc.cpp:610:45: error: ‘EMC_TRAJ_MODE_FREE’ was not declared in this scope
11:59:22:          if(m_emcStatus->motion.traj.mode == EMC_TRAJ_MODE_FREE) emc_jog_stop_msg.jjogmode = JOGJOINT;
11:59:22:                                              ^~~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:610:45: note: suggested alternative: ‘EMC_TRAJ_MODE
11:59:22:          if(m_emcStatus->motion.traj.mode == EMC_TRAJ_MODE_FREE) emc_jog_stop_msg.jjogmode = JOGJOINT;
11:59:22:                                              ^~~~~~~~~~~~~~~~~~
11:59:22:                                              EMC_TRAJ_MODE
11:59:22: src/linuxcnc.cpp: In member function ‘virtual void LinuxCnc::DrivesOn(bool)’:
11:59:22: src/linuxcnc.cpp:668:27: error: ‘EMC_TASK_STATE_ESTOP_RESET’ was not declared in this scope
11:59:22:          state_msg.state = EMC_TASK_STATE_ESTOP_RESET;
11:59:22:                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:668:27: note: suggested alternative: ‘EMC_ABORT_TASK_STATE_ESTOP_RESET
11:59:22:          state_msg.state = EMC_TASK_STATE_ESTOP_RESET;
11:59:22:                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
11:59:22:                            EMC_ABORT_TASK_STATE_ESTOP_RESET
11:59:22: src/linuxcnc.cpp:670:27: error: ‘EMC_TASK_STATE_ON’ was not declared in this scope
11:59:22:          state_msg.state = EMC_TASK_STATE_ON;
11:59:22:                            ^~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:670:27: note: suggested alternative: ‘EMC_TASK_STATE
11:59:22:          state_msg.state = EMC_TASK_STATE_ON;
11:59:22:                            ^~~~~~~~~~~~~~~~~
11:59:22:                            EMC_TASK_STATE
11:59:22: src/linuxcnc.cpp:675:27: error: ‘EMC_TASK_STATE_OFF’ was not declared in this scope
11:59:22:          state_msg.state = EMC_TASK_STATE_OFF;
11:59:22:                            ^~~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:675:27: note: suggested alternative: ‘EMC_TASK_STAT_MSG
11:59:22:          state_msg.state = EMC_TASK_STATE_OFF;
11:59:22:                            ^~~~~~~~~~~~~~~~~~
11:59:22:                            EMC_TASK_STAT_MSG
11:59:22: src/linuxcnc.cpp: In member function ‘virtual void LinuxCnc::JogVel(CncRemote::Axes)’:
11:59:22: src/linuxcnc.cpp:684:13: error: ‘EMC_TASK_MODE_MANUAL’ was not declared in this scope
11:59:22:      SetMode(EMC_TASK_MODE_MANUAL);
11:59:22:              ^~~~~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:684:13: note: suggested alternative: ‘EMC_TASK_MODE
11:59:22:      SetMode(EMC_TASK_MODE_MANUAL);
11:59:22:              ^~~~~~~~~~~~~~~~~~~~
11:59:22:              EMC_TASK_MODE
11:59:22: src/linuxcnc.cpp: In member function ‘virtual void LinuxCnc::JogStep(CncRemote::Axes, double)’:
11:59:22: src/linuxcnc.cpp:692:13: error: ‘EMC_TASK_MODE_MANUAL’ was not declared in this scope
11:59:22:      SetMode(EMC_TASK_MODE_MANUAL);
11:59:22:              ^~~~~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:692:13: note: suggested alternative: ‘EMC_TASK_MODE
11:59:22:      SetMode(EMC_TASK_MODE_MANUAL);
11:59:22:              ^~~~~~~~~~~~~~~~~~~~
11:59:22:              EMC_TASK_MODE
11:59:22: src/linuxcnc.cpp: In member function ‘virtual bool LinuxCnc::Mdi(std::__cxx11::string)’:
11:59:22: src/linuxcnc.cpp:709:13: error: ‘EMC_TASK_MODE_MDI’ was not declared in this scope
11:59:22:      SetMode(EMC_TASK_MODE_MDI);
11:59:22:              ^~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:709:13: note: suggested alternative: ‘EMC_TASK_MODE
11:59:22:      SetMode(EMC_TASK_MODE_MDI);
11:59:22:              ^~~~~~~~~~~~~~~~~
11:59:22:              EMC_TASK_MODE
11:59:22: src/linuxcnc.cpp: In member function ‘virtual void LinuxCnc::CycleStart()’:
11:59:22: src/linuxcnc.cpp:795:13: error: ‘EMC_TASK_MODE_AUTO’ was not declared in this scope
11:59:22:      SetMode(EMC_TASK_MODE_AUTO);
11:59:22:              ^~~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:795:13: note: suggested alternative: ‘EMC_TASK_MODE
11:59:22:      SetMode(EMC_TASK_MODE_AUTO);
11:59:22:              ^~~~~~~~~~~~~~~~~~
11:59:22:              EMC_TASK_MODE
11:59:22: src/linuxcnc.cpp: In member function ‘virtual void LinuxCnc::Home(CncRemote::BoolAxes)’:
11:59:22: src/linuxcnc.cpp:856:13: error: ‘EMC_TASK_MODE_MANUAL’ was not declared in this scope
11:59:22:      SetMode(EMC_TASK_MODE_MANUAL);
11:59:22:              ^~~~~~~~~~~~~~~~~~~~
11:59:22: src/linuxcnc.cpp:856:13: note: suggested alternative: ‘EMC_TASK_MODE
11:59:22:      SetMode(EMC_TASK_MODE_MANUAL);
11:59:22:              ^~~~~~~~~~~~~~~~~~~~
11:59:22:              EMC_TASK_MODE
11:59:23: make: *** [makefile:33: obj/main.o] Error 1
11:59:23: make: *** Waiting for unfinished jobs....
11:59:23: make: *** [makefile:33: obj/linuxcnc.o] Error 1
11:59:23: Failed to build the server
11:59:23: ./cncremote-linuxcnc_2.10.0_4.19.0-24-rt-amd64
11:59:23: Pre-built server not found