473,320 Members | 1,876 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,320 software developers and data experts.

linking errors when using templates

Hi,

I get tollowing linking errors

Main.cpp:30 undefined reference to
Matrix<int>::Matrix[in-charge](int,int)

whats that '[in-charge]' and what might be the problem ??

line 30 of main: Matrix<int>::Matrix(array,int rows,int cols)

and the matching (supposed to be) constructor is
Matrix<T>::Matrix(const T *array,int rows,int cols)

even for the default constructor call I get the same linking error

I'am driven to edge of sanity... plz help
Thanks,
Jul 19 '05 #1
1 1743

"murali" <mu***********@yahoo.com> wrote in message
news:6a**************************@posting.google.c om...
Hi,

I get tollowing linking errors

Main.cpp:30 undefined reference to
Matrix<int>::Matrix[in-charge](int,int)

whats that '[in-charge]' and what might be the problem ??

line 30 of main: Matrix<int>::Matrix(array,int rows,int cols)

and the matching (supposed to be) constructor is
Matrix<T>::Matrix(const T *array,int rows,int cols)

even for the default constructor call I get the same linking error

I'am driven to edge of sanity... plz help
Thanks,


For the sake of your sanity, you should have tried

1) searching this newsgroup or
2) reading the FAQ.

This question gets asked several times a month. The answer is always the
same.

Put all the template code in the header file.

http://www.parashift.com/c++-faq-lit...html#faq-34.14

john
Jul 19 '05 #2

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

Similar topics

0
by: Joonas Paalasmaa | last post by:
Hi, When compiling Sketch's streamfilter C extension the errors below are raised during linking. What could cause the errors? (Python 2.3, MinGw 1.1 with GCC 2.95.3-6, Windows 98) Here are...
2
by: RU | last post by:
Hi, I am working on a porting project to port C/C++ application from unixware C++, AT&T Standard components to g++ with STL on Linux. This application has been working properly on...
1
by: Roland Raschke | last post by:
Hi, I'm a novice in using templates and want to write a static library with some communication classes. One of these classes uses two instances of a ringbuffer template as class members: ...
15
by: Rob Ratcliff | last post by:
I'm compiling the latest version of a CORBA ORB called MICO on a Cray X1. It makes heavy use of templates and namespaces. Up until the link step, the C++ source code compiled flawlessly. But, when...
15
by: Improving | last post by:
I have a template class that has static members, so in the .cpp file I have defined them with templated definitions. Now when in a different ..cpp file that includes the header file for the...
0
by: Philip Lowman | last post by:
I am in the process of trying to migrate a couple of build solutions to Visual Studio Express 2005 from VS 2003 Professional and I am running into a weird C/C++ runtime library linking issue when...
3
by: bav.272304 | last post by:
I have a code which uses external library with templates. The separate compiling of project files gets definition of the same symbols in different object files, so linking fails. Actually,...
2
by: pssraju | last post by:
Hi, At present application was built on solaris 9 using sun studio 9 (Sun C++ 5.6) & rouguewave sorce pro 5. We are planning to port the same application onto SuSE Linux 9.5.0 using GCC 3.3.3 & RW...
5
by: ciccio | last post by:
Hi, I have a problem with my code that the compiler does not find any inline functions which are static. The simple code example is written below, this is what the compiler throws at me. ]...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.