1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 <2019> 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 <2019> 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: MySQL statement in caMonitor code |
From: | Mark Rivers via Tech-talk <[email protected]> |
To: | 'Aaron Brown' <[email protected]> |
Cc: | tech-talk <[email protected]> |
Date: | Tue, 3 Dec 2019 18:13:42 +0000 |
Hi Aaron, My mistake, /usr/lib64/mysql is a directory, not a library, so those lines should be the following (I also added EPICS_BASE_HOST_LIBS). PROD_HOST += caMonitor caMonitor_SRCS += caMonitor.c USR_CFLAGS += -I/usr/include/mysql USR_LDFLAGS += -L/usr/lib64/mysql caMonitor_LIBS += $(EPICS_BASE_HOST_LIBS) caMonitor_SYS_LIBS += mysqlclient pthread z m dl ssl crypto Mark From: Aaron Brown <[email protected]>
Okay, I have changed my Makefile: TOP=.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE #============================= PROD_HOST += caExample caExample_SRCS += caExample.c caExample_LIBS += $(EPICS_BASE_HOST_LIBS) PROD_HOST += caMonitor caMonitor_SRCS += caMonitor.c USR_CFLAGS += -I/usr/include/mysql USR_LDFLAGS += -L/usr/lib64/ caMonitor_SYS_LIBS += mysql mysqlclient pthread z m dl ssl crypto include $(TOP)/configure/RULES #---------------------------------------- # ADD RULES AFTER THIS LINE I have attached a screenshot of the errors that I'm still getting. For some reason it's still saying that it cannot find the libraries. From: Mark Rivers <[email protected]> Hi Aaron, Change these lines: caMonitor_SYS_LIBS += -I/usr/include/mysql USR_LDFLAGS += -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto to this: USR_CFLAGS += -I/usr/include/mysql USR_LDFLAGS += -L/usr/lib64/ caMonitor_SYS_LIBS += mysql mysqlclient pthread z m dl ssl crypto The USR_LDFLAGS line is almost certainly not needed, because it will search that library by default. You can probably also remove pthread and m from caMonitor_SYS_LIBS because EPICS base uses those by default. Mark From: Aaron Brown <[email protected]>
So, here is what I have changed my Makefile to: TOP=.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE #============================= PROD_HOST += caExample caExample_SRCS += caExample.c caExample_LIBS += $(EPICS_BASE_HOST_LIBS) PROD_HOST += caMonitor caMonitor_SRCS += caMonitor.c caMonitor_SYS_LIBS += -I/usr/include/mysql USR_LDFLAGS += -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto include $(TOP)/configure/RULES #---------------------------------------- # ADD RULES AFTER THIS LINE Now the error I am getting is: "cannot find -l-I/usr/include/mysql" even though that is what running mysql_config --cflags returns. Did I do this correctly? From: Mark Rivers <[email protected]> Your Makefile should be changed to |