Trying to compile kstars from source (git://anongit.kde.org/kstars) but I always get the following error message: .... Linking CXX static library ../lib/libKStarsLib.a [ 98%] Built target KStarsLib [ 98%] Building CXX object kstars/CMakeFiles/kstars.dir/kstars.o Linking CXX executable kstars ../lib/libKStarsLib.a(fitsimage.o): In function `FITSImage::checkWCS()': /home/garamiad/DEV/kstars/kstars/fitsviewer/fitsimage.cpp:1043: undefined reference to `wcspih' /home/garamiad/DEV/kstars/kstars/fitsviewer/fitsimage.cpp:1063: undefined reference to `wcsset' /home/garamiad/DEV/kstars/kstars/fitsviewer/fitsimage.cpp:1082: undefined reference to `wcsp2s' ../lib/libKStarsLib.a(fitsimage.o): In function `fprintf': /usr/include/i386-linux-gnu/bits/stdio2.h:99: undefined reference to `wcs_errmsg' /usr/include/i386-linux-gnu/bits/stdio2.h:99: undefined reference to `wcshdr_errmsg' /usr/include/i386-linux-gnu/bits/stdio2.h:99: undefined reference to `wcs_errmsg' collect2: ld returned 1 exit status make[2]: *** [kstars/kstars] Error 1 make[1]: *** [kstars/CMakeFiles/kstars.dir/all] Error 2 make: *** [all] Error 2 garamiad@sirius:~/DEV/kstars/build$ WCSLIB 4.16 is installed on the system from source but previously I've tried to use the wcslib packages included with Ubunut 12.04 and I got the same error above. Please help! Reproducible: Always Steps to Reproduce: 1. cmake .. -DCMAKE_INSTALL_PREFIX=/usr 2. make Actual Results: See above. Using ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib.tar.bz2 on Xubuntu 12.04 (3.2.0-36-generic). WCSLIB is compiled with the following options: --prefix=/usr --with-cfitsioinc --with-cfitsiolib --with-pgplotinc --with-pgplotlib
Created attachment 77217 [details] Add link dependency for cmake library
I also had this problem. I could build it by adding (see attached diff) target_link_libraries(KStarsLib ${WCSLIB_LIBRARIES}) at line 481 of kstars/CMakeLists.txt Could you please confirm that the above fix works for you?
Dear Nicolas, your fix worked! I was able to compile kstars without errors! Thank you!
(In reply to comment #3) > Dear Nicolas, > > your fix worked! I was able to compile kstars without errors! Thank you! Please do not close the report before the patch is really accepted and committed .
(In reply to comment #4) > (In reply to comment #3) > > Dear Nicolas, > > > > your fix worked! I was able to compile kstars without errors! Thank you! > > Please do not close the report before the patch is really accepted and > committed . Ok, sorry for that!
Thanks for the report and the patch. The target for the library was incorrect. The committed patch is slightly different. This should fix this bug. http://commits.kde.org/kstars/e25b3eea670c6e1b2555c2b67459b6ede4b25d2c