举报

mingw版的easyx,loadimage使用宽字符串报错

0

我在用mingw的图像加载函数时候发现不能用宽字符串的地址,只能传入char*不能传入wchar_t*,尝试过用定义UNICODE但是没用,下面是代码和报错,我用的是vscode,而且保存源代码格式是UTF-8,

我感觉应该不会出这种问题啊,怎么会链接找不到符合条件的函数呢?是因为easyx不支持吗?我的minw版本是gcc version 12.2.0 (x86_64-win32-seh-rev2, Built by MinGW-W64 project),easyx是24年最新版本,按文档说的应该是支持才对。

IMAGE img_background;
wchar_t str[] = L"img/background.png";
loadimage(&img_background,str);


D:\Program Files\text_editor\Microsoft VS Code Simple Project\Cpp\yuanshenxingcunzhe/main.cpp:40: undefined reference to `loadimage(IMAGE*, wchar_t const*, int, int, bool)'
collect2.exe: error: ld returned 1 exit status

生成已完成,但出现错误。
ava
Then

2025-5-28

技术讨论社区