Hi,
I've a C program that compile with g++ and I'm trying to have it
compiled by Micorosoft Visual C++ Express 2008.
The problem is that at the link stage, I've error lnk2019 and lnk2001
occurring for functions defined in the source code.
Here are the errors :
1>cinaudio.obj : error LNK2019: symbole externe non résolu "int __cdecl
copyPoint(struct point_t *,struct point_t *)"
(?copyPoint@@YAHPAUpoint_t@@[EMAIL PROTECTED]) référencé dans la fonction "int
__cdecl
moveSource(int,struct point_t *,struct auralizationInfo_t *)"
(?moveSource@@YAHHPAUpoint_t@@PAUauralizationInfo_t@@@Z)
1>vbap.obj : error LNK2001: symbole externe non résolu "int __cdecl
copyPoint(struct point_t *,struct point_t *)"
(?copyPoint@@YAHPAUpoint_t@@[EMAIL PROTECTED])
1>xhout5.obj : error LNK2001: symbole externe non résolu "int __cdecl
copyPoint(struct point_t *,struct point_t *)"
(?copyPoint@@YAHPAUpoint_t@@[EMAIL PROTECTED])
1>cinaudio.obj : error LNK2019: symbole externe non résolu "int __cdecl
printPoint(struct point_t *)" (?printPoint@@YAHPAUpoint_t@@@Z) référencé
dans la fonction "int __cdecl printSourcePosition(int,struct
auralizationInfo_t *)" (?printSourcePosition@@YAHHPAUauralizationInfo_t@@@Z)
1>cinaudio.obj : error LNK2019: symbole externe non résolu "int __cdecl
initPointCart(struct point_t *,float,float,float)"
(?initPointCart@@YAHPAUpoint_t@@[EMAIL PROTECTED]) référencé dans la fonction
"int
__cdecl initAuralization(struct auralizationInfo_t *,char *,char *,char
*,char *,char *,int,void *)"
(?initAuralization@@YAHPAUauralizationInfo_t@@[EMAIL PROTECTED])
1>echo2ir2.obj : error LNK2001: symbole externe non résolu "int __cdecl
initPointCart(struct point_t *,float,float,float)"
(?initPointCart@@YAHPAUpoint_t@@[EMAIL PROTECTED])
1>interfaceC.obj : error LNK2001: symbole externe non résolu "int
__cdecl initPointCart(struct point_t *,float,float,float)"
(?initPointCart@@YAHPAUpoint_t@@[EMAIL PROTECTED])
1>echo2ir2.obj : error LNK2019: symbole externe non résolu "int __cdecl
initPointVec(struct point_t *,float,float,float)"
(?initPointVec@@YAHPAUpoint_t@@[EMAIL PROTECTED]) référencé dans la fonction
"struct
roomImpulseResponse_t * __cdecl myConvertSI(struct image_source_info
*,struct multiFilterInfo_t *)"
(?myConvertSI@@YAPAUroomImpulseResponse_t@@PAUimage_source_info@@PAUmultiFilterInfo_t@@@Z)
1>interfaceC.obj : error LNK2001: symbole externe non résolu "int
__cdecl initPointVec(struct point_t *,float,float,float)"
(?initPointVec@@YAHPAUpoint_t@@[EMAIL PROTECTED])
1>echo2ir2.obj : error LNK2019: symbole externe non résolu "int __cdecl
addAzimuth(struct point_t *,float)" (?addAzimuth@@YAHPAUpoint_t@@[EMAIL
PROTECTED])
référencé dans la fonction "int __cdecl combineRIRsVBAP(struct
salrevResults_t *,struct vbapInfo_t *,float,float * *,int *)"
(?combineRIRsVBAP@@YAHPAUsalrevResults_t@@PAUvbapInfo_t@@[EMAIL PROTECTED])
1>vbap.obj : error LNK2019: symbole externe non résolu "int __cdecl
invert3DVectMatrix(struct cartVec_t *,struct cartVec_t *,struct
cartVec_t *,double *)" (?invert3DVectMatrix@@YAHPAUcartVec_t@@[EMAIL
PROTECTED])
référencé dans la fonction "int __cdecl
anyLsInsideTriplet(int,int,int,struct ls_t *,int)"
(?anyLsInsideTriplet@@YAHHHHPAUls_t@@[EMAIL PROTECTED])
1>vbap.obj : error LNK2019: symbole externe non résolu "int __cdecl
measureAngle(struct cartVec_t,struct cartVec_t,float *)"
(?measureAngle@@YAHUcartVec_t@@[EMAIL PROTECTED]) référencé dans la fonction
"float
__cdecl volPSideLgth(int,int,int,struct ls_t *)"
(?volPSideLgth@@YAMHHHPAUls_t@@@Z)
1>vbap.obj : error LNK2019: symbole externe non résolu "int __cdecl
doVecProd(struct cartVec_t,struct cartVec_t,float *)"
(?doVecProd@@YAHUcartVec_t@@[EMAIL PROTECTED]) référencé dans la fonction
"float
__cdecl volPSideLgth(int,int,int,struct ls_t *)"
(?volPSideLgth@@YAMHHHPAUls_t@@@Z)
1>vbap.obj : error LNK2019: symbole externe non résolu "int __cdecl
doCrossProd(struct cartVec_t,struct cartVec_t,struct cartVec_t *)"
(?doCrossProd@@YAHUcartVec_t@@0PAU1@@Z) référencé dans la fonction
"float __cdecl volPSideLgth(int,int,int,struct ls_t *)"
(?volPSideLgth@@YAMHHHPAUls_t@@@Z)
1>vbap.obj : error LNK2019: symbole externe non résolu "int __cdecl
convertSphToCart(struct sphVec_t *,struct cartVec_t *)"
(?convertSphToCart@@YAHPAUsphVec_t@@PAUcartVec_t@@@Z) référencé dans la
fonction "int __cdecl readLssSetupFile(char *,int *,int *,struct ls_t *
*)" (?readLssSetupFile@@YAHPADPAH1PAPAUls_t@@@Z)
1>vbap.obj : error LNK2019: symbole externe non résolu "int __cdecl
invert2DVectMatrix(struct cartVec_t *,struct cartVec_t *,double *)"
(?invert2DVectMatrix@@YAHPAUcartVec_t@@[EMAIL PROTECTED]) référencé dans la
fonction "int __cdecl initVbap(int,int,struct ls_t *,struct vbapInfo_t
*,char *)" (?initVbap@@YAHHHPAUls_t@@PAUvbapInfo_t@@[EMAIL PROTECTED])
1>F:\Mes Documents\Visual Studio
2008\Projects\AuraWinLionel\Debug\AuraWinLionel.exe : fatal error
LNK1120: 11 externes non résolus
Sorry, the text is in french but "symbole externe non résolu" means
"external symbol not found"
The functions prototype are given in "geometry.h" and the definitions
are in "geometry.c".
I'll use the first error as an example.
Part of geometry.h :
/extern int convertSphToCart2(SphVec *from, CartVec *to);
extern int convertSphToCart(SphVec *from, CartVec *to);
extern int convertCartToSph(CartVec *from, SphVec *to);
extern int getLengthVec(CartVec v1, float *result);
extern int measureAngle(CartVec v1, CartVec v2, float *result);
extern int doVecProd(CartVec v1, CartVec v2, float *result);
extern int doCrossProd(CartVec v1, CartVec v2, CartVec *result);
extern int invert2DVectMatrix(CartVec *v1, CartVec *v2, double *invMat);
extern int invert3DVectMatrix(CartVec *v1, CartVec *v2, CartVec *v3,
double *invMat);
extern int copyPoint(Point *copy, Point *original);
extern int printPoint(Point *pt);
extern int initPointVec(Point *pt, float theta, float phi, float R);
extern int initPointCart(Point *pt, float X, float Y, float Z);
extern int getPointVec(Point *pt, float *theta, float *phi, float *R);
extern int getPointCart(Point *pt, float *X, float *Y, float *Z);
extern int addAzimuth(Point *pt, float azimuth);/
Part of geometry.c :
/int copyPoint(Point *copy, Point *original)
{
copy->cartVec.x = original->cartVec.x;
copy->cartVec.y = original->cartVec.y;
copy->cartVec.z = original->cartVec.z;
copy->sphVec.azi = original->sphVec.azi;
copy->sphVec.ele = original->sphVec.ele;
copy->sphVec.length = original->sphVec.length;
return 0;
//}
/
and copyPoint is called in cinaudio.c by the moveSource function :
/int moveSource(int sourceNo, Point *position, AuralizationInfo *azi)
{
SourceInfo *source;
/* find source sourceNo in the source list */
g_mutex_lock(azi->updateMutex);
source = (SourceInfo *) azi->source;
while ( (source != NULL) && (source->sourceNo != sourceNo)) {
source = (SourceInfo *) source->next;
}
if (source == NULL) {
fprintf(stderr, "error: can't move this source..\n"
"source not in the active source list\n");
g_mutex_unlock(azi->updateMutex);
return 1;
}
else {
source->hasMoved = 1;
copyPoint(&source->newPosition, position);
}
g_mutex_unlock(azi->updateMutex);
return 0;
}/
All these files are included in one project and the compiler is the
standard micorsoft C++ compiler delivered with MSVC++ 2008.
I can't figure where the errors come from.
Any ideas ?
--
Stéphane Lesoinne
[Non-text portions of this message have been removed]