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 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