-> Hier kostenlos registrieren
Problem behoben
Hallo Zusammen
Kann mir jemand einen Tipp gebe, warum der Compiler einen Fehler anzeigt?
Compiler Meldung mit Link zu oben rot markierter Zeile:
Anbei noch das Beispiel aus der B&R-Hilfe:
Vielen Dank
RWY
Hallo Zusammen
Kann mir jemand einen Tipp gebe, warum der Compiler einen Fehler anzeigt?
Code:
[FONT=Courier New][SIZE=2][COLOR=#0000ff]#include [/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#ff00ff]<bur/plc.h> [/COLOR][/SIZE][/FONT]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]#include [/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#ff00ff]"bur/plctypes.h"[/COLOR][/SIZE][/FONT]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]#include [/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#ff00ff]"brsystem.h"[/COLOR][/SIZE][/FONT]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]#include [/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#ff00ff]"sys_lib.h"[/COLOR][/SIZE][/FONT]
[FONT=Courier New][SIZE=2]_LOCAL RTInfo_typ rt_info; [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000]/* instance variable of RTInfo */[/COLOR][/SIZE][/FONT]
[FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]/*************************************************************[/COLOR][/SIZE][/FONT]
[SIZE=2][FONT=Courier New][COLOR=#008000]* init up[/COLOR][/FONT][/SIZE]
[SIZE=2][FONT=Courier New][COLOR=#008000]**************************************************************/[/COLOR][/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=black][COLOR=#0000ff][COLOR=#000000][COLOR=#0000ff]void [/COLOR]_INIT [/COLOR][/COLOR][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=black]dev_com[/COLOR]([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
[COLOR=black]rt_info.enable = 1; [/COLOR][COLOR=#008000]/* enables the function */[/COLOR]
[COLOR=red]RTInfo(&rt_info); [/COLOR][COLOR=#008000]/* gets information from the software object */[/COLOR]
[/COLOR][/SIZE][/FONT][COLOR=black][FONT=Courier New][SIZE=2]uchCycTim = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=black]rt_info.cycle_time/1000; [/COLOR][COLOR=#008000]/* cycle time in ms */[/COLOR][/SIZE][/FONT][/COLOR]
[COLOR=black][FONT=Courier New][COLOR=#008000]}[/COLOR][/FONT]
[/COLOR]
Compiler Meldung mit Link zu oben rot markierter Zeile:
Code:
[FONT=Courier New][SIZE=2][COLOR=#ff0000]\pgm\project\cpu\dev_com.c:(122) :Error: undefined reference to `_RTInfo'[/COLOR][/SIZE][/FONT]
Anbei noch das Beispiel aus der B&R-Hilfe:
Code:
[COLOR=#0000ff]#include [/COLOR][COLOR=#ff00ff]<bur/plc.h>[/COLOR]
[COLOR=#0000ff]#include [/COLOR][COLOR=#ff00ff]<brsystem.h>[/COLOR]
_GLOBAL RTInfo_typ rt_info;
[COLOR=#0000ff][COLOR=#000000][COLOR=#0000ff]void [/COLOR]_INIT [/COLOR][/COLOR][COLOR=#000000]init([/COLOR][COLOR=#0000ff]void[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]{ [/COLOR]
[COLOR=#000000]rt_info.enable = [/COLOR][COLOR=#800000]1[/COLOR][COLOR=#000000]; [/COLOR][COLOR=#008000]/* enables the function */[/COLOR]
[COLOR=#000000]RTInfo(&rt_info); [/COLOR][COLOR=#008000]/* gets information from the software object */[/COLOR]
[COLOR=#000000]}[/COLOR]
Vielen Dank
RWY
Zuletzt bearbeitet: