• Advertisement
Sign in to follow this  

Visual Studio 2005 C++

This topic is 3860 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, Just started using VSCpp to run some Cpp code my supervisor did in CodeWarrior and I'm have a rough time with it. Although it runs perfectly for him on CodeWarrior I seem to be getting a number of warnings and errors. Any idea how to deal with this one first off???? I admit that I have seen a previous post with this type of error but the methods suggested to alleviate the problem did not work.. Tony
1>CSP_DenseMatrix_demo.obj : error LNK2001: unresolved external symbol "public: void __thiscall csp::DenseMatrix<double,3>::Out(long)const " (?Out@?$DenseMatrix@N$02@csp@@QBEXJ@Z)
1>CSP_DenseMatrix_demo.obj : error LNK2001: unresolved external symbol "public: void __thiscall csp::DenseMatrix<double,3>::FillCol(unsigned int,double)" (?FillCol@?$DenseMatrix@N$02@csp@@QAEXIN@Z)
1>CSP_DenseMatrix_demo.obj : error LNK2001: unresolved external symbol "public: void __thiscall csp::DenseMatrix<double,3>::FillRow(unsigned int,double)" (?FillRow@?$DenseMatrix@N$02@csp@@QAEXIN@Z)
1>CSP_DenseMatrix_demo.obj : error LNK2001: unresolved external symbol "public: void __thiscall csp::DenseMatrix<double,3>::ZeroCol(unsigned int)" (?ZeroCol@?$DenseMatrix@N$02@csp@@QAEXI@Z)
1>CSP_DenseMatrix_demo.obj : error LNK2001: unresolved external symbol "public: class csp::DenseMatrix<double,3> __thiscall csp::DenseMatrix<double,3>::operator*(class csp::DenseMatrix<double,3> const &)const " (??D?$DenseMatrix@N$02@csp@@QBE?AV01@ABV01@@Z)
1>CSP_DenseMatrix_demo.obj : error LNK2001: unresolved external symbol "public: class csp::DenseMatrix<double,3> & __thiscall csp::DenseMatrix<double,3>::operator+=(class csp::DenseMatrix<double,3> const &)" (??Y?$DenseMatrix@N$02@csp@@QAEAAV01@ABV01@@Z)
1>CSP_DenseMatrix_demo.obj : error LNK2001: unresolved external symbol "public: class csp::DenseMatrix<double,3> & __thiscall csp::DenseMatrix<double,3>::operator=(class csp::DenseMatrix<double,3> const &)" (??4?$DenseMatrix@N$02@csp@@QAEAAV01@ABV01@@Z)
1>CSP_DenseMatrix_demo.obj : error LNK2001: unresolved external symbol "public: __thiscall csp::DenseMatrix<double,3>::~DenseMatrix<double,3>(void)" (??1?$DenseMatrix@N$02@csp@@QAE@XZ)
1>CSP_DenseMatrix_demo.obj : error LNK2001: unresolved external symbol "public: __thiscall csp::DenseMatrix<double,3>::DenseMatrix<double,3>(unsigned int,unsigned int,double)" (??0?$DenseMatrix@N$02@csp@@QAE@IIN@Z)
1>LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main

Share this post


Link to post
Share on other sites
Advertisement
There are two problems suggested by the errors you posted:
1. CSP_DenseMatrix_demo.cpp (or .cxx, or whatever) is using a class called DenseMatrix, but you are not telling the linker where to find this class. Either you haven't included the source code of that class to your project, or the class is in a library you are not linking in. In the first case, simply add the files to your project. In the latter case, go to Project->Properties->Configuration properties->Linker->Input and add the library at Additional Dependencies.

2. The compiler can't find the program's main entry point, main. Probably, the program you are compiling is a GUI-program, but your project seems to be a console application. If the code you have indeed contains a WinMain-entry point, change the project to be a Windows application in Project->Properties->Configuration properties->General->Configuration Type.

Share this post


Link to post
Share on other sites
On point #2 from DaBono, that can also be caused by a failure to link to a library. Some libraries, such as SDL, actually have their own main() function which will call yours. So, try linking to all libraries that this project requires first, then try making it a GUI project.

Share this post


Link to post
Share on other sites
Many thanks guys... I've included the File defining the class but the error message still persists...I'm going to play around with it a bit and see what happens..

Tony

Share this post


Link to post
Share on other sites
You also have to link to all the libraries. Ask your supervisor what libraries he links to in CodeWarrior, and then link to those, too. Then check DaBono's #2, make sure that it's the right subsystem.

Share this post


Link to post
Share on other sites
Ok I have another quick one.... Any ideas on these errors ?



Error	311	error C2556: 'void csp::Face<fT,dim>::Average(csp::MemoryManager<fT,1> &,const csp::Index &,csp::ScalarVariable<fT> &) const' : overloaded function differs only by return type from 'csp::csp_float csp::Face<fT,dim>::Average(csp::MemoryManager<fT,1> &,const csp::Index &,csp::ScalarVariable<fT> &) const'	c:\phd\csp\source_code\main_library\face.cpp	393
Error 312 error C2371: 'csp::Face<fT,dim>::Average' : redefinition; different basic types c:\phd\csp\source_code\main_library\face.cpp 393
Error 313 error C3190: 'csp::csp_float csp::Face<fT,dim>::Average(csp::MemoryManager<fT,1> &,const csp::Index &,csp::ScalarVariable<fT> &) const' with the provided template arguments is not the explicit instantiation of any member function of 'csp::Face<fT,dim>' c:\phd\csp\source_code\main_library\face.cpp 393

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement