Cygwin – error loading shared library: arm-elf-gcc.exe from GNUARM

Posted on

Problem :

I have installed Embedded Robot Coder, a set of tools for developing embedded ARM applications, e. g. for Lego NXT brick, using MATLAB on Windows. It contains Cygwin, GNUARM utilities and so on. When I try compile my application, generating C code works fine, but while building, an error occurs:

Compiling /cygdrive/C/MATLAB/2013/ecrobotnxt/environment/nxtOSEK/toppers_osek/kernel/alarm.c to alarm.o
C:/cygwin64/GNUARM/bin/arm-elf-gcc.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

I opened Cygwin Terminal (but Cugwin utilities also works on Windows CMD), and run ldd on arm-elf-gcc.exe. Output is following:

$ ldd ./arm-elf-gcc.exe
ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7fff9c3e0000)
??? => ??? (0x778e0000)
wow64.dll => /cygdrive/c/WINDOWS/System32/wow64.dll (0x77800000)
wow64win.dll => /cygdrive/c/WINDOWS/System32/wow64win.dll (0x77860000)

What does ??? mean? I also used cygcheck command. On Windows CMD output is following:

C:cygwin64GNUARMbin>cygcheck arm-elf-gcc.exe
Found: arm-elf-gcc.exe

…but on Cygwin Terminal cygcheck returned an error:

cygcheck.exe arm-elf-gcc.exe
cygcheck: could not find 'arm-elf-gcc.exe'

While I was installing Cygwin I skipped many things just to save time and space, but I checked all necessary packages for ECR toolbox.

NOTE: That question is related to specific Matlab and Lego toolbox, but I ask it here because it uses Linux/Cygwin common mechanisms.

Solution :

I found workaround. I have installed 32-bit, instead of 64, version of Cygwin, and everything works. The problem possibly was connected to GNUARM compiler which “feels good” with 32-bit architecture. As @matzeri pointed, problematic libraries used 32-bit Windows dependencies.

Leave a Reply

Your email address will not be published. Required fields are marked *