473,594 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linker Errors - symbols pointing to templates not resolved

Hi,

I have a serious problem while compiling a small project (a part of
the Modular Flow Scheduling Middleware: ex1):

There are 3 linker errors, all from symbols that point to templates:

-- verbose build output --------------------------------------------

ex1.obj : error LNK2001: unresolved external symbol "public: virtual
void * __thiscall fsf::CCellFacto ry<class
myspace::CMyCel l>::Instantiate (void)"

ex1.obj : error LNK2019: unresolved external symbol
"__declspec(dll import) public: __thiscall fsf::CCellFacto ry<class
myspace::CMyCel l>::CCellFactor y<class myspace::CMyCel l>(class
std::basic_stri ng<char,struct std::char_trait s<char>,class
std::allocator< char> > const &,class std::basic_stri ng<char,struct
std::char_trait s<char>,class std::allocator< char> > const &)"

ex1.obj : error LNK2019: unresolved external symbol
"__declspec(dll import) public: virtual __thiscall
fsf::CCellFacto ry<class myspace::CMyCel l>::~CCellFacto ry<class
myspace::CMyCel l>(void)"
--------------------------------------------------------------------

I am quite sure that the code is working and I just have a wrong
configuration-setup. But all necessary libraries are included and
selected in the directories-setting.

I am using VisualStudio .NET pro 2003 running WinXPpro

Does anybody have an idea, what mistake I have made (especially
concerning the linking of template-declarations)?

Thank you in advance
Rebecca Hoffmann

--
mail: re************* *@tut.fi
Jul 23 '05 #1
1 2070
the problem i think has been described in the book:C++ templates
complete guides
one solution is so-called inclusion , it's declaration of the templates
and its implemention are in the same file,

or you can you use export keyword before the declaration.

simply say, it's involved with templates instantiation.

Rebecca Hoffmann wrote:
Hi,

I have a serious problem while compiling a small project (a part of
the Modular Flow Scheduling Middleware: ex1):

There are 3 linker errors, all from symbols that point to templates:

-- verbose build output --------------------------------------------

ex1.obj : error LNK2001: unresolved external symbol "public: virtual
void * __thiscall fsf::CCellFacto ry<class
myspace::CMyCel l>::Instantiate (void)"

ex1.obj : error LNK2019: unresolved external symbol
"__declspec(dll import) public: __thiscall fsf::CCellFacto ry<class
myspace::CMyCel l>::CCellFactor y<class myspace::CMyCel l>(class
std::basic_stri ng<char,struct std::char_trait s<char>,class
std::allocator< char> > const &,class std::basic_stri ng<char,struct
std::char_trait s<char>,class std::allocator< char> > const &)"

ex1.obj : error LNK2019: unresolved external symbol
"__declspec(dll import) public: virtual __thiscall
fsf::CCellFacto ry<class myspace::CMyCel l>::~CCellFacto ry<class
myspace::CMyCel l>(void)"
--------------------------------------------------------------------

I am quite sure that the code is working and I just have a wrong
configuration-setup. But all necessary libraries are included and
selected in the directories-setting.

I am using VisualStudio .NET pro 2003 running WinXPpro

Does anybody have an idea, what mistake I have made (especially
concerning the linking of template-declarations)?

Thank you in advance
Rebecca Hoffmann

--
mail: re************* *@tut.fi


Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1837
by: Generic Usenet Account | last post by:
I am "plugging in" a class type into an STL map definition and I am getting linker errors unless all my class definitions are defined in the header file, as opposed to a separate source file. This is happening on the following C++ compiler: gcc version 3.3.1 My question is whether this is standard behavior, or just a quirk of the compiler that I am using. Thanks
12
1954
by: Fabio De Francesco | last post by:
Hello. I can't understand why I can't compile the following simple code, where I think I have applied all the needed rules for templates that are declared and defined in different files (*.h and *.cpp). What amazes me is that I have already some code like this in another project where I don't get errors, so I am pretty sure I am missing some stupid thing.
3
1652
by: Grahamo | last post by:
Hi, I have a question that pertains to Templates and link time. This is totally for my own understanding and to correct what's obviously an erroneous view of things on my behalf; Lets say I have; // main.cpp
4
1814
by: Joel Whitehouse | last post by:
Hello All, I have a Visual C++ 2003 dll solution in a directory called "Antenna Test Range Control", and when I comile it, I get the error LNK1104: cannot open file "antenna.obj". When I remove teh spaces in my solution directory, I get the following errors: MastController.exp : error LNK2001: unresolved external symbol _Calibrate@8 MastController.exp : error LNK2001: unresolved external symbol _Initialize@8 MastController.exp :...
3
3281
by: ralphsieminsky | last post by:
A project compiles fine under VS 2005 RC without the /clr option. However, when /clr is turned on several errors appear: - A symbol exported from a DLL is not found by another DLL referencing it. The name of the symbol present in the DLL, as shown by depends.exe is ?Apply@ScreenContext@@SGPAV1@PAUHWND__@@@Z But the name of the symbol the linker looks for when
0
1747
by: VivekR | last post by:
I have a MFC application developed using VC++ 5. Recently I ported that to VC++ 7.1 and now I am trying to compile the MFC application with /CLR under VC++ 7.1. And I get linker errors referring to one of the libraries that the project uses. Without the /CLR, the project compiles and runs well. There is some library by name task.lib and the code refers to that lib, in the linker step i get the following linker errors:- Task.lib :...
5
2649
by: Mark | last post by:
Sorry for creating such a newbish topic, but I just can't seem to figure out what the problem is here. // main.cpp #include <cstdlib> #include <iostream> #include "Vector.h" using namespace std;
2
2774
by: Oneironaut | last post by:
Hello friends, I have an issue with a linker warning. It is the warning LNK4089. I am working in MSVC6.0 I investigated and this warning tells that the import of the library to which it makes reference is redundant, thus the linker ignores that library in order to make the code smaller. As it is expected, it only appears for release versions.
2
2415
by: Markus Dehmann | last post by:
What to do if an external library is header-files-only (but you have to use it), and you get lots of linker errors? You will necessarily get linker errors "multiple definition of ..." if you try to separate interface from implementation in your own code. The external-library symbols will first be defined in one .o file and then again in the next one that includes the same implementation-heavy header. Is there any way to avoid the...
0
7941
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7874
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8246
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8000
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8231
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5738
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5404
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3895
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1205
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.