【发布时间】:2013-04-27 16:41:20
【问题描述】:
我正在使用 Visual Studio 2012 x64 dll 编译 openexr2.0.0,我收到此错误:
ImfLut.obj : error LNK2001: unresolved external symbol "private: static union half::uif const * const half::_toFloat" (?_toFloat@half@@0QBTuif@1@B)
ImfRgbaYca.obj : error LNK2001: unresolved external symbol "private: static unsigned short const * const half::_eLut" (?_eLut@half@@0QBGB)
我使用 dumpbin /exports 在 half.lib 中查找:
在 half.dll 上使用 dumpbin /exports 进行另一个查找:
这两个符号在那里。有趣的是,当我从依赖项中删除 half.lib 时,VS 抱怨 convert 也没有解决。这表明它可以找到convert 而不是_toFloat 和_eLut。区别在于:_toFloat 和 _eLut 都是静态字段,convert 是静态方法。
class half
{
...
public:
union uif
{
unsigned int i;
float f;
};
private:
HALF_EXPORT static short convert (int i);
HALF_EXPORT static const uif _toFloat[1 << 16];
HALF_EXPORT static const unsigned short _eLut[1 << 9];
...
};
我的系统是 windows 8 x64。有谁知道如何解决这个问题?
【问题讨论】:
-
似乎
convert方法是在编译成half.dll的.cpp文件中实现的,而变量_toFloat和_eLut不是。 -
我更新了问题,在 half.dll 上使用了 dumpbin。符号在那里。我正在编译 ilmimf.dll。我认为编译库不需要 half.dll。
-
@Shen 这与我现在面临的错误完全相同。我正在尝试编译alembic 1.5.8,你最后是怎么解决的?
标签: dll visual-studio-2012 openexr