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

bgfx的编译问题 #4532

Open
yingnierxiao opened this issue Jul 1, 2024 · 3 comments
Open

bgfx的编译问题 #4532

yingnierxiao opened this issue Jul 1, 2024 · 3 comments
Labels

Comments

@yingnierxiao
Copy link

Xmake 版本

v2.9.3+HEAD.a5da06f37,

操作系统版本和架构

window 11

描述问题

bimg::imageParse(struct bx::AllocatorI *,void const *,unsigned int,enum bimg::TextureFormat::Enum,class bx::Error *) 无法连接问题,查了下cmakelist.txt
2024 07 01_郑捷 f17b4d583f0ff8b9e5e8e6643a5a2c08
2024 07 01_郑捷 3793dd019aa06efcedb767d026c9777c

期待的结果

希望能附加上decode库

工程配置

add_requires("bgfx")

bx::DefaultAllocator Texture::allocator;
void* data = nullptr;
uint32_t size = 0;

bx::FileReader reader;
bx::Error err;
if(bx::open(&reader, file, &err))
{
    size = (uint32_t)bx::getSize(&reader);
    data = bx::alloc(entry::getAllocator(),size);
    bx::read(&reader, data, size, &err);
    bx::close(&reader);
}

if(!err.isOk())
{
    bx::free(&allocator, data);
    throw std::runtime_error(err.getMessage().getPtr());
}

bimg::ImageContainer* image = bimg::imageParse(&allocator, (const void*)data, size,bimg::TextureFormat::Count,&err);

附加信息和错误日志

Texture.cpp.obj : error LNK2019: �޷��������ⲿ���� "struct bimg::ImageContainer * __cdecl bimg::imageParse(struct bx::AllocatorI *,void const *,unsigned int,enum bimg::TextureFormat::Enum,class bx::Error *)" (?imageParse@bimg@@YAPEAUImageContainer@1@PEAUAllocatorI@bx@@PEBXIW4Enum@TextureFormat@1@PEAVError@4@@z)������ "public: static struct bgfx::TextureHandle __cdecl Texture::loadTexture(char const *,enum bimg::TextureFormat::Enum,bool)" (?loadTexture@Texture@@sa?AUTextureHandle@bgfx@@PEBDW4Enum@TextureFormat@bimg@@_N@Z) �������˸÷���
build\windows\x64\debug\MyEngine.exe : fatal error LNK1120: 1 ���޷��������ⲿ����

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: bgfx compilation problem

@star-hengxing
Copy link
Contributor

可以来个 pr 改下

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I can do a PR to change it.

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

No branches or pull requests

3 participants