Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: linker error with C code class component

linker error with C code class component 4 years 3 months ago #10459

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 847
  • Thank you received: 2
  • Karma: 5
Hi All,
I have developped a specific function code in my class volume defined as a "connected C Code function" in my proview release used on ARM.
I need to use this same module in my PLC so I just wanted to port a C code component from a class volume to another.

- I have redefined the class component in the class volume in term of input / output and this looks the same as the previous module.
- I have copied the C source code from my other installation to this one and compiled is successfully (corresponding .o object file is correctly generated in $pwpr_obj)
- I have added this object files in "object modules" attributes of a build option in my directory volume
- I have checked that the C code object file is correctly included in the related .opt file for my plc

Now I can build the volume without issue but the build node failed obviously due a linker error (see attchement ) but I can't find what I have missed ? Does anybody here can help me to troubleshoot my issue ?

Thanks in advance
Snarf


[EDIT] Cant succeed to add attachement so here after is the error feedback from the console:
/usr/local/pwrp/i00627/bld/x86_linux/lib/libplcf000_019_014_001.a(plc_m000_019_014_001_00194113.o): In function `M000_019_014_001_00194113_exec':
plc_m000_019_014_001_00194113.gc:(.text+0x40c): undefined reference to `RegPIFo_exec'
/usr/local/pwrp/i00627/bld/x86_linux/lib/libplcf000_019_014_001.a(plc_m000_019_014_001_00194113.o): In function `M000_019_014_001_00194113_init':
plc_m000_019_014_001_00194113.gc:(.text+0x1ec): undefined reference to `RegPIFo_init'
collect2: error: ld returned 1 exit status
%GSX-F-CCERROR, Error from c compiler or linker


Note:
The RegPIFo_init and exec function are defined in the RegPIFo.c file and can be successfully matched with a grep in the corresponding .o
Last Edit: 4 years 3 months ago by Snarf77.
The administrator has disabled public write access.

linker error with C code class component 4 years 3 months ago #10460

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3176
  • Thank you received: 501
  • Karma: 133
Hi Snarf,

Do you get the message 'Using local option-file ...' when you build the node? If not you have to check that the plc name in the BuildOptions correspond to the name of the PlcProcess object.

/Claes
The administrator has disabled public write access.

linker error with C code class component 4 years 1 month ago #10494

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 847
  • Thank you received: 2
  • Karma: 5
Sorry,
I thought to have close this thread before but indeed I was dreaming.
My issue was in fact that I have two BuildOption object for two separated thread and I was focussing the wrong one.
I adjusted the first .opt file but not the second one which remain faulty.
Thank you and sorry for not having answered earlier.
Snarf
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 8.469 seconds