Opened 13 years ago
Last modified 13 years ago
#29059 closed defect
ld: symbol(s) not found error when compiling fortran code using netcdf +gcc45 and gcc45 macports install — at Initial Version
Reported by: | serra@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 1.9.2 |
Keywords: | Cc: | ||
Port: | netcdf |
Description
Hi,
I have installed gcc45 and netcdf +gcc45 on a mac running 10.5.8 and have tested the install on a simple fortran code which calls the netcdf library. When I compile this code I get the error:
[cassava:~] serra% gfortran -I/opt/local/include handle_err.f -o handle_err -L/opt/local/lib -lnetcdf Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
"_nf_strerror_", referenced from:
_handle_err_ in ccJcyNUi.o
ld: symbol(s) not found collect2: ld returned 1 exit status
I've had trouble before with macports netcdf libs not working with fortran and ended up creating my own Portfile. But that installation will not work any more. I think because I upgraded all my macports code and hdf5 is now hdf5-18. I did try to fix the problem by installing hdf5-18 +gcc45 and then reinstalling netcdf but this did not fix the problem.
I rely on the netcdf libraries every day in my work so desperately need to fix this issue!
Thanks.