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

Problem with templates and Dll export

Hi there!

I've got the following problem and would be very happy if there is somebody
with a solution! =)

Btw. I'm using Microsoft Visual C++ 6.0 Std Edition

I've generated a template class called "CSingleton"

template <class T>
class __declspec(dllexport) CSingleton
{
static T *lpSingleton;

public:
CSingleton(void);
~CSingleton(void);

static T &GetSingleton(void);
static T *GetSingletonPtr(void);
};

Now I'm going to implement a texture manager (or whatever) like this

class DUSKENGINE_API CTextureManager: public CSingleton<CTextureManager>
{
public:
CTextureManager(void);
~CTextureManager(void);
};

When compiling this I get the following errors:

....
CTextureManager.obj : error LNK2001: "public: __thiscall
DuskEngine::Core::CSingleton<class
DuskEngine::Renderer::CTextureManager>::CSingleton <class
DuskEngine::Renderer::CTextureManager>(void)" (??0?$CSingleton@VCT
extureManager@Renderer@DuskEngine@@@Core@DuskEngin e@@QAE@XZ)
CTextureManager.obj : error LNK2001: "public: __thiscall
DuskEngine::Core::CSingleton<class
DuskEngine::Renderer::CTextureManager>::~CSingleto n<class
DuskEngine::Renderer::CTextureManager>(void)" (??1?$CSingleton@VC
TextureManager@Renderer@DuskEngine@@@Core@DuskEngi ne@@QAE@XZ)
....

How do I export home-brew-templates and classes that are using them in a
dll???

Thank you for your comments!
Marc André Ueberall
Jul 19 '05 #1
1 9225
Hi
I guess u are right exporting from a DLL is not defined...
But u can try using explicit template instantiation where the Object for the
class is created with some of the known types
i.e. the writer of the class should be aware of the type of instantiations
for that peculiar template class...

This instantiation can be exported from the DLL and then u could use this
class with no Linking errors...

Paramjeet Singh
"Victor Bazarov" <v.********@attAbi.com> wrote in message
news:vi************@corp.supernews.com...
"Marc André Ueberall" <mu*******@duskengine.de> wrote...
...

How do I export home-brew-templates and classes that are using them in a
dll???


Exporting from a DLL is not defined by the C++ language. Please
post your compiler-specific question to microsoft.public.vc.language.

Victor

Jul 19 '05 #2

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

Similar topics

2
by: Yaro | last post by:
Hi All (UDB 8.1 FP8, Win) In my simple test database, I have two tables CREATE TABLE "DB2ADMIN"."AAA" ( "F1" INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, "F2" VARCHAR(10), PRIMARY KEY...
1
by: Alessandro | last post by:
Hi ! I have a table on an aspx page and i want to export its rows into an Excel File, the script is Page.Response.Clear() Page.Response.ClearContent() Page.Response.ClearHeaders() ...
3
by: Daniel Wetzler | last post by:
Dear MSSQL- experts, I have a strange problem with SQLSERVER 2000. I tried to export a table of about 40000 lines into a text file using the Enterprise manager export assitant. I was astonished...
1
by: forumaic | last post by:
Hello, I am trying to export data to excel from datagrid, and I am getting an error: "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)." ...
0
by: CDonlan | last post by:
Here is how im exporting //Clear response content and headers response.Clear(); response.ClearContent(); response.ClearHeaders(); //Add header response.AddHeader("content-disposition",...
0
by: thaiwhere | last post by:
Hi all, pls help me about this problem. I have a code below: (I want to export data of grid to Excel) //************************************************** myDataGrid.DataSource =...
1
by: Ela | last post by:
Hallo, I have next problem: When I'm traying export data from table from one column formated like longint (21,111,111.00 ) form access 2003 to the xml, number looks diferent...
1
by: =?Utf-8?B?QU1lcmNlcg==?= | last post by:
With newly installed vs 2005, I made a VB project, and it builds cleanly. I run the export template wizard for a project template, and the 'import to vs' check box is checked. The wizard...
2
by: PrakashN | last post by:
I used excel to export data(Customer Name,Address). In form i used Multiline property 'Yes' for address. So it shows a small square box for each end of line in excel. how can avoid this square box..
0
by: ray | last post by:
Hi, I would like to ask if there is a line drawn in Crystal Report, is it possible to export to excel? I have tried that for Crystal Report 10, but all the line drawn disappear and only data left....
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
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...
0
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...
0
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...

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.