Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

EAL Build Assistance

EAL Build Assistance

aFouraker
Occasional Contributor

I am trying to set up a cmake build environment on Windows for EAL lib application development.

I’ve been using the manual in the docs for creating an EAL project for Windows on Eclipse as a loose guide for implementing this, and I’ve run into a library linking issue. The linker throws undefined reference errors for any EAL lib function calls.

Here are the libraries that I am linking:

  • C:/Program Files (x86)/Rexroth/EAL-SDK/02VRS/eal4c/bin/libEALCWrapper-win64.dll
  • C:/Program Files (x86)/Rexroth/EAL-SDK/02VRS/eal4c/bin/mono/win64/mono-2.0-sgen.dll

Here is the include directory that I am using:

  • C:/Program Files (x86)/Rexroth/EAL-SDK/02VRS/eal4c/include

The compiler is MinGW64 and the file I am trying to compile is DownloadFirmware.c from the code samples.

 

Any thoughts on what I might be doing wrong?

4 REPLIES 4

MichaelB
Community Moderator
Community Moderator

Concerning MinGW I found an entry in the Engineering Network (see). Please check this.

RexCode
Long-established Member

Hello,

your include and link directories are correct.

For your reference I've created a small cmake skript to build the DownloadFirmware sample.

My version:

2021-05-19_16h16_08.png

Folder structure:

2021-05-19_16h10_08.png

CMakeLists.txt:

cmake_minimum_required(VERSION 3.10)

project(DownloadFirmware VERSION 1.0)

#set include directories to default EAL install path
include_directories("C:/Program Files (x86)/Rexroth/EAL-SDK/02VRS/eal4c/include")
#set link directories to default EAL install path
link_directories("C:/Program Files (x86)/Rexroth/EAL-SDK/02VRS/eal4c/bin/mono/win32")
link_directories("C:/Program Files (x86)/Rexroth/EAL-SDK/02VRS/eal4c/bin")

add_executable(DownloadFirmware DownloadFirmware.c)

target_link_libraries(DownloadFirmware libEALCWrapper-win32.dll)
target_link_libraries(DownloadFirmware mono-2.0-sgen.dll)

Hint:

To run your program you need to copy libEALCWrapper-win32.dll and mono-2.0-sgen.dll to same folder where your executatble is located.

Regards,

Christoph

 

aFouraker
Occasional Contributor

I tried using the provided cmake file and putting the dlls in the build directory. The program now compiles without linking errors but at runtime the program throws missing library errors and exits. See GDB output here:

PS C:\Users\cpawlowicz\dev\bosch_workbench\build> cmake --build .

[ 50%] Building C object CMakeFiles/DownloadFirmware.dir/DownloadFirmware.c.obj

[100%] Linking C executable DownloadFirmware.exe

[100%] Built target DownloadFirmware

PS C:\Users\cpawlowicz\dev\bosch_workbench\build> gdb .\DownloadFirmware.exe

GNU gdb (GDB) 8.1

Copyright (C) 2018 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "x86_64-w64-mingw32".

Type "show configuration" for configuration details.

For bug reporting instructions, please see:

<http://www.gnu.org/software/gdb/bugs/>.

Find the GDB manual and other documentation resources online at:

<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".

Type "apropos word" to search for commands related to "word"...

Reading symbols from .\DownloadFirmware.exe...done.

(gdb) run

Starting program: C:\Users\cpawlowicz\dev\bosch_workbench\build\DownloadFirmware.exe

[New Thread 25352.0x7a4]

[New Thread 25352.0x66b4]

[New Thread 25352.0xaa0]

[New Thread 25352.0x2424]

[Thread 25352.0x66b4 exited with code 3221225781]

[Thread 25352.0x2424 exited with code 3221225781]

During startup program exited with code 0xc0000135.

(gdb)

 

RexCode
Long-established Member

I was able to reproduce this error when I delete one of the mentioned dlls from the folder of my exeecutable or when using a 32bit library when a 64bit lib was linked.

So please double check if you use and copy the correct libraries.

When using a 32bit MinGW use these libs:

C:\Program Files (x86)\Rexroth\EAL-SDK\02VRS\eal4c\bin\libEALCWrapper-win32.dll

C:\Program Files (x86)\Rexroth\EAL-SDK\02VRS\eal4c\bin\mono\win32\mono-2.0-sgen.dll

When using a 64bit MinGW use these libs:

C:\Program Files (x86)\Rexroth\EAL-SDK\02VRS\eal4c\bin\libEALCWrapper-win64.dll

C:\Program Files (x86)\Rexroth\EAL-SDK\02VRS\eal4c\bin\mono\win64\mono-2.0-sgen.dll

 

When changing between 2 architectures be sure to copy the correct libs (32 or 64bit) to the folder of your executable.

According this post it could also be an issue with your MinGW setup - so you should check the path variable:

https://stackoverflow.com/questions/52746760/netbeans-debugger-exited-with-code-0xc0000135

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist