Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Unresolved External Symbol

Reply
Thread Tools

Unresolved External Symbol

 
 
Freddy
Guest
Posts: n/a
 
      04-18-2004
I am not an experienced programmer, but I had a VC++ program I am
trying to eliminate all the VC++ commands from it...and keeping it as
a normal C/C++ program......I guess I have succeeded so far, but I am
getting the unresolved external symbol errors, this is what I am
getting:


Linking...
Test.obj : error LNK2001: unresolved external symbol "void __cdecl
free_vector(double *)" (?free_vector@@YAXPAN@Z)
Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
resize(double *,unsigned int)" (?resize@@YAPANPANI@Z)
Test.obj : error LNK2001: unresolved external symbol "double __cdecl
fmax(double * const)" (?fmax@@YANQAN@Z)
Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
Derivs(double,double * const,double * const,unsigned short,char *
const)" (?Derivs@@YAPANNQAN0GQAD@Z)
Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
dvector(unsigned int)" (?dvector@@YAPANI@Z)
Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
Derivs(double,double * const,double * const,unsigned short)"
(?Derivs@@YAPANNQAN0G@Z)
Debug/Test.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.

Test.exe - 7 error(s), 0 warning(s)

Please help, not sure what is the problem. what could be the solution.
 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      04-18-2004
"Freddy" <> wrote...
> I am not an experienced programmer, but I had a VC++ program I am
> trying to eliminate all the VC++ commands from it...


What does that mean, exactly? You're still compiling it using VC++...

>and keeping it as
> a normal C/C++ program......I guess I have succeeded so far, but I am
> getting the unresolved external symbol errors, this is what I am
> getting:
>
>
> Linking...
> Test.obj : error LNK2001: unresolved external symbol "void __cdecl
> free_vector(double *)" (?free_vector@@YAXPAN@Z)
> Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
> resize(double *,unsigned int)" (?resize@@YAPANPANI@Z)
> Test.obj : error LNK2001: unresolved external symbol "double __cdecl
> fmax(double * const)" (?fmax@@YANQAN@Z)
> Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
> Derivs(double,double * const,double * const,unsigned short,char *
> const)" (?Derivs@@YAPANNQAN0GQAD@Z)
> Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
> dvector(unsigned int)" (?dvector@@YAPANI@Z)
> Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
> Derivs(double,double * const,double * const,unsigned short)"
> (?Derivs@@YAPANNQAN0G@Z)
> Debug/Test.exe : fatal error LNK1120: 6 unresolved externals
> Error executing link.exe.
>
> Test.exe - 7 error(s), 0 warning(s)
>
> Please help, not sure what is the problem. what could be the solution.


The solution would be to provide the definitions of those functions
during the linking stage of building your project. As to where they
come from, or how to add them to the project, sorry, off-topic here.

Try asking in a newsgroup for VC++: microsoft.public.vc.* hierarchy.

Victor


 
Reply With Quote
 
 
 
 
Kutty Banerjee
Guest
Posts: n/a
 
      04-18-2004

"Freddy" <> wrote in message
news: om...
> I am not an experienced programmer, but I had a VC++ program I am
> trying to eliminate all the VC++ commands from it...and keeping it as
> a normal C/C++ program......I guess I have succeeded so far, but I am
> getting the unresolved external symbol errors, this is what I am
> getting:
>
>
> Linking...
> Test.obj : error LNK2001: unresolved external symbol "void __cdecl
> free_vector(double *)" (?free_vector@@YAXPAN@Z)
> Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
> resize(double *,unsigned int)" (?resize@@YAPANPANI@Z)
> Test.obj : error LNK2001: unresolved external symbol "double __cdecl
> fmax(double * const)" (?fmax@@YANQAN@Z)
> Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
> Derivs(double,double * const,double * const,unsigned short,char *
> const)" (?Derivs@@YAPANNQAN0GQAD@Z)
> Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
> dvector(unsigned int)" (?dvector@@YAPANI@Z)
> Test.obj : error LNK2001: unresolved external symbol "double * __cdecl
> Derivs(double,double * const,double * const,unsigned short)"
> (?Derivs@@YAPANNQAN0G@Z)
> Debug/Test.exe : fatal error LNK1120: 6 unresolved externals
> Error executing link.exe.
>
> Test.exe - 7 error(s), 0 warning(s)
>
> Please help, not sure what is the problem. what could be the solution.

Hi,
I agree with the earlier post that this is out of topic and moreso need
soem more information, but my immediate guess is that you are calling c++
functions from a C program without doing #ifdef __cplusplus stuff. Do that.
another thing that could go wrong is the calling convention. make sure
you are sticking to one properly and not mixing between them.

kutty


 
Reply With Quote
 
twotonetool twotonetool is offline
Junior Member
Join Date: Nov 2009
Posts: 1
 
      11-18-2009
In the header file for C files (ANSI C), add the following
prior to and after function prototypes.

#ifdef __cplusplus
extern "C"
{


#ifdef __cplusplus
}
#endif

This cured my particular problem which rendered this link error.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unresolved external symbol/using an external dll Scott Allen C++ 8 05-02-2004 06:11 PM
Linking errors. - VC++ - Unresolved external Symbol mp C++ 2 12-12-2003 06:21 PM
"unresolved external symbol" error in MSVC++ 6.0 Rodolphe C++ 4 10-03-2003 09:44 AM
error LNK2001: unresolved external symbol _IID_IDirectDraw7 Izak Pretorius C++ 2 09-14-2003 11:18 AM
Re: unresolved external symbol error. Need help! John Harrison C++ 0 07-20-2003 07:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57