xlntd编译成静态库, 使用时候提示找不到符号

1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall xlnt::cell::to_string(void)const " (__imp_?to_string@cell@xlnt@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall xlnt::workbook::workbook(void)" (__imp_??0workbook@xlnt@@QAE@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall xlnt::workbook::~workbook(void)" (__imp_??1workbook@xlnt@@QAE@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xlnt::worksheet __thiscall xlnt::workbook::active_sheet(void)" (__imp_?active_sheet@workbook@xlnt@@QAE?AVworksheet@2@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall xlnt::workbook::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?load@workbook@xlnt@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xlnt::range __thiscall xlnt::worksheet::rows(bool)" (__imp_?rows@worksheet@xlnt@@QAE?AVrange@2@_N@Z) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xlnt::cell __thiscall xlnt::cell_iterator::operator*(void)" (__imp_??Dcell_iterator@xlnt@@QAE?AVcell@1@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall xlnt::cell_iterator::operator!=(class xlnt::cell_iterator const &)const " (__imp_??9cell_iterator@xlnt@@QBE_NABV01@@Z) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xlnt::cell_iterator & __thiscall xlnt::cell_iterator::operator++(void)" (__imp_??Ecell_iterator@xlnt@@QAEAAV01@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xlnt::cell_iterator __thiscall xlnt::cell_vector::begin(void)" (__imp_?begin@cell_vector@xlnt@@QAE?AVcell_iterator@2@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xlnt::cell_iterator __thiscall xlnt::cell_vector::end(void)" (__imp_?end@cell_vector@xlnt@@QAE?AVcell_iterator@2@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xlnt::cell_vector __thiscall xlnt::range_iterator::operator*(void)" (__imp_??Drange_iterator@xlnt@@QAE?AVcell_vector@1@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall xlnt::range_iterator::operator!=(class xlnt::range_iterator const &)const " (__imp_??9range_iterator@xlnt@@QBE_NABV01@@Z) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xlnt::range_iterator & __thiscall xlnt::range_iterator::operator++(void)" (__imp_??Erange_iterator@xlnt@@QAEAAV01@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall xlnt::range::~range(void)" (__imp_??1range@xlnt@@QAE@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xlnt::range_iterator __thiscall xlnt::range::begin(void)" (__imp_?begin@range@xlnt@@QAE?AVrange_iterator@2@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)
1>BarcodeGenerationTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xlnt::range_iterator __thiscall xlnt::range::end(void)" (__imp_?end@range@xlnt@@QAE?AVrange_iterator@2@XZ) referenced in function "void __cdecl testzint(void)" (?testzint@@YAXXZ)

解决方法在宏中添加

XLNT_STATIC=1

留下评论