[MacPorts] #29059: ld: symbol(s) not found error when compiling fortran code using netcdf +gcc45 and gcc45 macports install

MacPorts noreply at macports.org
Thu Apr 7 12:23:00 PDT 2011


#29059: ld: symbol(s) not found error when compiling fortran code using netcdf
+gcc45 and gcc45 macports install
------------------------------------+---------------------------------------
 Reporter:  serra@…                 |       Owner:  macports-tickets@…                   
     Type:  defect                  |      Status:  new                                  
 Priority:  High                    |   Milestone:                                       
Component:  ports                   |     Version:  1.9.2                                
 Keywords:  netcdf                  |        Port:  netcdf                               
------------------------------------+---------------------------------------
 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.

-- 
Ticket URL: <https://trac.macports.org/ticket/29059>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list