window7下gcc 读取netcdf文件出现问题了

OOo,TeX,KO,ABI,GIMP,Picasa,ProE,QCAD,Inkscape,Kicad,Eagle
回复
wnyh
帖子: 54
注册时间: 2011-11-24 9:00

window7下gcc 读取netcdf文件出现问题了

#1

帖子 wnyh » 2016-11-04 12:45

在window7下gcc ,需要用到读取netcdf文件,
我的makfile如下:
obj=calendary.o xj2.o recflen.o
j2:$(obj)
gcc -o $@ $(obj) -L\C:\netcdf4_4_1\lib -I\C:\netcdf4_4_1\include -l\C:\netcdf4_4_1\lib\netcdf.lib
%.o:%.c
gcc -c $<
clean:
del *.o

提示的错误是 mingw32/bin/ld.exe can not find the "-l\C:\netcdf4_4_1\lib\netcdf.lib"
系统确定已经安装了netcdf, 并且路径也是C:\netcdf4_4_1。在系统环境变量中也设置了C:\netcdf4_4_1\bin

是在不知道怎么解决这个问题,请牛人指点。
头像
astolia
论坛版主
帖子: 6454
注册时间: 2008-09-18 13:11

Re: window7下gcc 读取netcdf文件出现问题了

#2

帖子 astolia » 2016-11-16 14:41

你为什么要加个\
-L\C:\netcdf4_4_1\lib -I\C:\netcdf4_4_1\include -l\C:\netcdf4_4_1\lib\netcdf.lib
回复