从 Windows XP 迁移到 Windows 7 时无法再生成 DLL
我有一些 C++ 代码,可以在 32 位 Windows XP 上生成 DLL。在 64 位 Windows 7 下移植该项目,我只得到目标文件,但没有 DLL,也没有错误消息。
除了 Windows 版本外,两个系统中使用的工具大致相同:
- WinXP 上为MinGW
- gcc 3.4.5,Win7
- CodeBlocks 10.05
上为 gcc 4.6.1 makefile 和 CodeBlocks 的配置文件是相同的。
我从 Windows XP 上的 gcc 收到的警告不相关。 这些是我从 Windows 7 上的 gcc 收到的警告,这些警告似乎也不相关:
S:\include\CThread.h|58|warning: attribute ignored in declaration of 'class DFS::Infrastructure::CThread'|
S:\include\CThread.h|58|warning: attribute for 'class DFS::Infrastructure::CThread' must follow the 'class' keyword|
S:\sw\WRXLL\CExcelSpreadsheet.cpp||In member function 'void CExcelSpreadSheet::SetCellFormat()':|
S:\sw\WRXLL\CExcelSpreadsheet.cpp|641|warning: deprecated conversion from string constant to 'CHAR*'|
S:\include\CThread.h|58|warning: attribute ignored in declaration of 'class DFS::Infrastructure::CThread'|
S:\include\CThread.h|58|warning: attribute for 'class DFS::Infrastructure::CThread' must follow the 'class' keyword|
S:\include\CThread.h|58|warning: attribute ignored in declaration of 'class DFS::Infrastructure::CThread'|
S:\include\CThread.h|58|warning: attribute for 'class DFS::Infrastructure::CThread' must follow the 'class' keyword|
S:\sw\WRXLL\FunctionImpl.cpp||In function 'void RetrieveAllRuns()':|
S:\sw\WRXLL\FunctionImpl.cpp|135|warning: unused variable 'BrakesHeaderFound'|
S:\include\CThread.h|58|warning: attribute ignored in declaration of 'class DFS::Infrastructure::CThread'|
S:\include\CThread.h|58|warning: attribute for 'class DFS::Infrastructure::CThread' must follow the 'class' keyword|
S:\sw\WRXLL\FunctionDef.h|137|warning: missing braces around initializer for 'char [256]'|
S:\sw\WRXLL\MenuDef.h|58|warning: missing braces around initializer for 'char [255]'|
S:\sw\WRXLL\MenuDef.h|91|warning: missing braces around initializer for 'char [255]'|
S:\include\CThread.h|58|warning: attribute ignored in declaration of 'class DFS::Infrastructure::CThread'|
S:\include\CThread.h|58|warning: attribute for 'class DFS::Infrastructure::CThread' must follow the 'class' keyword|
S:\sw\WRXLL\main.cpp||In function 'xloper* xlAddInManagerInfo(xloper*)':|
S:\sw\WRXLL\main.cpp|247|warning: deprecated conversion from string constant to 'char*'|
||=== Build finished: 0 errors, 16 warnings ===|
令我惊讶的是,我没有收到有关无法生成 DLL 的事实的任何错误(我确实查找过它)在整个硬盘上,以防它被放置在其他地方)。
就像根本没有调用链接器一样...
在 Windows7 上创建一个单独的虚拟项目我得到了 DLL。所以这不是工具的错。
谢谢您的任何提示!
I have some C++ code that, on 32 bit Windows XP, generates a DLL. Porting the project under 64 bit Windows 7, I only get the object files, but no DLL and no error messages.
Apart from the Windows version, the tools used in the two systems are roughly the same:
- MinGW
- gcc 3.4.5 on WinXP, gcc 4.6.1 on Win7
- CodeBlocks 10.05
The makefiles and CodeBlocks' config files are the same.
The warnings I get from gcc on Windows XP are not relevant.
These are the warnings I get from gcc on Windows 7, which do not seem to be relevant, either:
S:\include\CThread.h|58|warning: attribute ignored in declaration of 'class DFS::Infrastructure::CThread'|
S:\include\CThread.h|58|warning: attribute for 'class DFS::Infrastructure::CThread' must follow the 'class' keyword|
S:\sw\WRXLL\CExcelSpreadsheet.cpp||In member function 'void CExcelSpreadSheet::SetCellFormat()':|
S:\sw\WRXLL\CExcelSpreadsheet.cpp|641|warning: deprecated conversion from string constant to 'CHAR*'|
S:\include\CThread.h|58|warning: attribute ignored in declaration of 'class DFS::Infrastructure::CThread'|
S:\include\CThread.h|58|warning: attribute for 'class DFS::Infrastructure::CThread' must follow the 'class' keyword|
S:\include\CThread.h|58|warning: attribute ignored in declaration of 'class DFS::Infrastructure::CThread'|
S:\include\CThread.h|58|warning: attribute for 'class DFS::Infrastructure::CThread' must follow the 'class' keyword|
S:\sw\WRXLL\FunctionImpl.cpp||In function 'void RetrieveAllRuns()':|
S:\sw\WRXLL\FunctionImpl.cpp|135|warning: unused variable 'BrakesHeaderFound'|
S:\include\CThread.h|58|warning: attribute ignored in declaration of 'class DFS::Infrastructure::CThread'|
S:\include\CThread.h|58|warning: attribute for 'class DFS::Infrastructure::CThread' must follow the 'class' keyword|
S:\sw\WRXLL\FunctionDef.h|137|warning: missing braces around initializer for 'char [256]'|
S:\sw\WRXLL\MenuDef.h|58|warning: missing braces around initializer for 'char [255]'|
S:\sw\WRXLL\MenuDef.h|91|warning: missing braces around initializer for 'char [255]'|
S:\include\CThread.h|58|warning: attribute ignored in declaration of 'class DFS::Infrastructure::CThread'|
S:\include\CThread.h|58|warning: attribute for 'class DFS::Infrastructure::CThread' must follow the 'class' keyword|
S:\sw\WRXLL\main.cpp||In function 'xloper* xlAddInManagerInfo(xloper*)':|
S:\sw\WRXLL\main.cpp|247|warning: deprecated conversion from string constant to 'char*'|
||=== Build finished: 0 errors, 16 warnings ===|
What surprises me is that I am given no error at all about the fact that no DLL could have been generated (I did look for it on the whole hard disk, in case it was placed somewhere else).
It is like if the linker was not called at all...
Creating a separate, dummy project on Windows7 I got the DLL. So it is not the tools fault.
Thank you for any hint!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论