I am trying to compile the demo for the Acontis etherCAT master stack, but G++ is reporting a number of undefined references when trying to compile, without giving any clue as to which headers or libraries need be included to correct the problem. Since G++ is not reporting any referenced missing headers, how can I figure out which files are required to satisfy the undefined references?
If it matters, I can create the object files from source, the errors occur during linking. Acontis did not provide a makefile.
I have tried using g++ and hunting down the header locations (Format simplified to make it more readable and <Install_Location> inserted so that each argument fits on a single line):
g++ -I <Install_Location>/Examples/EcMasterDemo/ -I <Install_Location>/SDK/INC/ -I <Install_Location>/SDK/INC/Linux -I <Install_Location>/Examples/Common/Linux -I <Install_Location>/Examples/Common/ -I <Install_Location>/Sources/Common -o test EcDemoApp.cpp <Install_Location>/Examples/Common/Linux/EcDemoMain.cpp <Install_Location>/Sources/Common/EcTimer.cpp <Install_Location>/SDK/LIB/Linux/x64/libAtemRasSrv.a <Install_Location>/SDK/LIB/Linux/x64/libEcMaster.a -pthread
I am running Ubuntu 20.04 with 4.14.213-rt103 #1 SMP PREEMPT RT for Kernel. g++ is version 9.3.0
Update after fixing the -l arguments (thank you steeldriver)
/ClassB/Examples/EcMasterDemo$ gcc <Install_Dir>/ClassB/Examples/Common/Linux/EcDemoMain.cpp <Install_Dir>/ClassB/Examples/EcMasterDemo/EcDemoApp.cpp <Install_Dir>/ClassB/Sources/Common/EcTimer.cpp -o test -I <Install_Dir>/ClassB/Examples/EcMasterDemo -I <Install_Dir>/ClassB/SDK/INC/Linux -I <Install_Dir>/ClassB/SDK/INC -I <Install_Dir>/ClassB/Sources/Common -I <Install_Dir>/ClassB/Examples/Common -I <Install_Dir>/ClassB/Examples/Common/Linux -L <Install_Dir>/ClassB/SDK/LIB/Linux/x64 -lAtemRasSrv -lEcMaster -pthread -ldl -lrt
Which seemed to have fixed a few undefined references, but a lot still exist.