modelica-3rdparty/Modelica_DeviceDrivers

Compilation process failed in TestSerialPackager_UDP

benjamsy opened this issue · 1 comments

Hi,

I get "clang: error: linker command failed with exit code 1" when compiling example TestSerialPackager_UDP.

Running on Windows 10, OpenModelica v1.20.0 (64-bit), Modelica_DeviceDrivers 2.1.1.

Everything is out-of-the-box and tested on multiple computers with the same error.

Does anyone have an solution to this problem?

Thank you.

Compilation window output:

C:/Program Files/OpenModelica1.20.0-64bit/share/omc/scripts/Compile.bat TestSerialPackager_UDP gcc mingw64 parallel dynamic 8 0
PATH = "C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin;C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\..\..\usr\bin;"
mingw32-make: Entering directory 'C:/Users/BENJAM~1/AppData/Local/Temp/OPENMO~1/OMEdit/MODELI~1.TES'
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP.o TestSerialPackager_UDP.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_functions.o TestSerialPackager_UDP_functions.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_records.o TestSerialPackager_UDP_records.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_01exo.o TestSerialPackager_UDP_01exo.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_02nls.o TestSerialPackager_UDP_02nls.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_03lsy.o TestSerialPackager_UDP_03lsy.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_04set.o TestSerialPackager_UDP_04set.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_05evt.o TestSerialPackager_UDP_05evt.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_06inz.o TestSerialPackager_UDP_06inz.c
TestSerialPackager_UDP_functions.cclang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_07dly.o TestSerialPackager_UDP_07dly.c
:426:42: warning: passing 'const int *' to parameter of type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  MDD_SerialPackagerAddInteger(_pkg_ext, (const int*) _u_c89, size_of_dimension_base_array(_u, ((modelica_integer) 1)), _byteOrder_ext);
                                         ^~~~~~~~~~~~~~~~~~~
C:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include/MDDSerialPackager.h:243:68: note: passing argument to parameter 'u' here
DllExport void MDD_SerialPackagerAddInteger(void* p_package, int * u, size_t n, int endian) {
                                                                   ^
TestSerialPackager_UDP_functions.c:444:41: warning: passing 'const double *' to parameter of type 'double *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  MDD_SerialPackagerAddDouble(_pkg_ext, (const double*) _u_c89, size_of_dimension_base_array(_u, ((modelica_integer) 1)), _byteOrder_ext);
                                        ^~~~~~~~~~~~~~~~~~~~~~
C:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include/MDDSerialPackager.h:307:70: note: passing argument to parameter 'u' here
DllExport void MDD_SerialPackagerAddDouble(void* p_package, double * u, size_t n, int endian) {
                                                                     ^
TestSerialPackager_UDP_functions.c:462:48: warning: passing 'const double *' to parameter of type 'double *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  MDD_SerialPackagerAddDoubleAsFloat(_pkg_ext, (const double*) _u_c89, size_of_dimension_base_array(_u, ((modelica_integer) 1)), _byteOrder_ext);
                                               ^~~~~~~~~~~~~~~~~~~~~~
C:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include/MDDSerialPackager.h:369:77: note: passing argument to parameter 'u' here
DllExport void MDD_SerialPackagerAddDoubleAsFloat(void* p_package, double * u, size_t n, int endian) {
                                                                            ^
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_08bnd.o TestSerialPackager_UDP_08bnd.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_09alg.o TestSerialPackager_UDP_09alg.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_10asr.o TestSerialPackager_UDP_10asr.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_11mix.o TestSerialPackager_UDP_11mix.c
3 warnings generated.
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_12jac.o TestSerialPackager_UDP_12jac.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_13opt.o TestSerialPackager_UDP_13opt.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_14lnz.o TestSerialPackager_UDP_14lnz.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_15syn.o TestSerialPackager_UDP_15syn.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_16dae.o TestSerialPackager_UDP_16dae.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_17inl.o TestSerialPackager_UDP_17inl.c
clang  -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o TestSerialPackager_UDP_18spd.o TestSerialPackager_UDP_18spd.c
clang -I. -o TestSerialPackager_UDP.exe TestSerialPackager_UDP.o TestSerialPackager_UDP_functions.o TestSerialPackager_UDP_records.o TestSerialPackager_UDP_01exo.o TestSerialPackager_UDP_02nls.o TestSerialPackager_UDP_03lsy.o TestSerialPackager_UDP_04set.o TestSerialPackager_UDP_05evt.o TestSerialPackager_UDP_06inz.o TestSerialPackager_UDP_07dly.o TestSerialPackager_UDP_08bnd.o TestSerialPackager_UDP_09alg.o TestSerialPackager_UDP_10asr.o TestSerialPackager_UDP_11mix.o TestSerialPackager_UDP_12jac.o TestSerialPackager_UDP_13opt.o TestSerialPackager_UDP_14lnz.o TestSerialPackager_UDP_15syn.o TestSerialPackager_UDP_16dae.o TestSerialPackager_UDP_17inl.o TestSerialPackager_UDP_18spd.o "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -L"C:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Blocks/Examples"    -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse     "-IC:/Users/benjamins/AppData/Roaming/.openmodelica/libraries/Modelica_DeviceDrivers 2.1.1/Resources/Include" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc/c" -I"C:/Program Files/OpenModelica1.20.0-64bit/include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TestSerialPackager_UDP -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -L"C:/Program Files/OpenModelica1.20.0-64bit/lib//omc" -L"C:/Program Files/OpenModelica1.20.0-64bit/lib" -Wl,--stack,16777216,-rpath,"C:/Program Files/OpenModelica1.20.0-64bit/lib//omc" -L"C:/Program Files/OpenModelica1.20.0-64bit/bin" -Wl,-rpath,"C:/Program Files/OpenModelica1.20.0-64bit/lib"  -fopenmp -Wl,-Bstatic -lregex -ltre -lintl -liconv -lexpat -lpthread -loleaut32 -limagehlp -lhdf5 -lz -lszip -Wl,-Bdynamic -lSimulationRuntimeC -Wl,-Bdynamic -lomcgc -lopenblas -Wl,-Bdynamic  -lstdc++ -Wl,-Bdynamic  
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0xa7): undefined reference to `__imp_recvfrom'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0xc8): undefined reference to `WSAPoll'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x154): undefined reference to `__imp_WSAGetLastError'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x22f): undefined reference to `__imp_recvfrom'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x3a0): undefined reference to `__imp_htons'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x3b5): undefined reference to `__imp_inet_pton'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x3e6): undefined reference to `__imp_sendto'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x411): undefined reference to `__imp_WSAGetLastError'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x42f): undefined reference to `__imp_WSAGetLastError'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x1053): undefined reference to `__imp_WSAStartup'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x1083): undefined reference to `__imp_socket'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x10ba): undefined reference to `__imp_htons'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x10e1): undefined reference to `__imp_bind'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x119b): undefined reference to `__imp_WSAGetLastError'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x11a3): undefined reference to `__imp_WSACleanup'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x11bb): undefined reference to `__imp_closesocket'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x11c9): undefined reference to `__imp_WSAGetLastError'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x11d1): undefined reference to `__imp_WSACleanup'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x1201): undefined reference to `__imp_shutdown'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x120c): undefined reference to `__imp_WSAGetLastError'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x1224): undefined reference to `__imp_closesocket'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x1243): undefined reference to `__imp_WSACleanup'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x12a6): undefined reference to `__imp_shutdown'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x12b1): undefined reference to `__imp_WSAGetLastError'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x12c9): undefined reference to `__imp_closesocket'
C:\PROGRA~1\OPENMO~1.0-6\tools\msys\mingw64\bin\ld: TestSerialPackager_UDP_functions.o:TestSerialPackager:(.text+0x1342): undefined reference to `__imp_WSACleanup'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
mingw32-make: *** [TestSerialPackager_UDP.makefile:37: omc_main_target] Error 1
mingw32-make: Leaving directory 'C:/Users/BENJAM~1/AppData/Local/Temp/OPENMO~1/OMEdit/MODELI~1.TES'
Compilation process failed. Exited with code 0x00000002.

Unfortunately, this seems to be a bug which crept into recent versions of OpenModelica. I reported it at OpenModelica/OpenModelica#10132. Not sure at which version of OpenModelica the problem started.

A workaround which works for me is adding the missing library manually in the simulation setup under C/C++ Compiler Flags (Optional): -lws2_32:

grafik