error LNK2001: unresolved external symbol

S

sadegh

Hi

I have a problem with my program in VC++6
When I compile it, the following errors are listed. I spend a lot of
time on the groups.google.com to find its reason, but none of comments
could not help me. Does any body know what is the problem?.
Thanks.


OtherFunctions.obj : error LNK2001: unresolved external symbol "int
__cdecl MLength(class math::matrix<double> const &)" (?MLength@@YAHABV?
$matrix@N@math@@@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "int
__cdecl MLength(class math::matrix<double> const &)" (?MLength@@YAHABV?
$matrix@N@math@@@Z)
OtherFunctions.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MHoriz(class math::matrix<double> const
&)" (?MHoriz@@YA?AV?$matrix@N@math@@ABV12@@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MConCat(class math::matrix<double> const
&,class math::matrix<double> const &,char)" (?MConCat@@YA?AV?
$matrix@N@math@@ABV12@0D@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MSubMat(class math::matrix<double> const
&,int,int,int,int)" (?MSubMat@@YA?AV?$matrix@N@math@@ABV12@HHHH@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MDotDiv(class math::matrix<double> const
&,double)" (?MDotDiv@@YA?AV?$matrix@N@math@@ABV12@N@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "void
__cdecl MInsert(class math::matrix<double> &,double)" (?
MInsert@@YAXAAV?$matrix@N@math@@N@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "double
__cdecl MtoD(class math::matrix<double> const &)" (?MtoD@@YANABV?
$matrix@N@math@@@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MSum(class math::matrix<double> const
&)" (?MSum@@YA?AV?$matrix@N@math@@ABV12@@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MDotMul(class math::matrix<double> const
&,double)" (?MDotMul@@YA?AV?$matrix@N@math@@ABV12@N@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MDotDiv(class math::matrix<double> const
&,class math::matrix<double> const &)" (?MDotDiv@@YA?AV?
$matrix@N@math@@ABV12@0@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MLog10(class math::matrix<double> const
&)" (?MLog10@@YA?AV?$matrix@N@math@@ABV12@@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MAsin(class math::matrix<double> const
&)" (?MAsin@@YA?AV?$matrix@N@math@@ABV12@@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MSqrt(class math::matrix<double> const
&)" (?MSqrt@@YA?AV?$matrix@N@math@@ABV12@@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MDotMul(class math::matrix<double> const
&,class math::matrix<double> const &)" (?MDotMul@@YA?AV?
$matrix@N@math@@ABV12@0@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MCos(class math::matrix<double> const
&)" (?MCos@@YA?AV?$matrix@N@math@@ABV12@@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MDotPow(class math::matrix<double> const
&,double)" (?MDotPow@@YA?AV?$matrix@N@math@@ABV12@N@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MSin(class math::matrix<double> const
&)" (?MSin@@YA?AV?$matrix@N@math@@ABV12@@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MRemCol(class math::matrix<double> const
&,int)" (?MRemCol@@YA?AV?$matrix@N@math@@ABV12@H@Z)
Preprocess.obj : error LNK2001: unresolved external symbol "class
math::matrix<double> __cdecl MSub(class math::matrix<double> const
&,double)" (?MSub@@YA?AV?$matrix@N@math@@ABV12@N@Z)
Debug/Software.exe : fatal error LNK1120: 19 unresolved externals
Error executing link.exe.

Software.exe - 21 error(s), 0 warning(s)
 
D

dave_mikesell

Hi

I have a problem with my program in VC++6
When I compile it, the following errors are listed. I spend a lot of
time on the groups.google.com to find its reason, but none of comments
could not help me. Does any body know what is the problem?.
Thanks.

OtherFunctions.obj : error LNK2001: unresolved external symbol "int
__cdecl MLength(class math::matrix<double> const &)" (?MLength@@YAHABV?
$matrix@N@math@@@Z)

What library contains these math classes? It looks like you're not
linking with it.
 
T

Thomas Matthews

sadegh said:
Hi

I have a problem with my program in VC++6
When I compile it, the following errors are listed. I spend a lot of
time on the groups.google.com to find its reason, but none of comments
could not help me. Does any body know what is the problem?.
Thanks.


OtherFunctions.obj : error LNK2001: unresolved external symbol "int
__cdecl MLength(class math::matrix<double> const &)" (?MLength@@YAHABV?
$matrix@N@math@@@Z) [snip]


Software.exe - 21 error(s), 0 warning(s)

An "unresolved external symbol" is an identifier that the translator
could not find. In many instances, a source file was not specified
or a library not included.

Examine the requirements of your header files and verify that
you have specified all necessary source and libraries to your
translator (compiler).

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 
V

Victor Bazarov

sadegh said:
Hi

I have a problem with my program in VC++6
When I compile it, the following errors are listed. I spend a lot of
time on the groups.google.com to find its reason, but none of comments
could not help me. Does any body know what is the problem?.

The problem is that your linker cannot find the defintions of those
functions.
Most likely you have forgotten to add the module where those function are
defined to the project. However, we can't help you with that because it's
not defined by C++, but by VC++ project organization. Post to
'microsoft.public.vc.project-mgt' or 'microsoft.public.vc.ide_general'.
Thanks.


OtherFunctions.obj : error LNK2001: unresolved external symbol "int
__cdecl MLength(class math::matrix<double> const &)"
(?MLength@@YAHABV? $matrix@N@math@@@Z)
[..]

V
 
S

sadegh

What library contains these math classes? It looks like you're not
linking with it.

the library that contains these math classes is matrixop.h where I
have been added it in "StdAfx.h" file.
 
V

Victor Bazarov

sadegh said:
the library that contains these math classes is matrixop.h where I
have been added it in "StdAfx.h" file.

No, it's not the "library that contains these math classes". It's
the header that contains the definitions of the classes. The actual
implementation is most likely in a ".lib" file. You need to read the
documentation for your library and pay attention to what you need to
do with the .lib file, along with adding the header to your source.

This, however, is all off-topic because it's specific to Windows or
Visual C++. Please post to the appropriate newsgroup from the family
'microsoft.public.vc.*'.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top