Borrar filtros
Borrar filtros

compiling CPP file in Matlab

1 visualización (últimos 30 días)
MD NASAR
MD NASAR el 27 de Dic. de 2012
Dear All,
I am trying to compile CPP file in Matlab the following error comes when we run CPP file
>> mex crossover.cpp
Command line warning D4002 : ignoring unknown option '-Oy-'
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
C:\Users\Nasar\AppData\Local\Temp\mex_3EF2C05A-E50F-47E4-CD92-86944314E3FC\crossover.obj
LINK : error LNK2001: unresolved external symbol mexFunction
C:\Users\Nasar\AppData\Local\Temp\mex_3EF2C05A-E50F-47E4-CD92-86944314E3FC\templib.x : fatal error LNK1120: 1 unresolved externals
LINK : fatal error LNK1141: failure during build of exports file
C:\PROGRA~1\MATLAB\R2007A\BIN\MEX.PL: Error: Link of 'crossover.mexw32' failed.
??? Error using ==> mex at 206
Unable to complete successfully.
we set the compiler through mex -setup command
please resolve the problem.
Thanks

Respuestas (1)

Walter Roberson
Walter Roberson el 27 de Dic. de 2012
Does your crossover.cpp file have
extern "C" {
DATATYPE mexFunction (ARGUMENTS) {
......
}
}
except with a datatype where DATATYPE is indicated, "mexFunction" and actual arguments where ARGUMENTS is indicated?
If your mexFunction is not within an extern "C" then it will not be accessible to MATLAB.

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by