#173 Link Error in Visual Studio 2005

Min H. Kim

Hi there,

I just downloaded the version 4.0.4 and compiled it and tried to use it with my project.
I just met the link error messages (four different kinds), for instance,

1>DlgAbout.obj : error LNK2005: "class itpp::Mat<class std::complex<double=""> > __cdecl itpp::outer_product<class std::complex<double=""> >(class itpp::Vec<class std::complex<double=""> > const &,class itpp::Vec<class std::complex<double=""> > const &,bool)" (??$outer_product@V?$complex@N@std@@@itpp@@YA?AV?$Mat@V?$complex@N@std@@@0@ABV?$Vec@V?$complex@N@std@@@0@0_N@Z) already defined in ChildFrm.obj

I realized that it occurs when I tried to use the IT++ class in more than two classes with MFC. I could trace it back to the definition of template of mat classes.

I was able to fix this bug as below:
from the version 4.0.4 files (of IT++ MKL)
in lines 1044 & 1069 & 1088 in "vec.h"
(before) template<class Num_T="">
(after) template<class Num_T=""> inline
* I made them inline function to solve link error
line 1509, 1541, ( NOT in 1510, 1542 -> that invoked another error with "misc_stat") in mat.h file,
(before) template<>
(after) template<> inline
line 1514, 1545, 1565, 1574 in mat.h file,
(before) template<class Num_T="">
(after) template<class Num_T=""> inline

I just tested with "itbase" and "itstat". Now they works quite well without the notorious "Template LINK Error" with Visual studio 2005.

Probably we need more thorough test for this modification. Please think about this modification for Windows users. Thanks. :o)



  • Min H. Kim

    Min H. Kim - 2008-06-07

    modified codes

  • Adam Piątyszek

    Adam Piątyszek - 2008-06-09

    Logged In: YES
    Originator: NO

    Hi Min,

    First of all, you broke our rule which states that all problems should be reported on the Help forum before opening a bug report. Bug reports are only for confirmed bugs.

    To proceed with this report I need you to check if you still observe the same type of linking problems with the latest SVN version of the stable branch. At least the first fix you propose is already in SVN. So please check out the "itpp-4-0" branch from SVN and test it again in your environment:
    svn co https://itpp.svn.sourceforge.net/svnroot/itpp/itpp/branches/itpp-4-0 itpp-svn

    BTW, please only attach the patches against the latest SVN commit. Not the whole modified files, because they are quite useless. To obtain a patch against an SVN revision, you can use "svn diff" command.


  • SourceForge Robot

    Logged In: YES
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 30 days (the time period specified by
    the administrator of this Tracker).


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks