EPICS Home

Experimental Physics and Industrial Control System


 
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  <20222023  2024  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  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: compilation error with redis
From: Pierrick M Hanlet via Tech-talk <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 17 May 2022 17:03:39 +0000
Hi all,
One of my colleagues had the idea of writing all of his DAQ output to redis++.  My job
then, is to simply use functions for reading/writing to redis.  He wrote a standalone
program that builds and functions as expected.

When I attempt to build with redis++, I run into compilation errors.

I'm using v7.0.5 on SL7 linux box x-86_64.  I created a new ioc as usual, and have
added nothing extra to it.  I simply have the c++ file:
#include <sw/redis++/redis++.h>

short test() {
  return(0);
}

epicsRegisterFunction(test);

In the Makefile, I simply add the line:
test_SRCS += test.cpp


The only other modification that I have is in ./base/configure/CONFIG_COMMON, I've added
the c++11 flag.

When I compile and it gets to my test.ccp file, I get:
/usr/bin/g++  -D_GNU_SOURCE -D_DEFAULT_SOURCE           -D_X86_64_  -DUNIX  -Dlinux      -O3   -Wall    -std=c++11  -mtune=generic      -m64  -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/usr/local/epics/base/include/compiler/gcc -I/usr/local/epics/base/include/os/Linux -I/usr/local/epics/base/include        -c ../test.cpp
<command-line>:0:6: error: expected identifier before numeric constant
<command-line>:0:6: error: expected ‘}’ before numeric constant
<command-line>:0:6: error: expected unqualified-id before numeric constant
In file included from /usr/local/include/sw/redis++/connection_pool.h:26:0,
                 from /usr/local/include/sw/redis++/redis.h:25,
                 from /usr/local/include/sw/redis++/redis++.h:20,
                 from ../test.cpp:14:
/usr/local/include/sw/redis++/connection.h:56:5: error: ‘ConnectionType’ does not name a type
     ConnectionType type = ConnectionType::TCP;
     ^
/usr/local/include/sw/redis++/connection.h:76:5: error: ‘tls’ does not name a type
     tls::TlsOptions tls;
     ^
/usr/local/include/sw/redis++/connection.h:157:5: error: ‘ReplyUPtr’ does not name a type
     ReplyUPtr recv(bool handle_error_reply = true);
     ^
/usr/local/include/sw/redis++/connection.h:200:5: error: ‘tls’ does not name a type
     tls::TlsContextUPtr _tls_ctx;
     ^
/usr/local/include/sw/redis++/connection.h: In member function ‘void sw::Connection::send(const char*, Args&& ...)’:
/usr/local/include/sw/redis++/connection.h:221:51: error: there are no arguments to ‘throw_error’ that depend on a template parameter, so a declaration of ‘throw_error’ must be available [-fpermissive]
         throw_error(*ctx, "Failed to send command");
                                                   ^
/usr/local/include/sw/redis++/connection.h:221:51: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/usr/local/include/sw/redis++/connection.h: At global scope:
/usr/local/include/sw/redis++/connection.h:235:1: error: expected declaration before ‘}’ token
 }
 ^
make[3]: *** [test.o] Error 1
make[3]: Leaving directory `/scratch/home/hanlet/epicsDEV/iocTops/testRedis/testApp/src/O.linux-x86_64'
make[2]: *** [install.linux-x86_64] Error 2
make[2]: Leaving directory `/scratch/home/hanlet/epicsDEV/iocTops/testRedis/testApp/src'
make[1]: *** [src.install] Error 2
make[1]: Leaving directory `/scratch/home/hanlet/epicsDEV/iocTops/testRedis/testApp'
make: *** [testApp.install] Error 2


I'm stumped.  Any help would be greatly appreciated.
Best wishes,
Pierrick

-- 
Pierrick Hanlet
Fermi National Accelerator
Accelerator Front End Controls
+1-630-840-5555 -- lab
+1-312-687-4980 -- mobile

"Whether you think you can or think you can't, you're right" -- Henry Ford

Navigate by Date:
Prev: Re: P4P monitor get pvname Matt Clarke via Tech-talk
Next: Octal escape sequence translation issue in base 7.0.6.1? Mark Rivers via Tech-talk
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  <20222023  2024 
Navigate by Thread:
Prev: Re: P4P monitor get pvname Matt Clarke via Tech-talk
Next: Octal escape sequence translation issue in base 7.0.6.1? Mark Rivers via Tech-talk
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  <20222023  2024