I was using databaselayer statically no problem there. Though when I tried to change it to a dll i noticed that it didn't create a .lib file. After some investigation I realized that there is not a single export in any file. So that's why there was no lib file.
So how do I use this library dinamically? Because all my libraries are all linking dinamically to everything so I cant leave just this one library linked statically because they will end up using different Runtime libraries. Has anyone run into this problem before?
Thanks
DatabaseLayer as a DLL Topic is solved
DLL
I have the same issue.
I am using codeblocks with wxwidgets from wxpack.
Did you compile widgets yourself?
I have also noticed I can't create any new wxwidgets projects using the static build- if I do I get a bunch of undef refs at link.
databaselayer is the exact opposite- it can create the static lib but not the dll.
I am using codeblocks with wxwidgets from wxpack.
Did you compile widgets yourself?
I have also noticed I can't create any new wxwidgets projects using the static build- if I do I get a bunch of undef refs at link.
databaselayer is the exact opposite- it can create the static lib but not the dll.
jb_coder,
I only use odbc and postgre, so what I did was simply add WXEXPORT on all the classes contained in the headers of each of these projects. It's not much work, and since i didn't know exactly which one of these classes I use or will use I thought better to export all the classes. Worked as a charm if you want I can send you the headers of the odbc and postgres project.
See ya
I only use odbc and postgre, so what I did was simply add WXEXPORT on all the classes contained in the headers of each of these projects. It's not much work, and since i didn't know exactly which one of these classes I use or will use I thought better to export all the classes. Worked as a charm if you want I can send you the headers of the odbc and postgres project.
See ya
I wonder if it would work to only export the base classes
and the main DatabaseLayer classes of each derived backend
Code: Select all
DatabaseLayer
PreparedStatement
ResultSet
ResultSetMetaData
DatabaseLayerException
Code: Select all
SqliteDatabaseLayer
PostgresDatabaseLayer
OdbcDatabaseLayer
MysqlDatabaseLayer
FirebirdDatabaseLayer
there is one other detail, is not just add wxexport you need to define a macro for it to choose either to export or import
here is what I did:
just did a search and replace for "class"
Ow and just one more thing I've had problems compiling databaselayer because "libpq-fe.h" from postgre uses uint32 that is not defined anywhere, I just added the line "typedef unsigned int uint32" and it worked well.
I dont think this is the best thing thing to do for a library to be used in any case by anyone, so it needs to be ifdef'd to see if the machine uses 32bit integer.
I am no expert in building a generic library but if you have any permanent solution for this please tell me. I am still learning these portability issues.
edit: Adding some more info
I don't think anyone uses the string converter classes (at least I don't), it's more of an internal class, no need to export.
But i also use DatabaseErrorReporter. So I think I would add this class to the exported ones.
Thanks
here is what I did:
Code: Select all
#ifdef DLL_EXPORTS
#define EXPORT WXEXPORT
#else
#define EXPORT WXIMPORT
#endif
class EXPORT
Ow and just one more thing I've had problems compiling databaselayer because "libpq-fe.h" from postgre uses uint32 that is not defined anywhere, I just added the line "typedef unsigned int uint32" and it worked well.
I dont think this is the best thing thing to do for a library to be used in any case by anyone, so it needs to be ifdef'd to see if the machine uses 32bit integer.
I am no expert in building a generic library but if you have any permanent solution for this please tell me. I am still learning these portability issues.
edit: Adding some more info
I don't think anyone uses the string converter classes (at least I don't), it's more of an internal class, no need to export.
But i also use DatabaseErrorReporter. So I think I would add this class to the exported ones.
Thanks