2013-03-13 1 views
0

cgo로 GraphicsMagick을 실행하고 싶습니다.cgo 및 pkg-config

/* 
#cgo pkg-config: GraphicsMagick-config 

#include <magick/api.h> 

static int gm(int argc, char **argv) { 
    int status; 
    status = GMCommand(argc, argv); 
    return 1-status; 
} 
*/ 

는 내가 실행, 그것은 말한다 '설치 이동'

# pkg-config --cflags GraphicsMagick-config 
Package GraphicsMagick-config was not found in the pkg-config search path. 
Perhaps you should add the directory containing `GraphicsMagick-config.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'GraphicsMagick-config' found 
exit status 1 

을하지만 난 쉘에서 'PKG-설정 GraphicsMagick-설정'을 실행하고 괜찮아요.

답변

2

GraphicsMagick-config 스크립트는 문제를 설명하는 pkg-config 리소스가 아닌 별도의 프로그램입니다.

또한 옵션 인수가 아닌 pkg-config를 실행하면 혼동을 줄 수있는 오류 메시지를 인쇄하지 않고도 실패한 것으로 보입니다.

그러나이 스크립트 외에도 라이브러리는 pkg-config 용 GraphicsMagick.pc 데이터 파일을 설치합니다. 따라서 코드를 실행할 수 있어야합니다.

#cgo pkg-config: GraphicsMagick