Attempt to create a MySQL module

These are old archives. They are kept for historic purposes only.
Post Reply
chevyman2002
Posts: 62
Joined: Sun Nov 14, 2004 2:55 am
Location: Texas
Contact:

Attempt to create a MySQL module

Post by chevyman2002 »

I'm attempting to create a very basic MySQL module to connect to a database and update a value, nothing crazy. I'm having a hard time getting it compiled properly. It compiles with some warnings and then does the following when attempting to load.

Code: Select all

*** Notice -- unrealircd.conf:39: loadmodule src/modules/stats.so: failed to load: tmp/5B47F7D5.stats.so: undefined symbol: mysql_query
I have even copied an entire mysql/ folder with updated header files (including mysql.h) and placed #include <mysql/mysql.h> in the source file. Does anyone have any pointers for me? The only thing I can think of is to manually edit the Makefile(s) to add includes for the libraries and cflags.. The original code I used worked just fine as a standalone application, just doesn't want to work as an Unreal module.
Your face looks like it was set on fire and put out with an axe ;x.
chevyman2002
Posts: 62
Joined: Sun Nov 14, 2004 2:55 am
Location: Texas
Contact:

Re: Attempt to create a MySQL module

Post by chevyman2002 »

I forgot to mention that I have also tried to use #include </usr/include/mysql/mysql.h> to no avail. I have experimented with orion services and they use MySQL as a backend with no included header files (pulls from the /usr/... location) and it works just fine. I can't figure out what I'm doing wrong. I also added $(mysql_config --libs) and $(mysql_config --cflags), respectively, to the main Makefile and it didn't seem to help (has since been reverted to its original state). Ideas?
Your face looks like it was set on fire and put out with an axe ;x.
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Attempt to create a MySQL module

Post by Jobe »

You will also need to pass the correct linker flags to link with the MySQL client library as well. Which is where compiling an Unreal module which uses MySQL gets tricky.
Your IP: Image
Your Country: Image
chevyman2002
Posts: 62
Joined: Sun Nov 14, 2004 2:55 am
Location: Texas
Contact:

Re: Attempt to create a MySQL module

Post by chevyman2002 »

Ya sorry, it has been a hellacious week and I just haven't been into this as much with everything going on. The following is the proper method for compiling with mysql support (thanks binki).

Code: Select all

make custommodule MODULEFILE=my_mysql_mod EXLIBS="$(mysql_config --libs) $(mysql_config --cflags)"
Your face looks like it was set on fire and put out with an axe ;x.
Post Reply