|
-
Nov 12th, 2001, 03:36 PM
#1
Exporting classes from a DLL
This is probably something stupid, but I dont know.
I am trying to export a class from a DLL. Inside of the class is a custom templated queue class. When I compile, I get a warning saying:
Code:
c:\divinity\classes\cobject.h(94) : warning C4251: 'MsgQueue' : class 'Queue<struct DMSG>' needs to have dll-interface to be used by clients of class 'CObject'
I have tried adding __declspec(dllexport) to my Queue class, etc. Also, the application using it works just fine. I just want to get rid of the warning. Any ideas?
Z.
-
Nov 12th, 2001, 06:07 PM
#2
Monday Morning Lunatic
You can't export a template, but you can export a specialisation of it 
Basically...did you set your project options to use the runtime library as a DLL rather than a static library?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 12th, 2001, 10:00 PM
#3
I just left it as whatever the default is. Should I just convert my template to a regular class? It isnt used for anything else...
Z.
-
Nov 13th, 2001, 12:14 PM
#4
Monday Morning Lunatic
If you think about it logically, it's pointless exporting a template since it's only a template as far as the compiler is concerned - it's used for conditional code generation.
I made that mistake before
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 13th, 2001, 02:37 PM
#5
Alrighty, conversion time =).
Thanks much!
Z.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|