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: | Aaron Brown via Tech-talk <[email protected]> |
To: | Mark Rivers <[email protected]> |
Cc: | tech-talk <[email protected]> |
Date: | Tue, 3 Dec 2019 16:50:41 +0000 |
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
From: Mark Rivers <[email protected]>
Sent: Tuesday, December 3, 2019 11:11 AM To: Aaron Brown <[email protected]> Cc: tech-talk <[email protected]> Subject: [EXTERNAL] RE: MySQL statement in caMonitor code 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 |
Attachment:
compileError.png
Description: compileError.png