On Sat, Feb 16, 2013 at 2:10 PM, lloyd wilson
<llwilso...@rochester.rr.com> wrote:

> MODBUSUISRCS := emc/usr_intf/modbusui.cc \
>                                  emc/usr_intf/modbus_rtu.c
..
> 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).

I didn't try to figure out your overall layout, but in the interest of
getting the simple issues out of the way, are you declaring the C
functions properly in the C++ modules? Unlike C, C++ function cpfun
results in external symbol name decorated with typing information. For
instance, this code:

int cfun(int x){return x;}

when compiled with gcc -c t.c creates an object t.o which defines
function 'cfun'; when you compile it as C++ with 'g++ -c t.c' the
object contains the function symbol _Z4cfuni

In order to use C functions in C++ you have to declare them as extern
"C" int cfun(int x);

------------------------------------------------------------------------------
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