Redifinition error
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a cpp code that runs well in VS2010. When I try to run it on Matlab 2010a by using mex command, it gives redefinition error.
c:\users\amit\documents\matlab\real_c++\redacmodel.cpp(20) : error C2371: 'FORCE' : redefinition; different basic types
c:\users\amit\documents\matlab\real_c++\blueacmodel.cpp(20) : see declaration of 'FORCE'
What is the reason? Thanks in advance.
0 comentarios
Respuestas (1)
Walter Roberson
el 8 de Jun. de 2012
I would speculate that FORCE is an "extern" variable in the two .cpp files.
The two .cpp files define FORCE with different data types. Look at line 20 of each of the two different source files to see how it is defined for the two.
4 comentarios
Walter Roberson
el 9 de Jun. de 2012
You can find an unofficial copy of ISO C at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
Ver también
Categorías
Más información sobre Call C++ from MATLAB 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!