标签: 编译报错 - 文章列表
共 1 页 · 清除标签筛选
-
Golang交叉编译后的程序在Linux上报错cannot execute binary file与no such file or directory的排查与解决方法(GOOS、GOARCH、CGO_ENABLED)
Go程序本地能跑,丢到Linux服务器或容器里却报cannot execute binary file: Exec format error,或者standard_init_linux.go:228: exec user process caused: no such file or directory。两个报错一个指向CPU架构,一个指向动态链接库。按uname、file、ldd三步定位,配合GOOS、GOARCH与CGO_ENABLED=0即可解决,附scratch与Alpine镜像的注意事项。
-
Visual Studio编译报错LNK2019无法解析的外部符号的排查与解决方法
VS编译通过却在链接阶段报LNK2019 unresolved external symbol,多半不是语法问题。从undname反解析修饰名入手,逐项排查cpp未加入工程、静态成员只声明没定义、lib未配置、extern "C"缺失、调用约定不一致、模板定义放在cpp、入口函数与子系统不匹配七类原因,并给出dumpbin与/VERBOSE两种定位手段。