Compile Databaselayer as static library

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2292
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Compile Databaselayer as static library

Post by evstevemd » Fri Nov 02, 2012 12:13 pm

Hi,
I have been trying to make database layer link statically with MySQL and other libraries (PGS and SQLite3).
I have been testing using MySQL for now but each time I try to use it I get error of library not loading which mean its linking MySQL dynamically
I have tried passing -lmysqlclient to linker of databaselayer but with no avail. How to accomplish static databaselayer which is statically linked to MySQL, PGS, SQLite3 et al
error.png
error.png (41.27 KiB) Viewed 1843 times
Thanks
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2292
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Re: Compile Databaselayer as static library

Post by evstevemd » Fri Nov 02, 2012 3:51 pm

can someone tell me why it throws that error message when I did not link to any dynamic library?
I compiled Mysql myself. just did cmake . and make
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

ouch67
Earned some good credits
Earned some good credits
Posts: 134
Joined: Sun Mar 23, 2008 12:09 am

Re: Compile Databaselayer as static library

Post by ouch67 » Wed Nov 07, 2012 6:58 pm

Have you tried defining: DONT_USE_DYNAMIC_DATABASE_LAYER_LINKING

I have not used database layer in ages though, so take this with a grain of salt.

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2292
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Re: Compile Databaselayer as static library

Post by evstevemd » Fri Nov 16, 2012 6:59 pm

ouch67 wrote:Have you tried defining: DONT_USE_DYNAMIC_DATABASE_LAYER_LINKING

I have not used database layer in ages though, so take this with a grain of salt.
That makes it not compile. It seems that author allowed only for dynamic linking with external libs while allowing compiling the library itself as static/dynamic lib.
It needs to be re-written. I want to do that in near future as I announced in wxCode!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

Post Reply