Hello,
trying to build AttributeSequenceWriter, I got some error messages and I wonder if someone could help me understanding how to build it.

First, I built yat and yat4tango like written in this topic.

Then I built AttributeSequenceWriter following these steps:


svn checkout http://svn.code.sf.net/p/tango-ds/code/DeviceClasses/SoftwareSystem/AttributeSequenceWriter/ AttributeSequenceWriter
cd AttributeSequenceWriter/trunk/src


Makefile seems to need some modifications so I made several ones:
- defining "linux" variable
- I wonder if defining _PS_AVAILABLE_ is mandatory, so I added it
- I added yat and yat4tango libraries
- I did not removed CPP_SERVERS but this path does not exists.


— "/home/debian9/T\303\251l\303\251chargements/AttributeSequenceWriter/trunk/src/Makefile" 2019-04-17 15:33:50.735706670 +0200
+++ "/home/debian9/T\303\251l\303\251chargements/AttributeSequenceWriter2/Makefile" 2019-04-17 16:36:31.033941011 +0200
@@ -28,6 +28,8 @@ MAJOR_VERS = 1
MINOR_VERS = 0
RELEASE = Release_$(MAJOR_VERS)_$(MINOR_VERS)

+linux = 1
+
#—————————————–
# Set default home directories
#—————————————–
@@ -66,7 +68,8 @@ INCLUDE_DIRS = -I$(TANGO_HOME)/include/

OBJS_DIR = obj
LIB_DIRS = -L $(TANGO_HOME)/lib \
- -L /usr/lib
+ -L /usr/lib \
+ -L /usr/lib/x86_64-linux-gnu

TARGET_LIB = $(CPP_SERVERS)/lib/libtgclasses.a

@@ -88,7 +91,7 @@ LFLAGS = $(DEBUG) $(LIB_DIRS) \
endif

ifdef linux
-CXXFLAGS = $(DEBUG) -D_REENTRANT $(INCLUDE_DIRS)
+CXXFLAGS = $(DEBUG) -D_REENTRANT -D_PS_AVAILABLE_ $(INCLUDE_DIRS)
LFLAGS = $(DEBUG) $(LIB_DIRS) \
-ltango \
-llog4tango \
@@ -96,7 +99,8 @@ LFLAGS = $(DEBUG) $(LIB_DIRS) \
-lomniDynamic4 \
-lomnithread \
-lCOS4 \
- -ldl -lpthread
+ -ldl -lpthread \
+ -lyat -lyat4tango
endif


Then I run "make" and here is the output:


