2012-08-21 9 views
5

Windows에서 NetCDF를 사용할 예정이며 내 주 프로그램과 다른 모든 라이브러리가 MinGW로 이미 컴파일되어 있으므로 MinGW로 컴파일해야한다고 생각합니다.libtool : 개체 이름 충돌 (NETCDF + MinGW)

하지만 MinGW (gcc 버전 4.6.2)를 사용했을 때. 몇 가지 오류 메시지가 나타납니다.

Making all in liblib 
    make[2]: Entering directory `/c/Users/ylylyl/Documents/CB/NETCDF/netcdf-4.2.1.1/liblib' 
    /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -DDLL_NETCDF -DDLL_EXPORT -g -O2 -MT libnetcdf_la-stub.lo -MD -MP -MF .deps/libnetcdf_la-stub.Tpo -c -o libnetcdf_la-stub.lo `test -f 'stub.c' ||echo './'`stub.c 
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../include -DDLL_NETCDF -DDLL_EXPORT -g -O2 -MT libnetcdf_la-stub.lo -MD -MP -MF .deps/libnetcdf_la-stub.Tpo -c stub.c -DDLL_EXPORT -DPIC -o .libs/libnetcdf_la-stub.o 
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../include -DDLL_NETCDF -DDLL_EXPORT -g -O2 -MT libnetcdf_la-stub.lo -MD -MP -MF .deps/libnetcdf_la-stub.Tpo -c stub.c -o libnetcdf_la-stub.o >/dev/null 2>&1 
    mv -f .deps/libnetcdf_la-stub.Tpo .deps/libnetcdf_la-stub.Plo 
    /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -version-info 9:0:2 -no-undefined -Wl,--output-def,netcdfdll.def -o libnetcdf.la -rpath /usr/local/lib libnetcdf_la-stub.lo ../libdispatch/libnetcdf2.la ../libdispatch/libdispatch.la ../libsrc/libnetcdf3.la -lm 
    libtool: link: gcc -shared .libs/libnetcdf_la-stub.o -Wl,--whole-archive ../libdispatch/.libs/libnetcdf2.a ../libdispatch/.libs/libdispatch.a ../libsrc/.libs/libnetcdf3.a -Wl,--no-whole-archive -O2 -Wl,--output-def -Wl,netcdfdll.def -o .libs/libnetcdf-7.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libnetcdf.dll.a 
    Creating library file: .libs/libnetcdf.dll.a 
    libtool: link: (cd .libs/libnetcdf.lax/libnetcdf2.a && ar x "/c/Users/ylylyl/Documents/CB/NETCDF/netcdf-4.2.1.1/liblib/../libdispatch/.libs/libnetcdf2.a") 
    libtool: link: object name conflicts in archive: .libs/libnetcdf.lax/libnetcdf2.a//c/Users/ylylyl/Documents/CB/NETCDF/netcdf-4.2.1.1/liblib/../libdispatch/.libs/libnetcdf2.a 
    make[2]: *** [libnetcdf.la] Error 1 
    make[2]: Leaving directory `/c/Users/ylylyl/Documents/CB/NETCDF/netcdf-4.2.1.1/liblib' 
    make[1]: *** [all-recursive] Error 1 
    make[1]: Leaving directory `/c/Users/ylylyl/Documents/CB/NETCDF/netcdf-4.2.1.1' 
    make: *** [all] Error 2 

libtool에서 어떤 문제인지 잘 모릅니다. 그러나 나는 ar 명령이 더 많은 입력이 필요하다고 생각한다. 그리고 아마도 libtool 스크립트를 생성 할 때 잘못된 것이 있습니다.

온라인으로 검색했지만 Fortran 및 f90 인터페이스가있는 MinGW 버전 NetCDF를 찾을 수 없습니다. 제발 도와주세요. 많은 감사합니다.

답변

13

문제는 "Windows '경로가 PATH의 msys'bin 앞에 나와 있기 때문에 Windows의 기본 유틸리티와 같은 이름을 가진 유닉스 유틸리티가 호출되지 않고 대신 Windows가 호출됩니다." (http://forum.world.st/The-old-quot-object-name-conflicts-in-archive-quot-problem-on-Windows-MSYS-MinGW-td3439428.html). PATH 시작 부분에 msys 바이너리 경로를 지정하면 도움이됩니다.

+0

감사합니다. 피드백을 보내려면 : 내 경우에는 Windows PATH에서 라이브러리의 경로를 잊어 버렸고 정상적인 cmd에서 msys sh를 실행하고있었습니다. 그런 다음 PATH를 제거하고 msys로 다시 이동하고 다시 작성하면 오류가 발생한 곳에서 계속 진행됩니다. :) 기본적으로 경로 녀석을 두 번 확인하십시오. – questioner

+0

오 플립 A.이 문제가 해결되었습니다. – NiteRain

+0

cygwin에서이 동일한 문제가 발생했습니다. PATH 항목을 재정렬하면 해결되었습니다. – aroth