dongtaidai0492 2013-03-13 10:12
浏览 108
已采纳

cgo和pkg-config

I want to run GraphicsMagick with cgo.

/*
#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;
}
*/

then I run 'go install', it says:

# 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

but I run 'pkg-config GraphicsMagick-config' in shell and it's ok.

  • 写回答

1条回答 默认 最新

  • douzhan1963 2013-03-13 14:03
    关注

    The GraphicsMagick-config script is a separate program rather than a pkg-config resource, which explains the problem.

    Also, running pkg-config with a non-option argument seems to fail without printing an error message, which might have confused you.

    In addition to this script though, the library does install a GraphicsMagick.pc data file for pkg-config. So you should be able to get your code running with:

    #cgo pkg-config: GraphicsMagick
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作