Missing '*' in Expected a pointer type
Parsing headers for try001Editor 2> Running UnrealHeaderTool "F:\space-12\try001\try001.uproject" "F:\space-12\try001\Intermediate\Build\Win64\try001Editor\Development\try001Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed 2> F:/space-12/try001/Plugins/ImageLoader/Source/ImageLoader/Classes/ImageLoaderComponent.h(20) : Missing '*' in Expected a pointer type
在定义下述函数的时候产生了上述错误
UFUNCTION(BlueprintCallable, Category = "HongGuang|ImageLoaderComponent") static void LoadImage(FString filepath, UTexture2D& _image);
原因是蓝图不能定义引用类型
如果要返回这个对象,那么我们可以采用返回指针的方式
UFUNCTION(BlueprintCallable, Category = "HongGuang|ImageLoaderComponent") static UTexture2D* LoadImage(FString filepath);
编译通过
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步