On 02/16/2013 12:10 PM, lloyd wilson wrote: > I'm not sure if this should be posted here, on in development - it's a > programming question, but it's not an official part of LCNC. I'll start > here; if too arcane for this audience, feel free to suggest a re-direction. > > I'm working on a user-space interface program for my Hurco mill control > panel, using a subset of the NML portion of halui, but getting data via > a modbus connection, rather than a hal environment. > > After a >LONG< time (my C++ language skills are at the pidgin level), I > finally got the program to get through compilation, and banged into an > issue that has me baffled (don't speak makefiles so good either). > > I defined the new program in the usr_intf submake file, rather than > creating a new subdirectory. I cloned the halui entries: > > HALUISRCS := emc/usr_intf/halui.cc > > becomes > > MODBUSUISRCS := emc/usr_intf/modbusui.cc \ > emc/usr_intf/modbus_rtu.c > #modbus_rtu is a modbus library that Arduino likes; so does linux > > and > > ../bin/halui: $(call TOOBJS, $(HALUISRCS)) ../lib/liblinuxcnc.a > ../lib/liblinuxcncini.so.0 ../lib/libnml.so.0 ../lib/liblinuxcnchal.so.0 > $(ECHO) Linking $(notdir $@) > $(Q)$(CXX) $(LDFLAGS) -o $@ $(ULFLAGS) $^ > TARGETS += ../bin/halui > > becomes > > ../bin/modbusui: $(call TOOBJS, $(MODBUSUISRCS)) ../lib/liblinuxcnc.a > ../lib/liblinuxcncini.so.0 ../lib/libnml.so.0 > $(ECHO) Linking $(notdir $@) > $(Q)$(CXX) $(LDFLAGS) -o $@ $(ULFLAGS) $^ > TARGETS += ../bin/modbusui > #this target doesn't need liblinuxcnchal > > with these entries, both source files compile as expected, but in the > link stage, I get errors that the functions which are located in the > modbus_rtu object file can't be found; it's like the linker doesn't know > about the .o file (which it just compiled). > > Other targets in the same directory use mixed C++ and C sources, so it > must be doable. Just to ensure that this is not due to invisible typos, > I copied the modbus_rtu source into the modbusui source, revised the > source list to modbusui only, and the compile/link process ran to > completion. I have to conclude that this is either something I can't see > in the makefile, or some missing incantation that needs to be added to > one of the source files. > > Anybody have a clue what could cause this behavior?
The makefile snippets above look right, I want to see the make output to debug further. Run "make clean", then "make V=1", and pastebin the output. Also... I don't want to stop you from writing software for your machine if that's what you want to do, but if I wanted to hook up a modbus control panel to LinuxCNC i would look at the modbus-to-hal driver we already have. I've never used it, but it might be able to talk to your control panel, and then you'd just have to hook it up to halui in HAL... -- Sebastian Kuzminsky ------------------------------------------------------------------------------ The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials, tech docs, whitepapers, evaluation guides, and opinion stories. Check out the most recent posts - join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
