473,473 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Container class. compiler error

when i try to initialize container i receive compiler error:
[Linker Error] Unresolved external 'TVecArray<int>::create()' referenced
from C:\- DEVELOP -\C++ BUILDER PROJECTS\IGRICE\IM_WIN\FORMMAIN.OBJ

TVecArray<int> test;

what did i do wrong ?
I'm using BCB5

code snipet:
template <class T> class TVecArray
{
public:
....
TVecArray () {create ();}
....
private:
iterator data;
iterator limit;
iterator avail;

std::allocator<T> alloc;

void create ();
....
};
template <class T> void TVecArray<T>::create ()
{
data = avail = limit = 0;
}
Jul 22 '05 #1
2 1185
ScOe wrote:
when i try to initialize container i receive compiler error:
[Linker Error] Unresolved external 'TVecArray<int>::create()' referenced
from C:\- DEVELOP -\C++ BUILDER PROJECTS\IGRICE\IM_WIN\FORMMAIN.OBJ

TVecArray<int> test;

what did i do wrong ?
I'm using BCB5

code snipet:
template <class T> class TVecArray
As a matter of style and for better readability,
use typename here instead of class.
{
public:
...
TVecArray () {create ();}
...
private:
iterator data;
iterator limit;
iterator avail;

std::allocator<T> alloc;

void create ();
...
};
template <class T> void TVecArray<T>::create ()
{
data = avail = limit = 0;
}


And are you having this implementation in a different file other
than the file where you defined the templates ? You can't have it that
way. The declaration and the definition ought to be in the same file.

--
Karthik.
' Remove _nospamplz from my email to mail me. '
Jul 22 '05 #2
>
And are you having this implementation in a different file other
than the file where you defined the templates ? You can't have it that
way. The declaration and the definition ought to be in the same file.
Well, that was exactly what i did.
Thanx for help ... now it's working fine. --
Karthik.
' Remove _nospamplz from my email to mail me. '

Jul 22 '05 #3

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

Similar topics

0
by: skscpp | last post by:
What's wrong with the following code? Compiler error is at the bottom. The compiler I am using is gcc version 2.95. ============================= // traits.h =============================...
2
by: Maitre Bart | last post by:
What I want to perform is calling a member function of container 1 (CRunner), using as argument the value of a container 2 (CNames). The purpose is to transfer values from C2 into C1 using a...
5
by: Active8 | last post by:
vector<double> signal; vector<double>::iterator iter; in_file.load_vector(signal); in_file.load_vector(signal.begin()); those calls give the compiler error: "could not deduce template...
19
by: Nafai | last post by:
Hi I want to write a function which erases al the repeated elements in a range. How should be the prototype? template <class Iterator> void eraseRepeated(Iterator begin, Iterator end); ...
11
by: PengYu.UT | last post by:
The following program calls the normal constructor and the copy constructor. By calling the copy constuctor is redundandant, all I want is only a vector of a trial object. Is there any way to...
10
by: padulg | last post by:
Hello at all, I have a problem: I have a class named "ball" with a method named "split". This is the declaration in ball.h: class ball : public procObject { public: ball();
7
by: toton | last post by:
Hi, I want a circular buffer or queue like container (queue with array implementation). Moreover I want random access over the elements. And addition at tail and remove from head need to be low...
10
by: Adrian | last post by:
Below is an example of the problem I am having. I don't understand how I can get the compiler to see deriv &operator=(const T &rhs). I am sure this is a common problem - any suggestions? ...
1
by: Troy Bull | last post by:
Greetings I am trying to use a singleton to hold a group of forms. I have a MDIMaster form. I have a class called Forms; Forms is a singleton. I want to do something like the following. In...
0
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,...
0
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...
0
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,...
1
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...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.