PR# 18909 The dependancies in the "ecf" file does not affect the order of the objects files in the MinGW gcc l

Problem Report Summary
Submitter: titoui
Category: C Compilation
Priority: Low
Date: 2014/07/09
Class: Feature Request
Severity: Non-critical
Number: 18909
Release: GPL Edition
Confidential: No
Status: Open
Environment: Windows 7 32 bits using MinGW compiler.
Synopsis: The dependancies in the "ecf" file does not affect the order of the objects files in the MinGW gcc l

I have a problem with the MinGW gcc linker. I have two Eiffel libraries:

an Audio/Video library (called av_library)

and a custom package file manager (called cpf_library)

The av_library use a C library called av_additions.lib and the cpf_library use a C library called cpf_additions.lib.

The cpf_library is included in the av_library. In other words, in the "ecf" file of the av_library, I have the line:

<library name="cpf_lib" location="$EIFFEL_LIBRARY\contrib\library\game\cpf_lib\cpf_lib.ecf"/>

Also, in the C library av_additions.lib, I use some C functions of the cpf_additions.lib.

The problem is this, when I create a project using the av_library, Mingw linker give me errors like this one:

av_additions.lib(av_additions.o):av_additions.c:(.text+0x54): undefined reference to `cpfFileRead'

I know that the order of the files count in the gcc linker. So I looked in the generated Makefile (in the EIFGENs), and I saw those line in the "EXTERNALS" section:

"C:\Program Files\Eiffel Software\EiffelStudio 14.05 GPL\contrib\library\game\cpf_lib\spec\mingw\windows\lib\cpf_additions.lib" \
"C:\Program Files\Eiffel Software\EiffelStudio 14.05 GPL\contrib\library\game\audio_video_lib\spec\mingw\windows\lib\av_additions.lib" \

Normaly, since av_library depend on cpf_library, I presumed that the cpf_additions.lib would come after the av_additions.lib but it is not the case (function definition should come after the file who used it, see: I have tested inversing the two line in the Makefile and when a use the "make" command, it compile correctly. So the problem is that the libs files are not in a good order. 
To Reproduce
Download the eiffel_game_lib at:

Install the library as explain in the github pages. The two examples:


should compile, but does not.
Problem Report Interactions