typedef redefinition error when using Real-Time Windows target
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I'm using a custom Simulink block which I create using a .cpp s-function which works well when used in "normal" mode or in "external mode" using Quarc of Quanser.
I created this block to collect Data sent by a Vicon system and used the Vicon SDK.
I can generate the mex file without problem using the "mex SfunCPP_RecoverVicon_SDK.cpp" command.
I attached my s-function to this post (this s-function relies on Client.h, ViconDataStreamSDK_CPP.dll, and ViconDataStreamSDK_CPP.lib provided by Vicon).
The error I obtain when trying to build the simulink model in "external mode" with Real-Time Windows Target (rtwin.tlc) is the following:
### Invoking Target Language Compiler on TestVicon.rtw
### Using System Target File: C:\Program Files\MATLAB\R2013a\toolbox\rtw\targets\rtwin\rtwin\rtwin.tlc
### Loading TLC function libraries
.....
### Initial pass through model to cache user defined code
...
### Caching model source code
.............................................
### Writing source file TestVicon.c
### Writing header file TestVicon_private.h
### Writing header file TestVicon.h
.
### Writing header file TestVicon_types.h
### Writing header file rtwtypes.h
.
### Writing header file rt_defines.h
### Writing header file rt_nonfinite.h
### Writing source file rt_nonfinite.c
.
### Writing header file rtGetInf.h
### Writing source file rtGetInf.c
### Writing header file rtGetNaN.h
.
### Writing source file rtGetNaN.c
### Writing header file rtmodel.h
### Writing source file TestVicon_data.c
.
### TLC code generation complete.
### Generating TLC interface API.
............
### Creating data type transition file TestVicon_dt.h
.
### Processing Template Makefile: C:\Program Files\MATLAB\R2013a\toolbox\rtw\targets\rtwin\rtwin\rtwin.tmf
### Creating TestVicon.mk from C:\Program Files\MATLAB\R2013a\toolbox\rtw\targets\rtwin\rtwin\rtwin.tmf
### Building TestVicon: .\TestVicon.bat
E:\Vicon_WRT\TestVicon_rtwin_win64>set MATLAB=C:\Program Files\MATLAB\R2013a
E:\Vicon_WRT\TestVicon_rtwin_win64>"C:\PROGRA~1\MATLAB\R2013a\bin\win64\gmake" -f TestVicon.mk EXTMODE_STATIC_ALLOC=0 EXTMODE_STATIC_ALLOC_SIZE=1000000 TMW_EXTMODE_TESTING=0 OPTS="-DON_TARGET_WAIT_FOR_START=0"
### Compiling TestVicon.c
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/llvm/bin/clang -emit-llvm -c -O4 -Wno-switch-enum -m64 -D__STDC__ -U_MSC_VER -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include -I. -I.. -IC:/PROGRA~1/MATLAB/R2013a/simulink/include -IC:/PROGRA~1/MATLAB/R2013a/extern/include -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src -IE:/Vicon_WRT/TestVicon_rtwin_win64 -IE:/Vicon_WRT -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DUSE_RTMODEL -DMODEL=TestVicon -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -o "TestVicon.obj" "TestVicon.c"
### Compiling TestVicon_data.c
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/llvm/bin/clang -emit-llvm -c -O4 -Wno-switch-enum -m64 -D__STDC__ -U_MSC_VER -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include -I. -I.. -IC:/PROGRA~1/MATLAB/R2013a/simulink/include -IC:/PROGRA~1/MATLAB/R2013a/extern/include -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src -IE:/Vicon_WRT/TestVicon_rtwin_win64 -IE:/Vicon_WRT -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DUSE_RTMODEL -DMODEL=TestVicon -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -o "TestVicon_data.obj" "TestVicon_data.c"
### Compiling rtGetInf.c
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/llvm/bin/clang -emit-llvm -c -O4 -Wno-switch-enum -m64 -D__STDC__ -U_MSC_VER -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include -I. -I.. -IC:/PROGRA~1/MATLAB/R2013a/simulink/include -IC:/PROGRA~1/MATLAB/R2013a/extern/include -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src -IE:/Vicon_WRT/TestVicon_rtwin_win64 -IE:/Vicon_WRT -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DUSE_RTMODEL -DMODEL=TestVicon -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -o "rtGetInf.obj" "rtGetInf.c"
### Compiling rtGetNaN.c
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/llvm/bin/clang -emit-llvm -c -O4 -Wno-switch-enum -m64 -D__STDC__ -U_MSC_VER -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include -I. -I.. -IC:/PROGRA~1/MATLAB/R2013a/simulink/include -IC:/PROGRA~1/MATLAB/R2013a/extern/include -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src -IE:/Vicon_WRT/TestVicon_rtwin_win64 -IE:/Vicon_WRT -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DUSE_RTMODEL -DMODEL=TestVicon -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -o "rtGetNaN.obj" "rtGetNaN.c"
### Compiling C:/PROGRA~1/MATLAB/R2013a/rtw/c/src/rt_matrx.c
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/llvm/bin/clang -emit-llvm -c -O4 -Wno-switch-enum -m64 -D__STDC__ -U_MSC_VER -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include -I. -I.. -IC:/PROGRA~1/MATLAB/R2013a/simulink/include -IC:/PROGRA~1/MATLAB/R2013a/extern/include -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src -IE:/Vicon_WRT/TestVicon_rtwin_win64 -IE:/Vicon_WRT -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DUSE_RTMODEL -DMODEL=TestVicon -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -o "rt_matrx.obj" "C:/PROGRA~1/MATLAB/R2013a/rtw/c/src/rt_matrx.c"
### Compiling rt_nonfinite.c
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/llvm/bin/clang -emit-llvm -c -O4 -Wno-switch-enum -m64 -D__STDC__ -U_MSC_VER -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include -I. -I.. -IC:/PROGRA~1/MATLAB/R2013a/simulink/include -IC:/PROGRA~1/MATLAB/R2013a/extern/include -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src -IE:/Vicon_WRT/TestVicon_rtwin_win64 -IE:/Vicon_WRT -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DUSE_RTMODEL -DMODEL=TestVicon -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -o "rt_nonfinite.obj" "rt_nonfinite.c"
### Compiling C:/PROGRA~1/MATLAB/R2013a/rtw/c/src/rt_printf.c
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/llvm/bin/clang -emit-llvm -c -O4 -Wno-switch-enum -m64 -D__STDC__ -U_MSC_VER -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include -I. -I.. -IC:/PROGRA~1/MATLAB/R2013a/simulink/include -IC:/PROGRA~1/MATLAB/R2013a/extern/include -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src -IE:/Vicon_WRT/TestVicon_rtwin_win64 -IE:/Vicon_WRT -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DUSE_RTMODEL -DMODEL=TestVicon -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -o "rt_printf.obj" "C:/PROGRA~1/MATLAB/R2013a/rtw/c/src/rt_printf.c"
### Compiling C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src/rtwin_main.c
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/llvm/bin/clang -emit-llvm -c -O4 -Wno-switch-enum -m64 -D__STDC__ -U_MSC_VER -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include -I. -I.. -IC:/PROGRA~1/MATLAB/R2013a/simulink/include -IC:/PROGRA~1/MATLAB/R2013a/extern/include -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src -IE:/Vicon_WRT/TestVicon_rtwin_win64 -IE:/Vicon_WRT -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DUSE_RTMODEL -DMODEL=TestVicon -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -o "rtwin_main.obj" "C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src/rtwin_main.c"
### Compiling C:/PROGRA~1/MATLAB/R2013a/rtw/c/src/rt_sim.c
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/llvm/bin/clang -emit-llvm -c -O4 -Wno-switch-enum -m64 -D__STDC__ -U_MSC_VER -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include -I. -I.. -IC:/PROGRA~1/MATLAB/R2013a/simulink/include -IC:/PROGRA~1/MATLAB/R2013a/extern/include -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src -IE:/Vicon_WRT/TestVicon_rtwin_win64 -IE:/Vicon_WRT -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DUSE_RTMODEL -DMODEL=TestVicon -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -o "rt_sim.obj" "C:/PROGRA~1/MATLAB/R2013a/rtw/c/src/rt_sim.c"
### Compiling ../SfunCPP_RecoverVicon_SDK.cpp
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/llvm/bin/clang -emit-llvm -c -O4 -Wno-switch-enum -m64 -D__STDC__ -U_MSC_VER -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include -x c++ -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include/cpp -I. -I.. -IC:/PROGRA~1/MATLAB/R2013a/simulink/include -IC:/PROGRA~1/MATLAB/R2013a/extern/include -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2013a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/src -IE:/Vicon_WRT/TestVicon_rtwin_win64 -IE:/Vicon_WRT -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DUSE_RTMODEL -DMODEL=TestVicon -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -o "SfunCPP_RecoverVicon_SDK.obj" "../SfunCPP_RecoverVicon_SDK.cpp"
In file included from ../SfunCPP_RecoverVicon_SDK.cpp:26:
In file included from ../SfunCPP_RecoverVicon_SDK.h:1:
In file included from ../Client.h:40:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocnum:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\streambuf:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xiosbase:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale:8:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdexcept:7:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstring:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmemory:8:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility:8:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility:7:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd:8:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cwchar:13:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wchar.h:65:23: error: typedef redefinition with different types ('struct _iobuf' vs 'size_t' (aka 'unsigned long long'))
typedef struct _iobuf FILE;
^
C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include\stdio.h:24:16: note: previous definition is here
typedef size_t FILE;
^
In file included from ../SfunCPP_RecoverVicon_SDK.cpp:26:
In file included from ../SfunCPP_RecoverVicon_SDK.h:1:
In file included from ../Client.h:40:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocnum:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\streambuf:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xiosbase:6:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale:1625:13: error: use of undeclared identifier 'MB_CUR_MAX'
if ((int)MB_CUR_MAX <= _Last2 - _Mid2)
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale:1861:13: error: use of undeclared identifier 'MB_CUR_MAX'
if ((int)MB_CUR_MAX <= _Last2 - _Mid2)
^
In file included from ../SfunCPP_RecoverVicon_SDK.cpp:26:
In file included from ../SfunCPP_RecoverVicon_SDK.h:1:
In file included from ../Client.h:40:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocnum:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\streambuf:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xiosbase:9:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:23:33: error: use of undeclared identifier 'EAFNOSUPPORT'
address_family_not_supported = EAFNOSUPPORT,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:24:19: error: use of undeclared identifier 'EADDRINUSE'
address_in_use = EADDRINUSE,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:25:26: error: use of undeclared identifier 'EADDRNOTAVAIL'
address_not_available = EADDRNOTAVAIL,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:26:22: error: use of undeclared identifier 'EISCONN'
already_connected = EISCONN,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:27:27: error: use of undeclared identifier 'E2BIG'
argument_list_too_long = E2BIG,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:29:16: error: use of undeclared identifier 'EFAULT'
bad_address = EFAULT,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:30:24: error: use of undeclared identifier 'EBADF'
bad_file_descriptor = EBADF,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:31:16: error: use of undeclared identifier 'EBADMSG'
bad_message = EBADMSG,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:32:16: error: use of undeclared identifier 'EPIPE'
broken_pipe = EPIPE,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:33:23: error: use of undeclared identifier 'ECONNABORTED'
connection_aborted = ECONNABORTED,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:34:35: error: use of undeclared identifier 'EALREADY'
connection_already_in_progress = EALREADY,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:35:23: error: use of undeclared identifier 'ECONNREFUSED'
connection_refused = ECONNREFUSED,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:36:21: error: use of undeclared identifier 'ECONNRESET'
connection_reset = ECONNRESET,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:37:22: error: use of undeclared identifier 'EXDEV'
cross_device_link = EXDEV,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:38:33: error: use of undeclared identifier 'EDESTADDRREQ'
destination_address_required = EDESTADDRREQ,
^
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error:39:28: error: use of undeclared identifier 'EBUSY'
device_or_resource_busy = EBUSY,
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake: *** [SfunCPP_RecoverVicon_SDK.obj] Error 1
### Build procedure for model: 'TestVicon' aborted due to an error.
It seems that the file Client.h I used (provided by the Vicon SDK) includes files (#include <string>) that redefine existing symbols present in C:/PROGRA~1/MATLAB/R2013a/toolbox/rtw/targets/rtwin/lib/include\stdio.h
How can I solve this problem?
1 comentario
Anon
el 21 de Sept. de 2016
Hey, I have a similar problem with R2013a. Did somebody find a solution?
Respuestas (0)
Ver también
Categorías
Más información sobre Simulink Coder en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!