Open GoogleCodeExporter opened 9 years ago
"__declspec(dllexport)" was added to avoid a warning when using the DLL, so you
can't just remove it.
Original comment by olafvdspek
on 1 Feb 2012 at 9:16
But it is posssible to use *.def export function name? Or add an other define
MACRO? Such as "CTEMPLATE_STATIC".
Original comment by W.Wilberforce.Jr@gmail.com
on 1 Feb 2012 at 11:05
Another macro might be ok if necessary.
Original comment by olafvdspek
on 1 Feb 2012 at 12:24
Ugh, sorry for that problem. Olaf is right that I added these to silence a
warning, probably based on advice in the MSDN. This dllimport/export stuff is
all a black art to me.
Olaf's the one in charge these days, so he gets to decide on the best fix!
Original comment by csilv...@gmail.com
on 1 Feb 2012 at 6:40
Just realized I've hit this issue too, didn't know it was due to ctemplate.
Original comment by olafvdspek
on 1 Feb 2012 at 6:49
I know two way to generate dll *.lib (c dll not c++ dll).
1th: Using lib.exe with *.def file to create *.lib.
2nd: Using __declspec(dllexport) auto create *.lib.
And I only know __declspec(dllexport) to export c++ class.
Original comment by W.Wilberforce.Jr@gmail.com
on 2 Feb 2012 at 3:07
Just wondering, who is actually using the DLL? Until Windows gets package
management, I prefer static linking.
Original comment by olafvdspek
on 2 Feb 2012 at 3:10
Static link cost much time for big library(such like boost,ACE,sqlite3,etc...).
I always using dll for debug, and static link for release.
I don't like dll because there still have chance two dll have same name:(
And many user I know always like one executive file. They don't like setup:)
Original comment by W.Wilberforce.Jr@gmail.com
on 2 Feb 2012 at 3:27
Maybe better to use *.manifest to find the right dll.
Original comment by W.Wilberforce.Jr@gmail.com
on 2 Feb 2012 at 3:29
The main issue isn't that there's no package management, it's that the
ctemplate library has an interface based on std::*.
Trying to export that from a dll in a way that works across versions of visual
studio and mingw is practically hopeless as you run into all sorts of problems
regarding allocation, internal data alignment etc.
The compiler is correct when it issues a warning as there's no guarantee that
the dll you're creating will be used by an executable that has the same idea of
what an std::map or std::string is, let alone how to destroy it!
The following link clearly illustrates the issue at hand...
http://lmgtfy.com/?q=std%3A%3Astring+dll+boundary
in short, providing a precompiled static library or dll is unrealistic unless
we
- prepare different versions for every
compiler/c-runtime/{release|debug}/thread-type permutation
or
- make the ctemplate public api [char *]-based
Original comment by rockdrea...@gmail.com
on 4 Jun 2012 at 5:15
My assumption was that package management would take care of these variants.
Not using std::string in the ABI might be an option.
The simple 'solution' might be to drop support for DLLs.
Original comment by olafvdspek
on 11 Jun 2012 at 2:51
Original issue reported on code.google.com by
W.Wilberforce.Jr@gmail.com
on 1 Feb 2012 at 3:57Attachments: