Skip to content
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

linux下无法编译成功 #5

Open
shiyafei opened this issue Sep 9, 2020 · 7 comments
Open

linux下无法编译成功 #5

shiyafei opened this issue Sep 9, 2020 · 7 comments

Comments

@shiyafei
Copy link

shiyafei commented Sep 9, 2020

1、根据操作文档,在awtk执行,sons后,进入awtk-quickjs下执行scons,提示如下
`
3rd/quickjs/quickjs-libc.c: In function 'js_os_signal':
3rd/quickjs/quickjs-libc.c:1814:5: error: unknown type name 'sighandler_t'
sighandler_t handler;
^
3rd/quickjs/quickjs-libc.c:1831:21: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
handler = SIG_DFL;
^
3rd/quickjs/quickjs-libc.c:1833:21: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
handler = SIG_IGN;
^
3rd/quickjs/quickjs-libc.c:1834:25: warning: passing argument 2 of 'signal' makes pointer from integer without a cast [-Wint-conversion]
signal(sig_num, handler);
^
In file included from 3rd/quickjs/quickjs-libc.c:36:0:
/usr/include/signal.h:102:23: note: expected '__sighandler_t {aka void (*)(int)}' but argument is of type 'int'
extern __sighandler_t signal (int __sig, __sighandler_t __handler)
^
3rd/quickjs/quickjs-libc.c: In function 'js_os_exec':
3rd/quickjs/quickjs-libc.c:2688:19: error: 'environ' undeclared (first use in this function)
char **envp = environ;
^
3rd/quickjs/quickjs-libc.c:2688:19: note: each undeclared identifier is reported only once for each function it appears in
scons: *** [3rd/quickjs/quickjs-libc.o] Error 1
scons: building terminated because of errors.

2、通过手动执行quickjs仓库的make,编译后的文件直接copy到awtk-quickjs/lib下,执行scons,依然报错
scons: done reading SConscript files.
scons: Building targets ...
scons: *** [src/c/main.o] UnicodeDecodeError : 'ascii' codec can't decode byte 0xe5 in position 23: ordinal not in range(128)
scons: building terminated because of errors.

`

@xianjimli
Copy link
Member

具体是什么系统,什么版本?sighandler_t没有定义有点不正常。

@shiyafei
Copy link
Author

具体是什么系统,什么版本?sighandler_t没有定义有点不正常。

ubuntu16.04

@shiyafei
Copy link
Author

看C部分代码,是结合xml一起的,quick-js这个暂时不支持xml的吗,只能通过函数来绘制界面?

@xianjimli
Copy link
Member

支持XML。
AWTK依赖的库都安装了吗?

@shiyafei
Copy link
Author

支持XML。
AWTK依赖的库都安装了吗?

安装了

@xianjimli
Copy link
Member

xianjimli commented Sep 12, 2020

我知道了,原来要定义_GNU_SOURCE。你更新一下试试,谢谢。

@wildfire810
Copy link

我在luban的嵌入式linux编译,也有这个问题,定义_GNU_SOURCE宏,没解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants