Linking with the Static library of FMIL

2 posts / 0 new
Last post
adeas31
Offline
Joined: 2012-08-13
Linking with the Static library of FMIL

Hi,
I tried to link with the static fmilib instead of fmilib_shared and it fails. However, it works fine with the shared one. I want to use the static library. Can you have a look at it?

$ gcc -o test.exe fmi_import_test.c -L../install/lib -lfmilib -I../install/include -I../build
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x181): undefined reference to `_imp__fmi_import_allocate_context'
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x1af): undefined reference to `_imp__fmi_import_get_fmi_version'
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x1f4): undefined reference to `_imp__fmi1_import_parse_xml'
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x22e): undefined reference to `_imp__fmi1_import_get_model_identifier'
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x246): undefined reference to `_imp__fmi1_import_get_model_name'
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x25e): undefined reference to `_imp__fmi1_import_get_GUID'
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x2db): undefined reference to `_imp__fmi1_import_create_dllfmu'
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x315): undefined reference to `_imp__fmi1_import_get_version'
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x336): undefined reference to `_imp__fmi1_import_destroy_dllfmu'
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x347): undefined reference to `_imp__fmi1_import_free'
C:\Users\adeas31\AppData\Local\Temp\cc4YFtuN.o:fmi_import_test.c:(.text+0x358): undefined reference to `_imp__fmi_import_free_context'
collect2: ld returned 1 exit status

 
I have compiled on Windows 7 using,
cmake .. -G "MSYS Makefiles"
make
make install
Adeel.

adeas31
Offline
Joined: 2012-08-13
Linking with the Static library of FMIL

Nevermind. I find the answer to my question from the readme file,
Note that if you have configure and built both static and shared library on Windows but want to link with the static library compile time define "FMILIB_BUILDING_LIBRARY" must be set.

Login or register to post comments