标头有问题"WICTextureLoader.h"

Something is wrong with the header "WICTextureLoader.h"

本文关键字:WICTextureLoader 有问题      更新时间:2023-10-16

每次我包含头WICTextureLoader.hWICTextureLoader.cpp时,我都会得到编译器错误redefinition of default argument: parameter 1, note: see declaration of 'DirectX::CreateWICTextureFromFile。这个错误在WICTextureLoader.h中显示了4次,它告诉我函数CreateWICTextureFromMemoryCreateWICTextureFromFile都对它们的第一个参数进行了重新定义。

下面是我使用的函数。。

#include <DDSTextureLoader.h>   //I also used the functions in this header in my application 
#include <WICTextureLoader.h>
#include <WICTextureLoader.cpp>
CreateWICTextureFromFile(device, DevContext, L"grass.jpg", NULL, &Texture, 0);

我假设函数的第一个参数无效?或者函数没有加载.jpg文件?

我应该怎么做才能修复这个错误?

不要在程序的顶部包含.cpp文件。只应包含标头,并且只应包含一次。

相关文章:
  • 没有找到相关文章