我編譯openexr2.0.0使用的Visual Studio 2012 x64的DLL解決靜態字段,我得到這個錯誤:的Visual Studio 2012不能在DLL中的lib
ImfLut.obj : error LNK2001: unresolved external symbol "private: static union half::uif const * const half::_toFloat" ([email protected]@@[email protected]@B)
ImfRgbaYca.obj : error LNK2001: unresolved external symbol "private: static unsigned short const * const half::_eLut" ([email protected]@@0QBGB)
我在半擡起頭來。 LIB使用DUMPBIN /出口:
另一個查找使用上half.dll DUMPBIN /出口:
兩個符號在那裏。有趣的是,當我從依賴中移除half.lib時,VS抱怨轉換也沒有解決。這表明它可以找到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'都沒有。 – 2013-05-03 09:59:16
我更新了問題,在half.dll上使用dumpbin。符號在那裏。我正在編譯ilmimf.dll。我不認爲它需要half.dll來編譯一個庫。 – 2013-05-03 10:31:10
@Shen這與我現在面對的錯誤完全相同。我試圖編譯alembic 1.5.8,最後你是如何解決它的? – Shuman 2015-08-24 07:51:06