Error Reported When Packaging rpmbuild -ba ncl.spec
Symptom
If the following error information is displayed when packaging rpmbuild -ba ncl.spec:
/path/to/gdal/gdal-2.2.4/frmts/fits/fitsdataset.cpp:541: undefined reference to `ffinit' /usr/bin/ld: /path/to/gdal/gdal-2.2.4/frmts/fits/fitsdataset.cpp:564: undefined reference to `ffclos' /usr/bin/ld: /path/to/gdal/gdal-2.2.4/frmts/fits/fitsdataset.cpp:571: undefined reference to `ffcrim' /usr/bin/ld: /path/to/gdal/gdal-2.2.4/frmts/fits/fitsdataset.cpp:578: undefined reference to `ffclos' clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
Key Process and Cause Analysis
The compilation fails for multiple times.
Conclusion and Solution
- Go to the /root/rpmbuild/BUILD/ncl_ncarg-6.3.0/ni/src/ncl directory.
cd /root/rpmbuild/BUILD/ncl_ncarg-6.3.0/ni/src/ncl
- Run the following command:
make clean
- Go to the /root/rpmbuild/SPECS directory.
cd /root/rpmbuild/SPECS
- Package the file.
rpmbuild -ba ncl.spec
Parent topic: Troubleshooting