doumixiang2227 2014-09-18 02:34
浏览 202

Golang使用主程序包代码和.a文件进行编译吗?

In my scenario I'll need to release my lib project without source code but a compiled form. Given,

  • Some library package in the form of compiled .a files,
  • a main package in form of source code,
  • all their platform types where they're built on match,

is it possible to compile the main and link it with .a files up into an executable? How to do it if doable?

  • 写回答

1条回答 默认 最新

  • doxzrb8721 2014-09-18 04:01
    关注

    Not unless the .a files were generated as a result of "installing" (go get or go install) a package. A ".a" library file is "customized" for the OS, machine architecture, go version etc. of the environment in which it will be used. Users of your library are not likely to meet all of the requirements. For that reason, and perhaps others, ".a" files without source code are not useful.

    评论

报告相同问题?

悬赏问题

  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择
  • ¥15 这款软件是什么?需要能满足我的需求
  • ¥15 SpringSecurityOauth2登陆前后request不一致