Linking error ..



 DEVELOP > c-Plus-Plus > Linking error ..

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: ""
Date: 02 Feb 2008 03:22:18 PM
Object: Linking error ..
Currently I get following errors during linking:
1>Linking...
1>Matrix4x4.obj : error LNK2019: unresolved external symbol "public:
__thiscall Reference<class Matrix4x4>::Reference<class
Matrix4x4>(class Matrix4x4 *)" (??0?
$Reference@VMatrix4x4@@@@QAE@PAVMatrix4x4@@@Z) referenced in function
"public: class Reference<class Matrix4x4> __thiscall
Matrix4x4::operator*(class Reference<class Matrix4x4> const &)const
" (??DMatrix4x4@@QBE?AV?$Reference@VMatrix4x4@@@@ABV1@@Z)
1>Matrix4x4.obj : error LNK2019: unresolved external symbol "public:
class Matrix4x4 const * __thiscall Reference<class
Matrix4x4>::operator->(void)const " (??C?
$Reference@VMatrix4x4@@@@QBEPBVMatrix4x4@@XZ) referenced in function
"public: class Reference<class Matrix4x4> __thiscall
Matrix4x4::operator*(class Reference<class Matrix4x4> const &)const
" (??DMatrix4x4@@QBE?AV?$Reference@VMatrix4x4@@@@ABV1@@Z)
1>C:\Users\Micha=EBl\Documents\Visual Studio 2005\Projects\RenderWoman
\Debug\RenderWoman.exe : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Users\Micha=EBl\Documents\Visual
Studio 2005\Projects\RenderWoman\RenderWoman\Debug\BuildLog.htm"
1>RenderWoman - 3 error(s), 0 warning(s)
I have no idea what they mean, anyone?
Might be the templates that I used, was my first time.
.

User: "Alf P. Steinbach"

Title: Re: Linking error .. 02 Feb 2008 03:39:39 PM
* michael.goossens@gmail.com:

Currently I get following errors during linking:

1>Linking...
1>Matrix4x4.obj : error LNK2019: unresolved external symbol "public:
__thiscall Reference<class Matrix4x4>::Reference<class
Matrix4x4>(class Matrix4x4 *)" (??0?
$Reference@VMatrix4x4@@@@QAE@PAVMatrix4x4@@@Z) referenced in function
"public: class Reference<class Matrix4x4> __thiscall
Matrix4x4::operator*(class Reference<class Matrix4x4> const &)const
" (??DMatrix4x4@@QBE?AV?$Reference@VMatrix4x4@@@@ABV1@@Z)
1>Matrix4x4.obj : error LNK2019: unresolved external symbol "public:
class Matrix4x4 const * __thiscall Reference<class
Matrix4x4>::operator->(void)const " (??C?
$Reference@VMatrix4x4@@@@QBEPBVMatrix4x4@@XZ) referenced in function
"public: class Reference<class Matrix4x4> __thiscall
Matrix4x4::operator*(class Reference<class Matrix4x4> const &)const
" (??DMatrix4x4@@QBE?AV?$Reference@VMatrix4x4@@@@ABV1@@Z)
1>C:\Users\Michaël\Documents\Visual Studio 2005\Projects\RenderWoman
\Debug\RenderWoman.exe : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Users\Michaël\Documents\Visual
Studio 2005\Projects\RenderWoman\RenderWoman\Debug\BuildLog.htm"
1>RenderWoman - 3 error(s), 0 warning(s)

I have no idea what they mean, anyone?

They mean you lack compiled definitions of those functions.

Might be the templates that I used, was my first time.

See FAQ item 35.12 "Why can't I separate the definition of my templates
class from it's declaration and put it inside a .cpp file?" e.g. at
<url:http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12>.
Cheers, & hth.,
- Alf
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
.
User: ""

Title: Re: Linking error .. 02 Feb 2008 04:25:12 PM
On 2 feb, 22:39, "Alf P. Steinbach" <al...@start.no> wrote:

* michael.gooss...@gmail.com:



Currently I get following errors during linking:


1>Linking...
1>Matrix4x4.obj : error LNK2019: unresolved external symbol "public:
__thiscall Reference<class Matrix4x4>::Reference<class
Matrix4x4>(class Matrix4x4 *)" (??0?
$Reference@VMatrix4x4@@@@QAE@PAVMatrix4x4@@@Z) referenced in function
"public: class Reference<class Matrix4x4> __thiscall
Matrix4x4::operator*(class Reference<class Matrix4x4> const &)const
" (??DMatrix4x4@@QBE?AV?$Reference@VMatrix4x4@@@@ABV1@@Z)
1>Matrix4x4.obj : error LNK2019: unresolved external symbol "public:
class Matrix4x4 const * __thiscall Reference<class
Matrix4x4>::operator->(void)const " (??C?
$Reference@VMatrix4x4@@@@QBEPBVMatrix4x4@@XZ) referenced in function
"public: class Reference<class Matrix4x4> __thiscall
Matrix4x4::operator*(class Reference<class Matrix4x4> const &)const
" (??DMatrix4x4@@QBE?AV?$Reference@VMatrix4x4@@@@ABV1@@Z)
1>C:\Users\Micha=EBl\Documents\Visual Studio 2005\Projects\RenderWoman
\Debug\RenderWoman.exe : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Users\Micha=EBl\Documents\Visual
Studio 2005\Projects\RenderWoman\RenderWoman\Debug\BuildLog.htm"
1>RenderWoman - 3 error(s), 0 warning(s)


I have no idea what they mean, anyone?


They mean you lack compiled definitions of those functions.

Might be the templates that I used, was my first time.


See FAQ item 35.12 "Why can't I separate the definition of my templates
class from it's declaration and put it inside a .cpp file?" e.g. at
<url:http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12>.

Cheers, & hth.,

- Alf

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Yep that did the trick :), seems that it aint possible to seperate
implementation from definition when using templates.
BTW, in several implementations I have seen inline functions were
implemented in the header. I had some inline functions in cpp file, so
is there I reason why I shouldn't be doing that?
.
User: "Ian Collins"

Title: Re: Linking error .. 02 Feb 2008 05:21:39 PM
wrote:

On 2 feb, 22:39, "Alf P. Steinbach" <al...@start.no> wrote:

See FAQ item 35.12 "Why can't I separate the definition of my templates
class from it's declaration and put it inside a .cpp file?" e.g. at
<url:http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12>.

Cheers, & hth.,

*Please* don't quote signatures.


Yep that did the trick :), seems that it aint possible to seperate
implementation from definition when using templates.

That depends on the compiler. Some may support "export" which addresses
the problem, other may use implicit rules to locate the definitions.

BTW, in several implementations I have seen inline functions were
implemented in the header. I had some inline functions in cpp file, so
is there I reason why I shouldn't be doing that?

Probably not, if the are inline.
--
Ian Collins.
.




  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER