【发布时间】:2018-08-19 00:39:11
【问题描述】:
所以我一直在为我的树莓派做一个项目。但为了方便起见,我想使用 Visual Studio 2017 构建它。它是基于插件的,因此插件实现一个接口并导出一个函数,该函数将一个实例返回到实现类。我遇到的问题是编译器崩溃,只有在我尝试导出所述函数时才会发生这种情况。
extern "C" Plugin __declspec(dllexport) *CreatePlugin(Data *r);
这是插件必须实现的函数的声明,以返回其“插件”接口的实现。
MSVC 编译器给了我以下错误信息:
1> Bibliothek "build\Debug\Raspberry\libSMH.so" und Objekt "build\Debug\Raspberry\libSMH.exp" werden erstellt.
1>
1>LINK : fatal error LNK1000: Internal error during IMAGE::BuildImage
1>
1> Version 14.15.26726.0
1>
1> ExceptionCode = C0000005
1> ExceptionFlags = 00000000
1> ExceptionAddress = 0F20CC4E (0F200000) "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\HostX86\arm\VCRUNTIME140.dll"
1> NumberParameters = 00000002
1> ExceptionInformation[ 0] = 00000001
1> ExceptionInformation[ 1] = FEE90000
1>
1>CONTEXT:
1> Eax = 00FE5678 Esp = 006FEE34
1> Ebx = 00FE55F8 Ebp = 006FEE60
1> Ecx = 00000080 Esi = 00FE55F8
1> Edx = 00000080 Edi = FEE90000
1> Eip = 0F20CC4E EFlags = 00010247
1> SegCs = 00000023 SegDs = 0000002B
1> SegSs = 0000002B SegEs = 0000002B
1> SegFs = 00000053 SegGs = 0000002B
1> Dr0 = 00000000 Dr3 = 00000000
1> Dr1 = 00000000 Dr6 = 00000000
1> Dr2 = 00000000 Dr7 = 00000000
如果我从上面的函数声明中删除 __declspec(dllexport),则不会发生这种情况。
有没有人有交叉编译 ARM 共享库的经验,并且可能知道如何解决这个问题?
【问题讨论】:
标签: c++ visual-studio visual-c++ arm cross-compiling