IdentifiantMot de passe
Loading...
Mot de passe oubli� ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les r�ponses en temps r�el, voter pour les messages, poser vos propres questions et recevoir la newsletter

C++ Discussion :

Undefined symbol and Call to undefined function


Sujet :

C++

Vue hybride

Message pr�c�dent Message pr�c�dent   Message suivant Message suivant
  1. #1
    Membre confirm� Avatar de airballman
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    256
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 256
    Par d�faut Undefined symbol and Call to undefined function
    Bonjour tout le monde,

    Je code sous Matlab, et la raison de ma pr�sence ici est que j'ai besoin de compiler un fichier c++ pour en faire un mex. Je cherche en fait � r�utiliser une partie d'un code qui a �t� d�velopp� ici

    Je compile un fichier nomm� 'mb_Znl.cpp' � l'aide de Borderland 5.0.
    J'ai des erreurs de compilation (j'ai r�ussi � en r�gler certaines mais je bloque sur celles qui restent) :

    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
     
    mb_Znl.cpp: 
    Error E2451 mb_Znl.cpp 48: Undefined symbol 'complex' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2379 mb_Znl.cpp 48: Statement missing ; in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2379 mb_Znl.cpp 49: Statement missing ; in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2380 mb_Znl.cpp 57: Unterminated string or character constant in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2121 mb_Znl.cpp 58: Function call missing ) in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2380 mb_Znl.cpp 62: Unterminated string or character constant in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2379 mb_Znl.cpp 64: Statement missing ; in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2451 mb_Znl.cpp 106: Undefined symbol 'sum' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2451 mb_Znl.cpp 111: Undefined symbol 'Vnl' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2268 mb_Znl.cpp 116: Call to undefined function 'polar' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2268 mb_Znl.cpp 127: Call to undefined function 'conj' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2451 mb_Znl.cpp 130: Undefined symbol 'PI' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2268 mb_Znl.cpp 139: Call to undefined function 'real' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2268 mb_Znl.cpp 140: Call to undefined function 'imag' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    *** 14 errors in Compile *** 
     
      C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL: Error: Compile of 'mb_Znl.cpp' failed.
    Je comprends en fait les erreurs que j'obtiens, et je me doute qu'il doit manquer un include au d�but du fichier. J'ai d�j� moi-m�me ajout� le #include "math.h" qui m'apermis de r�gler une certaine partie des erreurs.

    Voici l'en-t�te du fichier :
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    #include "mex.h"
    #include "matrix.h"
    #include "math.h"
     
    #define row 0mex
    #define col 1

    Ma question est en fait tr�s simple, devant le nombre de fonction qui ne sont pas d�finies ici, je me doute qu'il manque simplement un #include qui serve aux calculs complexes . Oui mais voil�, quel appel manque-t-il?

    Je ne suis pas du tout familier avec les built-in C, et encore moins C++ :s

    Merci d'avance, je reste � disposition si vous voulez plus d'informations!
    ( et je m'excuse par avance si il y a des informations que j'ai oubli�es de donner) .

  2. #2
    Membre confirm� Avatar de airballman
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    256
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 256
    Par d�faut
    Bon, j'ai avanc� un peu :

    J'ai cr�e une variable PI qui me permet de r�gler une erreur
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    #ifndef PI
    #define PI 3.14159265358979323846
    #endif
    Ensuite, pour ce qui est des fonctions complex, polar, real et iamge qui ne sont pas d�finies, j'ai essay� de m'appuyer sur le 'complex.h' en ajoutant
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    #include "complex.h" en début de fichier
    J'ai maintenant des erreurs diff�rentes. JE suis s�r qu'en r�glant le probl�me du complex tout devait rouler sans probl�mes, car les erreurs s'entra�nent les une apr�s les autres .

    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland 
    mb_Znl.cpp: 
    Error E2102 mb_Znl.cpp 53: Cannot use template 'complex<T>' without specifying specialization parameters in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2040 mb_Znl.cpp 53: Declaration terminated incorrectly in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2102 mb_Znl.cpp 54: Cannot use template 'complex<T>' without specifying specialization parameters in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2040 mb_Znl.cpp 54: Declaration terminated incorrectly in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2380 mb_Znl.cpp 62: Unterminated string or character constant in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2121 mb_Znl.cpp 63: Function call missing ) in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2380 mb_Znl.cpp 67: Unterminated string or character constant in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2379 mb_Znl.cpp 69: Statement missing ; in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2451 mb_Znl.cpp 111: Undefined symbol 'sum' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2451 mb_Znl.cpp 116: Undefined symbol 'Vnl' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2285 mb_Znl.cpp 132: Could not find a match for 'conj<T>(undefined)' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2285 mb_Znl.cpp 144: Could not find a match for 'real<T>(undefined)' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    Error E2285 mb_Znl.cpp 145: Could not find a match for 'imag<T>(undefined)' in function mexFunction(int,mxArray_tag * *,int,const mxArray_tag * *) 
    *** 13 errors in Compile *** 
     
      C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL: Error: Compile of 'mb_Znl.cpp' failed.

    Le cr�ateur du code l'a utilis� pour sa th�se, je pense donc qu'il devrait tourner et que ce n'est qu'un probl�me mineur :s

    Une id�e?

Discussions similaires

  1. [XSLT] Call to undefined function xslt_create
    Par rudy207 dans le forum Biblioth�ques et frameworks
    R�ponses: 4
    Dernier message: 30/04/2009, 17h27
  2. [SGBD] Call to undefined function mysql_connect()
    Par monphp dans le forum SQL Proc�dural
    R�ponses: 13
    Dernier message: 29/01/2006, 21h33
  3. Call to undefined function mysql_connect()
    Par monphp dans le forum Installation
    R�ponses: 1
    Dernier message: 29/12/2005, 13h31
  4. R�ponses: 11
    Dernier message: 08/12/2005, 16h54
  5. Call to undefined function mysql_pconnect()
    Par shirya dans le forum Installation
    R�ponses: 2
    Dernier message: 03/11/2005, 21h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo