Stephane Lesoinne wrote:
> 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)
<snip>

> 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);
<snip>
> 
> Part of geometry.c :
<snip>

> 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 ?

Yup.  You are probably building a .cpp file and using the header 
geometry.h in that .cpp file.  The compiler is looking for name-mangled 
names.  You need to use extern "C" with some #ifdef logic or rename 
geometry.c to geometry.cpp.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to