Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit cacc8bf

Browse files
rfrankeOpenModelica-Hudson
authored andcommitted
Link MODELICA_EXTERNAL_LIBS after model defined libs, ticket:4772
This works around the problem that MSL 3.2.2 Tables define annotation (Library={"ModelicaStandardTables", "ModelicaMatIO", "zlib"}) with wrong link order. MODELICA_EXTERNAL_LIBS contains ModelicaStandardTables as well, linking it after ModelicaMatIO now. Belonging to [master]: - #2223
1 parent 30322f1 commit cacc8bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Compiler/Template/CodegenFMUCpp.tpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,9 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
698698
# /link - [linker options and libraries]
699699
# /LIBPATH: - Directories where libs can be found
700700
OMCPP_SOLVER_LIBS=OMCppNewton_static.lib OMCppDgesv_static.lib OMCppDgesvSolver_static.lib
701+
MODELICA_EXTERNAL_LIBS=ModelicaExternalC.lib ModelicaStandardTables.lib OMCppModelicaUtilities_static.lib
701702
EXTRA_LIBS=<%dirExtra%> <%libsExtra%>
702-
LDFLAGS=/link /DLL /NOENTRY /LIBPATH:"<%makefileParams.omhome%>/lib/omc/cpp/msvc" /LIBPATH:"<%makefileParams.omhome%>/bin" OMCppSystem_static.lib OMCppMath_static.lib OMCppExtensionUtilities_static.lib OMCppFMU_static.lib $(OMCPP_SOLVER_LIBS) ModelicaExternalC.lib ModelicaStandardTables.lib OMCppModelicaUtilities_static.lib $(EXTRA_LIBS)
703+
LDFLAGS=/link /DLL /NOENTRY /LIBPATH:"<%makefileParams.omhome%>/lib/omc/cpp/msvc" /LIBPATH:"<%makefileParams.omhome%>/bin" OMCppSystem_static.lib OMCppMath_static.lib OMCppExtensionUtilities_static.lib OMCppFMU_static.lib $(OMCPP_SOLVER_LIBS) $(EXTRA_LIBS) $(MODELICA_EXTERNAL_LIBS)
703704
PLATFORM="<%makefileParams.platform%>"
704705

705706
MODELICA_SYSTEM_LIB=<%fileNamePrefix%>
@@ -797,7 +798,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
797798
OMCPP_LIBS=-lOMCppSystem_static -lOMCppMath_static -lOMCppModelicaUtilities_static -lOMCppFMU_static $(OMCPP_SOLVER_LIBS) -lOMCppExtensionUtilities_static
798799
MODELICA_EXTERNAL_LIBS=-lModelicaExternalC -lModelicaStandardTables -lOMCppModelicaUtilities_static
799800
EXTRA_LIBS=<%dirExtra%> <%libsExtra%>
800-
LIBS=$(OMCPP_LIBS) $(MODELICA_EXTERNAL_LIBS) $(BASE_LIB) $(EXTRA_LIBS)
801+
LIBS=$(OMCPP_LIBS) $(EXTRA_LIBS) $(MODELICA_EXTERNAL_LIBS) $(BASE_LIB)
801802

802803
# link with simple dgesv or full lapack
803804
ifeq ($(USE_DGESV),ON)

0 commit comments

Comments
 (0)