iforce2d / linuxcnc-gcode-server

Allows connecting to a LinuxCNC installation and executing commands, similar to linuxcncrsh.
23 stars 6 forks source link

no configure script? #2

Closed ShadeTechnik closed 1 year ago

ShadeTechnik commented 1 year ago

Instructions say that running "make" is all that should be needed if LinuxCNC is compiled from source. Since 2.9 is available in the apt repo as linuxcnc-uspace-dev compiling from source isn't what most people are likely to do. I installed LinuxCNC from apt myself.

running make alone will fail: $ make g++ -c -Wall -I. -I/usr/include -I/usr/include/linuxcnc -c -o obj/from_shcom.o from_shcom.cpp g++ -c -Wall -I. -I/usr/include -I/usr/include/linuxcnc -c -o obj/inifile.o inifile.cpp inifile.cpp:23:10: fatal error: config.h: No such file or directory 23 | #include "config.h" | ^~~~~~~~~~ compilation terminated. make: *** [Makefile:14: obj/inifile.o] Error 1

I believe config.h is typically generated from running ./configure?

iforce2d commented 1 year ago

Fixed, I think. Try "linuxcnc/emc.hh" instead of "config.h"

ShadeTechnik commented 1 year ago

Not sure what to make of this:

$ make g++ -c -Wall -I. -I/usr/include -I/usr/include/linuxcnc -c -o obj/inifile.o inifile.cpp inifile.cpp: In member function ‘bool IniFile::Open(const char)’: inifile.cpp:66:38: error: ‘LINELEN’ was not declared in this scope 66 | char path[LINELEN] = ""; | ^~~ inifile.cpp:70:26: error: ‘path’ was not declared in this scope 70 | TildeExpansion(file, path, sizeof(path)); | ^~~~ inifile.cpp: In member function ‘const char IniFile::Find(const char, const char, int, int)’: inifile.cpp:196:38: error: ‘LINELEN’ was not declared in this scope 196 | static char line[LINELEN + 2] = ""; / 1 for newline, 1 for NULL / | ^~~ inifile.cpp:226:17: error: ‘bracketSection’ was not declared in this scope 226 | sprintf(bracketSection, "[%s]", section); | ^~~~~~ inifile.cpp:231:31: error: ‘line’ was not declared in this scope; did you mean ‘link’? 231 | if (NULL == fgets(line, LINELEN + 1, fp)) { | ^~~~ | link inifile.cpp:237:35: error: ‘line’ was not declared in this scope; did you mean ‘link’? 237 | if(check_line_endings(line)) { | ^~~~ | link inifile.cpp:246:33: error: ‘line’ was not declared in this scope; did you mean ‘link’? 246 | newLinePos = strlen(line) - 1; / newline is on back from 0 / | ^~~~ | link inifile.cpp:272:27: error: ‘line’ was not declared in this scope; did you mean ‘link’? 272 | if (NULL == fgets(line, LINELEN + 1, (FILE ) fp)) { | ^~~~ | link inifile.cpp:278:31: error: ‘line’ was not declared in this scope; did you mean ‘link’? 278 | if(check_line_endings(line)) { | ^~~~ | link inifile.cpp:287:29: error: ‘line’ was not declared in this scope; did you mean ‘link’? 287 | newLinePos = strlen(line) - 1; / newline is on back from 0 / | ^~~~ | link inifile.cpp:299:34: error: ‘eline’ was not declared in this scope 299 | elineptr = (char)eline; //first time | ^~~~~ inifile.cpp: At global scope: inifile.cpp:29:13: warning: ‘bool check_line_endings(const char)’ defined but not used [-Wunused-function] 29 | static bool check_line_endings(const char *s) { | ^~~~~~ make: *** [Makefile:14: obj/inifile.o] Error 1

iforce2d commented 1 year ago

Sorry, my bad. Turns out config.h is included by emc.hh so my earlier change didn't help. Try again.

ShadeTechnik commented 1 year ago

That did it, thanks