innese
Hello,
 
I'm new to OpenPLC. I'm trying to run the runtime on a windows 11 machine. Whenever I try to start the controller (with blank program) or launch an example program (like blink) in the web interface I get compilation errors. See below.
 
Not sure if I've done something wrong?
 
Any ideas how to fix this?
 
Here's the build log:
cat: ethercat: No such file or directory
Generating C files...
POUS.c
POUS.h
LOCATED_VARIABLES.h
VARIABLES.csv
Config0.c
Config0.h
Res0.c
Including Siemens S7 Protocol via snap7
Moving Files...
Compiling for Windows
Generating object files...
Generating glueVars...
Compiling main program...
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x6f8a): undefined reference to `initHardware()'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x7259): undefined reference to `configureModule(char*, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x759e): undefined reference to `writeDiscrete(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x7a94): undefined reference to `writeDiscrete(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x7fc9): undefined reference to `writeDiscrete(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x8252): undefined reference to `readDiscrete(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x8772): undefined reference to `readDiscrete(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x8bb8): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x8bf1): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x8c2a): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x8c63): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x8f53): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x8f8c): more undefined references to `readAnalog(unsigned char, unsigned char)' follow
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x9320): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x9349): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x9372): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x939b): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x967b): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x96a4): more undefined references to `writeAnalog(unsigned int, unsigned char, unsigned char)' follow
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x99b0): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x99ee): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x9a2c): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccOOiTDa.o:glueVars.cpp:(.text+0x9a6a): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x6f96): undefined reference to `initHardware()'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x7265): undefined reference to `configureModule(char*, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x75aa): undefined reference to `writeDiscrete(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x7aa0): undefined reference to `writeDiscrete(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x7fd5): undefined reference to `writeDiscrete(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x825e): undefined reference to `readDiscrete(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x877e): undefined reference to `readDiscrete(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x8bc4): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x8bfd): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x8c36): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x8c6f): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x8f5f): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x8f98): more undefined references to `readAnalog(unsigned char, unsigned char)' follow
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x932c): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x9355): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x937e): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x93a7): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x9687): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x96b0): more undefined references to `writeAnalog(unsigned int, unsigned char, unsigned char)' follow
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x99bc): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x99fa): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x9a38): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Config0.o:Config0.c:(.text+0x9a76): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x6f96): undefined reference to `initHardware()'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x7265): undefined reference to `configureModule(char*, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x75aa): undefined reference to `writeDiscrete(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x7aa0): undefined reference to `writeDiscrete(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x7fd5): undefined reference to `writeDiscrete(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x825e): undefined reference to `readDiscrete(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x877e): undefined reference to `readDiscrete(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x8bc4): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x8bfd): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x8c36): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x8c6f): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x8f5f): undefined reference to `readAnalog(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x8f98): more undefined references to `readAnalog(unsigned char, unsigned char)' follow
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x932c): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x9355): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x937e): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x93a7): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x9687): undefined reference to `writeAnalog(unsigned int, unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x96b0): more undefined references to `writeAnalog(unsigned int, unsigned char, unsigned char)' follow
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x99bc): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x99fa): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x9a38): undefined reference to `readTemperature(unsigned char, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/15.2.0/../../../../x86_64-pc-cygwin/bin/ld: Res0.o:Res0.c:(.text+0x9a76): undefined reference to `readTemperature(unsigned char, unsigned char)'
collect2: error: ld returned 1 exit status
Error compiling C files
Compilation finished with errors!
 
Reply 0 0
thiagoralves
How did you install the runtime?
Reply 0 0
innese
I used the windows installer, from here:
https://autonomylogic.com//wp-content/uploads/files/OpenPLC%20Runtime%20for%20Windows.exe
Reply 0 0
thiagoralves
What does your hardware tab look like? I have the impression you’re using the wrong driver
Reply 0 0
innese
I tried 'blank' and 'simulink' (i have matlab & simulink installed) - neither built successfully but had different problems. I can share the build logs if that's useful.

I wasn't sure which profile to select for PC...

Thanks!
Reply 0 0
thiagoralves
I investigated further and realized that his is a bug that was introduced by a PR that was merged recently. Please rebase your installation and it will work. You should use the Blank driver on Windows.
Reply 0 0
innese
I ran the 'rebase_openplc.cmd' script. This has fixed my problem.

Many thanks!
Reply 0 0
Reply