Linking error ..

  • Thread starter michael.goossens
  • Start date
M

michael.goossens

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::eek:perator*(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>::eek:perator->(void)const " (??C?
$Reference@VMatrix4x4@@@@QBEPBVMatrix4x4@@XZ) referenced in function
"public: class Reference<class Matrix4x4> __thiscall
Matrix4x4::eek:perator*(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?
Might be the templates that I used, was my first time.
 
A

Alf P. Steinbach

* (e-mail address removed):
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::eek:perator*(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>::eek:perator->(void)const " (??C?
$Reference@VMatrix4x4@@@@QBEPBVMatrix4x4@@XZ) referenced in function
"public: class Reference<class Matrix4x4> __thiscall
Matrix4x4::eek:perator*(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
 
M

michael.goossens

* (e-mail address removed):






They mean you lack compiled definitions of those functions.


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

Ian Collins

*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.
 

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,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top