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 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建