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?

Thanks as always

lloyd

------------------------------------------------------------------------------
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
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to