PLCnext, Cmake compiler error
Recently I tried to program in a PLCnext, using c ++ in Eclipse. For the installations I have followed the videos but now I get the message that the cmake compiler is not working. When reinstalling the sdk I also get the error when exploring. I hope you know a solution
this was writen in the CmakeError.log:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/SDKs/AXCF2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-gcc.exe
Build flags: ;-march=armv7-a;-mthumb;-mfpu=neon;-mfloat-abi=hard;-mcpu=cortex-a9
Id flags:
The output was:
1
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find crt1.o: No such file or directory
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find crti.o: No such file or directory
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find crtbegin.o: No such file or directory
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lgcc
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lgcc_s
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lc
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lgcc
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lgcc_s
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find crtend.o: No such file or directory
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find crtn.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/SDKs/AXCF2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-g++.exe
Build flags: ;-march=armv7-a;-mthumb;-mfpu=neon;-mfloat-abi=hard;-mcpu=cortex-a9
Id flags:
The output was:
1
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find crt1.o: No such file or directory
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find crti.o: No such file or directory
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find crtbegin.o: No such file or directory
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lstdc++
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lm
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lgcc_s
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lgcc
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lc
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lgcc_s
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find -lgcc
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find crtend.o: No such file or directory
c:/sdks/axcf2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/7.3.0/real-ld.exe: cannot find crtn.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
Determining if the C compiler works failed with the following output:
Change Dir: C:/Users/florian/eclipse-workspace/Test2/intermediate/cmake/AXCF2152,19.0.0.17548/Release/CMakeFiles/CMakeTmp
Run Build Command:"C:/SDKs/AXCF2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/make.exe" "cmTC_b7436/fast"
C:/SDKs/AXCF2152/2019.0/sysroots/x86_64-pokysdk-mingw32/usr/bin/make.exe -f CMakeFiles/cmTC_b7436.dir/build.make CMakeFiles/cmTC_b7436.dir/build
make.exe[1]: Entering directory 'C:/Users/florian/eclipse-workspace/Test2/intermediate/cmake/AXCF2152,19.0.0.17548/Release/CMakeFiles/CMakeTmp'
Building
C
object
CMakeFiles/cmTC_b7436.dir/testCCompiler.c.o
make.exe[1]: *** [CMakeFiles/cmTC_b7436.dir/build.make:65: CMakeFiles/cmTC_b7436.dir/testCCompiler.c.o] Error -1073741819
make.exe[1]: Leaving directory 'C:/Users/florian/eclipse-workspace/Test2/intermediate/cmake/AXCF2152,19.0.0.17548/Release/CMakeFiles/CMakeTmp'
make.exe: *** [Makefile:121: cmTC_b7436/fast] Error 2
Comments
Hello,
I am wondering if perhaps you created a project with one SDK installed, and have now installed a different SDK, or perhaps the same SDK in a different location?
Can you please try the following:
(You may need to include the PATH to the plcncli exe, for example "C:\Program Files\PHOENIX CONTACT\PLCnCLI 2019.0 LTS\plcncli")
Once we have this information, we should be able to see what SDK Eclipse is trying to use to build your project, and if this SDK is installed the location that Eclipse thinks it is.
- Martin.
Just curious if the original poster was able to resolve this issue. I am having the same problem.
-Zach
HI Zach,
Can you tell us which version of plcncli you are using, and on which platform (Windows or Linux), and with which SDK ?
- Martin.
I have tried 2019.0 and 2019.6 for plcncli. Each time changing the directory in Eclipse via preferences.
I have tried 2019.0/.3/.6 for SDK versions. Each time plcncli is used to introduce the new SDK.
In all cases the error in the cmake log is the same as above.
I did just notice that in the document "Creating programs with C++" it notes that PLCnCLI was tested and released for Windows 10 and Ubuntu.
I am actually running Windows 7 Pro. Is this likely the issue?
Thanks,
- Zach
Hmm, not sure if that will be a problem ... another thought - can you tell me what version of CMake is being used?
i will give this information to our plcncli expert tomorrow and see what he thinks.
- Martin
cmake appears to be 3.13.1
-Zach
Hi Zach,
how did you unpack the tar.xz? Maybe the Symlinks in the archive are handled wrong while unpacking.
Please use the PLCnCLI 2019.6 (PLCnCLI 2019.0 HF2).
Remove all installed SDKs in the CLI:
> plcncli get sdks
> plcncli set setting -r SdkPaths c:/sdks/axcf2152/2019.0/
Remove them from your hard drive as well.
Then install the SDKs via the PLCnCLI using the tar.xz (do not unpack them yourself). Use the following command as an example:
> plcncli install sdk -p pxc-glibc-x86_64-axcf2152-image-mingw-cortexa9t2hf-neon-toolchain-2019.6.tar.xz -d c:/sdks/axcf2152/2019.6/
After your fresh install of the SDKs try it with a new project:
> plcncli new project -n test
> plcncli set target -a -n axcf2152
> plcncli generate all
> plcncli build
I hope this helps.
- Marcel
I originally installed two of the three SDKs with plcncli using the tar.xz. After getting this error I tried the third by unpacking manually and then using plcncli to introduce the SDKs. The error persisted.
This morning after seeing your message I used plcncli (2019.6) to remove all three SDKs.
Then I used plcncli and the tar.xz to install the 2019.6 SDK again per the instructions here.
Tested a new project build via the command line and later via Eclipse but the same error persisted in each case.
Attached a screenshot of the command line result.
The CMakeError.log file contains the following:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/SDKs/AXCF2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-gcc.exe
Build flags: ;-march=armv7-a;-mthumb;-mfpu=neon;-mfloat-abi=hard;-mcpu=cortex-a9
Id flags:
The output was:
1
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find Scrt1.o: No such file or directory
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find crti.o: No such file or directory
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find crtbeginS.o: No such file or directory
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lgcc
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lgcc_s
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lc
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lgcc
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lgcc_s
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find crtendS.o: No such file or directory
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find crtn.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/SDKs/AXCF2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-g++.exe
Build flags: ;-march=armv7-a;-mthumb;-mfpu=neon;-mfloat-abi=hard;-mcpu=cortex-a9
Id flags:
The output was:
1
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find Scrt1.o: No such file or directory
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find crti.o: No such file or directory
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find crtbeginS.o: No such file or directory
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lstdc++
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lm
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lgcc_s
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lgcc
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lc
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lgcc_s
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find -lgcc
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find crtendS.o: No such file or directory
c:/sdks/axcf2152/2019.6/sysroots/x86_64-pokysdk-mingw32/usr/bin/arm-pxc-linux-gnueabi/../../libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/8.2.0/real-ld.exe: cannot find crtn.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
Thanks,
-Zach
Hello Zach,
I did a little research on this issue and its nothing specific to our tool chain. Never the less I also found a lot of possible solutions. Lots are regarding Linux as build machine.
At first you should check, that the compiler has access rights (read and write) to your project directory. Use a workspace inside your users home directory and not next to the SDKs directly on "C:". This is an issue I once also ran into.
Some of the fixes I read, suggested to install a new CMake version. While installing, let CMake set its path variable. Then tell the PLCnCLI to use it. The command for this is:
> plcncli set setting UseSystemCommands true
If the issue still appears I will arrange a call with one of our experts.
- Marcel
For now I have setup a fresh Ubuntu VM with the PLCnext C++ Tools/Eclipse which allows me to move forward.
It might be worth noting even though it is a different topic that the install process there had some issues as well.
On the first attempt to install the 2019.6 SDK I got a "Successful" message at the terminal and it showed the SDK was installed but no targets were available via plcncli. In order to fix this I removed the SDK and installed it again. The second time the process was the same with the same "Successful" message but this time I could see the SDK and Target available. That seems to be working fine but thought it might be worth mentioning.
-Zach
I am sorry about the issues and thank you for your patience. We test everything on different machines, but unfortunately we will never be able to test all cases.
Did you install the SDK .sh via "plcncli install" or did you execute the SDK .sh and then added it as a target via "plcncli set setting SdkPaths" afterwards?
Hi Marcel,
I used plcncli install with the .sh
After getting it to install fine the second time I have built and tested a few library examples with it and it seems to be working well.
Thanks,
Zach