++ -g -D_REENTRANT -I/usr/include/tango -I/usr/include -I. -I/usr/cppserver/include -c main.cpp -o obj/main.o
c++ -g -D_REENTRANT -I/usr/include/tango -I/usr/include -I. -I/usr/cppserver/include -c ClassFactory.cpp -o obj/ClassFactory.o
c++ -g -D_REENTRANT -I/usr/include/tango -I/usr/include -I. -I/usr/cppserver/include -c AttributeSequenceWriterClass.cpp -o obj/AttributeSequenceWriterClass.o
c++ -g -D_REENTRANT -I/usr/include/tango -I/usr/include -I. -I/usr/cppserver/include -c AttributeSequenceWriterStateMachine.cpp -o obj/AttributeSequenceWriterStateMachine.o
c++ -g -D_REENTRANT -I/usr/include/tango -I/usr/include -I. -I/usr/cppserver/include -c AttributeSequenceWriter.cpp -o obj/AttributeSequenceWriter.o
c++ obj/main.o obj/ClassFactory.o obj/AttributeSequenceWriterClass.o obj/AttributeSequenceWriterStateMachine.o obj/AttributeSequenceWriter.o -o AttributeSequenceWriter -g -L /usr/lib -L /usr/lib -ltango -llog4tango -lomniORB4 -lomniDynamic4 -lomnithread -lCOS4 -ldl -lpthread -lyat -lyat4tango
obj/AttributeSequenceWriter.o: In function `AttributeSequenceWriter_ns::AttributeSequenceWriter::init_device()':
/home/debian9/Téléchargements/AttributeSequenceWriter2/AttributeSequenceWriter.cpp:274: undefined reference to `AttributeSequenceWriter_ns::AttributeSequenceWriterTask::AttributeSequenceWriterTask(AttributeSequenceWriter_ns::AttributeSequenceWriterTask::Config const&)'
obj/AttributeSequenceWriter.o: In function `AttributeSequenceWriter_ns::AttributeSequenceWriter::read_attr_hardware(std::vector<long, std::allocator<long> >&)':
/home/debian9/Téléchargements/AttributeSequenceWriter2/AttributeSequenceWriter.cpp:497: undefined reference to `AttributeSequenceWriter_ns::AttributeSequenceWriterTask::get_data_return_values(AttributeSequenceWriter_ns::AttributeSequenceWriterTask::DataReturnValues&)'
obj/AttributeSequenceWriter.o: In function `AttributeSequenceWriter_ns::AttributeSequenceWriter::start()':
/home/debian9/Téléchargements/AttributeSequenceWriter2/AttributeSequenceWriter.cpp:671: undefined reference to `AttributeSequenceWriter_ns::AttributeSequenceWriterTask::start(unsigned long)'
obj/AttributeSequenceWriter.o: In function `AttributeSequenceWriter_ns::AttributeSequenceWriter::stop()':
/home/debian9/Téléchargements/AttributeSequenceWriter2/AttributeSequenceWriter.cpp:707: undefined reference to `AttributeSequenceWriter_ns::AttributeSequenceWriterTask::stop(unsigned long)'
obj/AttributeSequenceWriter.o: In function `AttributeSequenceWriter_ns::AttributeSequenceWriter::pause()':
/home/debian9/Téléchargements/AttributeSequenceWriter2/AttributeSequenceWriter.cpp:744: undefined reference to `AttributeSequenceWriter_ns::AttributeSequenceWriterTask::pause(unsigned long)'
obj/AttributeSequenceWriter.o: In function `AttributeSequenceWriter_ns::AttributeSequenceWriter::resume()':
/home/debian9/Téléchargements/AttributeSequenceWriter2/AttributeSequenceWriter.cpp:781: undefined reference to `AttributeSequenceWriter_ns::AttributeSequenceWriterTask::resume(unsigned long)'
obj/AttributeSequenceWriter.o: In function `AttributeSequenceWriter_ns::AttributeSequenceWriter::load_sequence_values(Tango::DevVarDoubleArray const*)':
/home/debian9/Téléchargements/AttributeSequenceWriter2/AttributeSequenceWriter.cpp:836: undefined reference to `AttributeSequenceWriter_ns::AttributeSequenceWriterTask::seq_values_changed(yat::Buffer<double> const&)'
obj/AttributeSequenceWriter.o: In function `AttributeSequenceWriter_ns::AttributeSequenceWriter::load_waiting_times(Tango::DevVarDoubleArray const*)':
/home/debian9/Téléchargements/AttributeSequenceWriter2/AttributeSequenceWriter.cpp:890: undefined reference to `AttributeSequenceWriter_ns::AttributeSequenceWriterTask::waiting_times_changed(yat::Buffer<double> const&)'
obj/AttributeSequenceWriter.o: In function `AttributeSequenceWriter_ns::AttributeSequenceWriter::dev_state()':
/home/debian9/Téléchargements/AttributeSequenceWriter2/AttributeSequenceWriter.cpp:971: undefined reference to `AttributeSequenceWriter_ns::AttributeSequenceWriterTask::get_sequence_state()'
obj/AttributeSequenceWriter.o: In function `AttributeSequenceWriter_ns::AttributeSequenceWriter::dev_status()':
/home/debian9/Téléchargements/AttributeSequenceWriter2/AttributeSequenceWriter.cpp:995: undefined reference to `AttributeSequenceWriter_ns::AttributeSequenceWriterTask::get_sequence_status[abi:cxx11]()'
collect2: error: ld returned 1 exit status
Makefile:140: recipe for target 'AttributeSequenceWriter' failed
make: *** [AttributeSequenceWriter] Error 1


It seems to me Makefile lakes AttributeSequenceWriterTask.* into build prerequisites by patching it like following:

— "/home/debian9/T\303\251l\303\251chargements/AttributeSequenceWriter/trunk/src/Makefile"	2019-04-17 15:33:50.735706670 +0200
+++ "/home/debian9/T\303\251l\303\251chargements/AttributeSequenceWriter2/Makefile" 2019-04-17 20:43:49.684773255 +0200
@@ -28,6 +28,8 @@ MAJOR_VERS = 1
MINOR_VERS = 0
RELEASE = Release_$(MAJOR_VERS)_$(MINOR_VERS)

+linux = 1
+
#—————————————–
# Set default home directories
#—————————————–
@@ -96,7 +98,8 @@ LFLAGS = $(DEBUG) $(LIB_DIRS) \
-lomniDynamic4 \
-lomnithread \
-lCOS4 \
- -ldl -lpthread
+ -ldl -lpthread \
+ -lyat -lyat4tango
endif


@@ -108,6 +111,7 @@ endif

SVC_OBJS = $(OBJS_DIR)/main.o \
$(OBJS_DIR)/ClassFactory.o \
+ $(OBJS_DIR)/$(CLASS)Task.o \
$(OBJS_DIR)/$(CLASS)Class.o \
$(OBJS_DIR)/$(CLASS)StateMachine.o \
$(OBJS_DIR)/$(CLASS).o



When adding "$(OBJS_DIR)/$(CLASS)Task.o \ " to SVC_OBJS into the Makefile, make succeeded.
(Perhaps the problem does not appear if one uses /usr/share/pogo/preferences/common_target.opt but this file is not included into the Makefile)

Did I miss something or should this Makefile be completed?

Regards.
- Philippe
Edited 5 years ago