Hi folks, I am looking to extend on the Icecast engine with a couple of extra features and experiencing some issues. I decided that I should add a logging function that will help me debug the code at a later point by saving messages to a local MySQL database. I have successfully got this module working on my local machine (Centos 6 with Eclipse). I then copied the code over into the client.c module in the Icecast source files, and made sure all of the relevant includes were declared. When trying to compile Icecast with the additional logging functionality, using ./configure & make, I received the following errors: client.o: In function `logSingleMessage': /home/hearme/radio/src/client.c:283: undefined reference to `mysql_init' /home/hearme/radio/src/client.c:297: undefined reference to `mysql_real_connect' /home/hearme/radio/src/client.c:305: undefined reference to `mysql_query' /home/hearme/radio/src/client.c:307: undefined reference to `mysql_error' /home/hearme/radio/src/client.c:308: undefined reference to `mysql_close' /home/hearme/radio/src/client.c:293: undefined reference to `mysql_error' /home/hearme/radio/src/client.c:312: undefined reference to `mysql_close' It?s obviously a linking problem with MySQL, but how do I go about correcting this? Do I need to make any updates in the configure file? Kind Regards Glenn Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/icecast-dev/attachments/20151030/176a0ab8/attachment.htm
Philipp Schafft
2015-Oct-30 17:44 UTC
[Icecast-dev] Extending Icecast - Problem with Linker
Good evening, On Fri, 2015-10-30 at 16:43 +0000, Glenn Cooper wrote:> Hi folks, > > > I am looking to extend on the Icecast engine with a couple of extra > features and experiencing some issues. > > > I decided that I should add a logging function that will help me debug > the code at a later point by saving messages to a local MySQL > database. I have successfully got this module working on my local > machine (Centos 6 with Eclipse). I then copied the code over into the > client.c module in the Icecast source files, and made sure all of the > relevant includes were declared. When trying to compile Icecast with > the additional logging functionality, using ./configure & make, I > received the following errors: > > > client.o: In function `logSingleMessage': > /home/hearme/radio/src/client.c:283: undefined reference to `mysql_init' > /home/hearme/radio/src/client.c:297: undefined reference to `mysql_real_connect' > /home/hearme/radio/src/client.c:305: undefined reference to `mysql_query' > /home/hearme/radio/src/client.c:307: undefined reference to `mysql_error' > /home/hearme/radio/src/client.c:308: undefined reference to `mysql_close' > /home/hearme/radio/src/client.c:293: undefined reference to `mysql_error' > /home/hearme/radio/src/client.c:312: undefined reference to `mysql_close' > > It?s obviously a linking problem with MySQL,It is.> but how do I go about correcting this? Do I need to make any updates > in the configure file?I think you need to update configure.in. Do you patch against 2.4.x or trunk (2.5.x)? With 2.5.x you most likely want to provide an event handler. See e.g. src/event_log.c as example (it just logs the event so it's close to what you want I think). Also please feel free to send me your updates if you like to get some comments. :) Have a nice day! -- Philipp. (Rah of PH2) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 490 bytes Desc: This is a digitally signed message part Url : http://lists.xiph.org/pipermail/icecast-dev/attachments/20151030/0cd18fa8/attachment.pgp