473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

unresolved externals

71 New Member
I am getting the following type of error:

1>Compiling manifest to resources...
1>Linking...
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall MatrixIterative Solver<double,i nt>::~MatrixIte rativeSolver<do uble,int>(void) " (??1?$MatrixIte rativeSolver@NH @@UAE@XZ) referenced in function _main

1>main.obj : error LNK2019: unresolved external symbol "public: virtual class Vector<double,i nt,class FullArray<doubl e,class std::allocator< double> > > __thiscall MatrixIterative Solver<double,i nt>::result(voi d)const " (?result@?$Matr ixIterativeSolv er@NH@@UBE?AV?$ Vector@NHV?$Ful lArray@NV?$allo cator@N@std@@@@ @@XZ) referenced in function _main

1>main.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall MatrixIterative Solver<double,i nt>::solve(void )" (?solve@?$Matri xIterativeSolve r@NH@@UAEXXZ) referenced in function _main

1>main.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall MatrixIterative Solver<double,i nt>::setIterati onType(enum IterativeType)" (?setIterationT ype@?$MatrixIte rativeSolver@NH @@UAEXW4Iterati veType@@@Z) referenced in function _main

1>main.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall MatrixIterative Solver<double,i nt>::setToleran ce(double const &)" (?setTolerance@ ?$MatrixIterati veSolver@NH@@UA EXABN@Z) referenced in function _main

1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall MatrixIterative Solver<double,i nt>::MatrixIter ativeSolver<dou ble,int>(class NumericMatrix<d ouble,int,class FullMatrix<doub le,class std::allocator< double> > > &,class Vector<double,i nt,class FullArray<doubl e,class std::allocator< double> > > &)" (??0?$MatrixIte rativeSolver@NH @@QAE@AAV?$Nume ricMatrix@NHV?$ FullMatrix@NV?$ allocator@N@std @@@@@@AAV?$Vect or@NHV?$FullArr ay@NV?$allocato r@N@std@@@@@@@Z ) referenced in function _main

1>C:\Users\EK\D ocuments\Visual Studio 2005\Projects\v ec\Debug\vec.ex e : fatal error LNK1120: 6 unresolved externals

I have heard before that this unresolved external error can be caused by declaring a function and not defining it. This is not my case. However, one think that caught my attention is all the functions causing this error are virtual.
Aug 1 '07 #1
3 3156
weaknessforcats
9,208 Recognized Expert Moderator Expert
I have heard before that this unresolved external error can be caused by declaring a function and not defining it. This is not my case. However, one think that caught my attention is all the functions causing this error are virtual.
This is exactly your case. A LNK2019 error means your died in the link. That is, all of the files have compiled correctly. This means that you used function prototypes in your files but never compiled the functions for those prototypes.

This is odd since all of the errors are for missing template funcitons. And that can't happen unless you are misusing the templates.

Question: You have included the templates in every source file? (you should answer YES).
Question: You are not using function prototypes for template funcitons? (You should answer YES).

Be certain ALL templates are included at a global level in every source file in your program.
Aug 1 '07 #2
curious2007
71 New Member
Ok, apparently I have not included some of the hpp files. Now, the problem is solved. However, just to make this clear are you suggesting that I should include all of the hpp files in all of the cpp files in my project?
Aug 3 '07 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
Header files need onl;y be include if they contain declarations used by the .cpp file.

However, it is common to package up header files into an uber-header to avoid having to include lots of header files individually.

Be sure your header all have inclusion guards (#ifndef.. #define...#endi f) so they can be included multple times in the same .cpp without causing redefinition errors.

Be sure all templates are included at the global level.
Aug 3 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1679
by: Jim | last post by:
All, I'm trying to debug a Python GPF while running a script that we've written. After fixing up some of the paths for the Python build and successfully building Python from ActiveState source, I compiled the Python Extensions, but am getting the following error:
4
10071
by: Rodolphe | last post by:
Hello, I'm French so sorry for my approximate English. When I try to compile a project under Visual C++ 6.0, I've got the following errors : applicap.obj : error LNK2001: unresolved external symbol _IID_ISampleGrabber applicap.obj : error LNK2001: unresolved external symbol _CLSID_NullRenderer applicap.obj : error LNK2001: unresolved...
0
2774
by: Ida | last post by:
Hi, I am trying to build an dll with Microsoft Visual C++ but during the linking phase I get linking errors. Script.obj : error LNK2019: unresolved external symbol __imp__PyString_AsString referenced in function "public: static struct _object * __cdecl SomeFunctionName Script.obj : error LNK2019: unresolved external symbol...
2
1593
by: CoolDudeMan | last post by:
I'm currently working on a class "Course" and I'm getting an unresolved external error when trying to compile. I understand that unresolved externals are caused by declaration of methods that are not defined, but I think I defined all my methods so this one has got me stumped. Any help would be much appreciated. Thank you for your time, ...
4
2940
by: Kyle Sheldon | last post by:
I'm currently working on a class "Course" and I'm getting an unresolved external error when trying to compile. I understand that unresolved externals are caused by declaration of methods that are not defined, but I think I defined all my methods so this one has got me stumped. Any help would be much appreciated. Thank you for your time, ...
3
6064
by: We need more power captain | last post by:
Hi, I know less than a noob, I've been asked to do some compiles in VC++ 6 without knowing too much at all. (I'm a COBOL program normally so this is all too much for me) I open VC++6, open the workspace and then: Build>Batch Build
0
1412
by: Stephen Ahn | last post by:
Using : VS.NET 2003, I'm attempting to create a mixed-mode C++ DLL (i.e. has both managed and unmanaged code). When attempting to reference globals _timezone and _daylight, I get the following error at link time : LINK : error LNK2020: unresolved token (0A000023) _timezone LINK : error LNK2020: unresolved token (0A000024) _daylight LINK...
3
3517
by: Kevin Burton | last post by:
I am trying to use managed C++ but I am getting the following link errors: Metadata file 'D:\Projects\Visa\AddressVerification\AddressVerificat ionTest\bin\Debug\AddressVerificationInterface.dll' could not be found AddressVerificationInterface error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)"...
2
5308
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: 1>make_buildinfo.obj : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _make_buildinfo2 Ask on...
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.