‘KALIGN_PACKAGE_NAME’ undeclared (first use in this function)
Closed this issue · 3 comments
grenaud commented
For kalign_v3.4.0 I am getting:
test.c:14:35: error: ‘KALIGN_PACKAGE_NAME’ undeclared (first use in this function)
14 | fprintf(stdout,"%s %s\n", KALIGN_PACKAGE_NAME, KALIGN_PACKAGE_VERSION);
TimoLassmann commented
Thanks for reporting. I cannot replicate this error on my machines. Can you provide more context?
grenaud commented
I downloaded kalign_v3.4.0 and ran:
mkdir build
cd build
/path/Software/cmake/cmake-3.28.3-linux-x86_64/bin/cmake .. #this is because my system cmake was too "old"
this worked then I did:
make
this stopped with:
[ 1%] Building C object lib/CMakeFiles/kalign_OBJ.dir/src/test.c.o
/home/software/kalign_v3.4.0/lib/src/test.c: In function ‘sub’:
/home/software/kalign_v3.4.0/lib/src/test.c:14:35: error: ‘KALIGN_PACKAGE_NAME’ undeclared (first use in this function)
14 | fprintf(stdout,"%s %s\n", KALIGN_PACKAGE_NAME, KALIGN_PACKAGE_VERSION);
| ^~~~~~~~~~~~~~~~~~~
/home/software/kalign_v3.4.0/lib/src/test.c:14:35: note: each undeclared identifier is reported only once for each function it appears in
/home/software/kalign_v3.4.0/lib/src/test.c:14:56: error: ‘KALIGN_PACKAGE_VERSION’ undeclared (first use in this function)
14 | fprintf(stdout,"%s %s\n", KALIGN_PACKAGE_NAME, KALIGN_PACKAGE_VERSION);
| ^~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [lib/CMakeFiles/kalign_OBJ.dir/build.make:76: lib/CMakeFiles/kalign_OBJ.dir/src/test.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:916: lib/CMakeFiles/kalign_OBJ.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
These are defined in build/lib/version.h but somehow this does not get past to the c compiler.
grenaud commented
I managed to compile by copy-pasting:
#include "version.h"
#define KALIGN_PACKAGE_NAME "kalign"
#define KALIGN_PACKAGE_VERSION "3.4.0"
into msa_io.c and test.c but that is not pretty :-)