-
Notifications
You must be signed in to change notification settings - Fork 92
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
Some compile errors and possible fixes #92
Comments
Hi @versaloon, Thanks for this information. I've been a bit busy on another project to response, but I hope to look into this further soon. Thank you! |
I can create a pull request for common compile problems, but I don't know how to add XSetWindowBorderPixmap and XSetWindowColormap. And I find some other BUGs, for example, in src/drivers/keymap_standard.h, o and p are both mapped to o. I can create a pull request for these BUGs I found when I port and use nanox. |
Hello @versaloon, Thank you for your bug reports and offer to provide fixes via PRs :) Yes, I would welcome that, but because of the potential differences (explained in more detail below), I suggest sending sequences of smaller PRs with possibly only one bug fix each. That will allow quick commit when possible, and discussion on other when needed without holding back the entire stream. For fixes pertaining to Nano-X/Microwindows internals, such as SCREEN_WIDTH ifdefs or (void *) additions, these are pretty straightforward - just send them in, thank you. For fixes related to X11 compatibility, this is a bit harder (such as the Xlib.h struct _XImage function prototype changes), as, for cross-compilation compatibility on hosts that don't have X11 installed, Nano-X has included its own version of X11 headers. These headers are likely pretty old by now and might want to be updated, but some discussion may be required as to which X11 version we ought to be supporting in Nano-X internally.
Sometimes what is needed is just a stub function so the link works, rather than a full implementation. See the file src/nx11/stub.c; perhaps you can add these functions there. It could be complicated to add a full implementationm, as Nano-X doesn't really support per-window color maps, nor fancy automatic window borders. Thank you! |
OK, I will prepare the PR after I test all the features I want in nanox in a CortexM7 platform. |
Environment: SCREEN_WIDTH/SCREEN_HEIGHT not defined
Error:
1>....\application\shell\sys\linux\applets\nanox\raw\src\drivers\scr_fb.c(96,42): error : use of undeclared identifier 'SCREEN_WIDTH'
1>....\application\shell\sys\linux\applets\nanox\raw\src\drivers\scr_fb.c(96,56): error : use of undeclared identifier 'SCREEN_HEIGHT'
Solution: add code like below like other screen drivers
#ifndef SCREEN_WIDTH
#define SCREEN_WIDTH 1024
#endif
#ifndef SCREEN_HEIGHT
#define SCREEN_HEIGHT 768
#endif
Compiler: IAR EWARM
Error:
Error[Pe167]: argument of type "void (*)(void *)" is incompatible with parameter of type "void " D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nanox\srvfunc.c 3600
Error[Pe167]: argument of type "void ()(void *)" is incompatible with parameter of type "void *" D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nanox\srvfunc.c 3609
Solution:
add type conversion, (void *)
Compiler: IAR EWARM
Error:
Error[Pe167]: argument of type "void *" is incompatible with parameter of type "sighandler_t" D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nanox\srvmain.c 979
Solution:
use type conversion, (sighandler_t) instead of (void *)
Compiler: Visual Studio - clang-cl
Error:
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Xrm.c(1611,16): error : call to undeclared function '_XOpenFile'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
Solution:
Add declaration: extern int _XOpenFile(_Xconst char *path, int flags);
Compiler: Visual Studio - clang-cl
Error:
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(137,22): error : incompatible function pointer types assigning to 'unsigned long (*)(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(138,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage , int, int, unsigned long)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(141,22): error : incompatible function pointer types assigning to 'unsigned long ()(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(142,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage , int, int, unsigned long)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(145,22): error : incompatible function pointer types assigning to 'unsigned long ()(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(146,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage , int, int, unsigned long)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(149,22): error : incompatible function pointer types assigning to 'unsigned long ()(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(150,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage *, int, int, unsigned long)') [-Wincompatible-function-pointer-types]
Solution:
fix prototype of get_pixel/put_pixel in _XImage
Compiler: Visual Studio - clang-cl
Error:
1>lld-link : error : undefined symbol: _XSetWindowBorderPixmap
1>>>> referenced by D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.c:16
1>>>> vsf_demo\Debug/__sub0/__sub1/__sub2/__sub3/....\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.obj:(_XChangeWindowAttributes)
1>
1>lld-link : error : undefined symbol: _XSetWindowColormap
1>>>> referenced by D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.c:30
1>>>> vsf_demo\Debug/__sub0/__sub1/__sub2/__sub3/....\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.obj:(_XChangeWindowAttributes)
Solution:
None, I can not find XSetWindowBorderPixmap and XSetWindowColormap implementation.
I simply remove related lines.
works well with fixes above
The text was updated successfully, but these errors were encountered: