-
-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go语言编译exe文件出错 #898
Comments
我没说过有 -p go这个平台 |
不好意思哈,写错了 |
你更新到 dev 分支再试试 xmake update dev |
编译可以啦,不过执行exe程序,不管是i386和x86_64都会报下面这个错误: 其他C和C++都是正常的 |
我这边试了下 (go1.14.6.windows-amd64.msi) 没啥问题么。。在msys下可以正常编译运行 ,另外我刚更新了下,msys平台也可以直接编译,不用切到mingw平台 |
我这边在mac下编译,还是不可用的..... |
那你早点说清楚环境哈,go目前我没搞交叉编译,你mac编译 当然生成的还是 mac程序,不管设置啥平台 |
这样子,不好意思哈 |
目前go的支持还比较弱,交叉编译以及第三方module的导入都还不支持,建议还是先用go自身的build吧。等后期我完善了,你可以再试试。 |
交叉编译我这个版本会加上支持,第三方库拉取和集成看之后的具体时间安排 |
交叉编译我支持上了,请更新到dev分支:xmake update dev 然后切到指定平台编译,但要注意的是,由于go默认没带其他平台的内置库,需要先根据提示build下对应平台的系统库后才行 (只需要根据提示构建一遍就行) $ xmake f -p mingw -a i386 -c
note: we need build go for windows_386 only once first! (pass -y or --confirm=y/n/d to skip confirm)?
please input: y (y/n)
building go for windows_386 .. ok
$ xmake
build ok |
好的,感谢!! |
关于go的第三方依赖包集成,我dev初步支持了,但还不是很完善,不支持指定版本,只能拉取master版本,并且级联依赖得自己手动展开。 具体到 #275 跟进。 后期等有时间我再完善下。 |
�使用如下命令创建一个工程
xmake create -l go -t console go
直接进行编译
xmake f -p go -c -a i386 -v
出现一下错误
error: ...mdir/core/sandbox/modules/import/core/base/scheduler.lua:47: cannot get program for gc
stack traceback:
[C]: in function 'error'
@programdir/core/base/os.lua:792: in function 'raise'
...mdir/core/sandbox/modules/import/core/base/scheduler.lua:47: in function 'co_start_named'
@programdir/modules/private/async/runjobs.lua:180: in function <@programdir/modules/private/async/runjobs.lua:139>
[C]: in function 'trycall'
@programdir/core/base/scheduler.lua:423: in function 'co_group_begin'
...mdir/core/sandbox/modules/import/core/base/scheduler.lua:85: in function 'co_group_begin'
@programdir/modules/private/async/runjobs.lua:139: in function 'runjobs'
@programdir/actions/build/build.lua:221: in function 'build'
@programdir/actions/build/main.lua:115: in function <@programdir/actions/build/main.lua:110>
[C]: in function 'trycall'
@programdir/core/sandbox/modules/try.lua:121: in function 'try'
@programdir/actions/build/main.lua:109: in function <@programdir/actions/build/main.lua:82>
[C]: in function 'load'
@programdir/core/base/task.lua:520: in function 'run'
@programdir/core/main.lua:282: in function 'cotask'
@programdir/core/base/scheduler.lua:317: in function <@programdir/core/base/scheduler.lua:315>
The text was updated successfully, but these errors were encountered: