473,382 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

unresolved externals

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 MatrixIterativeSolver<double,int>::~MatrixIterativ eSolver<double,int>(void)" (??1?$MatrixIterativeSolver@NH@@UAE@XZ) referenced in function _main

1>main.obj : error LNK2019: unresolved external symbol "public: virtual class Vector<double,int,class FullArray<double,class std::allocator<double> > > __thiscall MatrixIterativeSolver<double,int>::result(void)con st " (?result@?$MatrixIterativeSolver@NH@@UBE?AV?$Vecto r@NHV?$FullArray@NV?$allocator@N@std@@@@@@XZ) referenced in function _main

1>main.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall MatrixIterativeSolver<double,int>::solve(void)" (?solve@?$MatrixIterativeSolver@NH@@UAEXXZ) referenced in function _main

1>main.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall MatrixIterativeSolver<double,int>::setIterationTyp e(enum IterativeType)" (?setIterationType@?$MatrixIterativeSolver@NH@@UAE XW4IterativeType@@@Z) referenced in function _main

1>main.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall MatrixIterativeSolver<double,int>::setTolerance(do uble const &)" (?setTolerance@?$MatrixIterativeSolver@NH@@UAEXABN @Z) referenced in function _main

1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall MatrixIterativeSolver<double,int>::MatrixIterative Solver<double,int>(class NumericMatrix<double,int,class FullMatrix<double,class std::allocator<double> > > &,class Vector<double,int,class FullArray<double,class std::allocator<double> > > &)" (??0?$MatrixIterativeSolver@NH@@QAE@AAV?$NumericMa trix@NHV?$FullMatrix@NV?$allocator@N@std@@@@@@AAV? $Vector@NHV?$FullArray@NV?$allocator@N@std@@@@@@@Z ) referenced in function _main

1>C:\Users\EK\Documents\Visual Studio 2005\Projects\vec\Debug\vec.exe : 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 3138
weaknessforcats
9,208 Expert Mod 8TB
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
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 Expert Mod 8TB
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...#endif) 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
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,...
4
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...
0
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...
2
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...
4
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...
3
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...
0
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...
3
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...
2
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
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.