- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的问题是:
fp = fopen(filename, "rb"); /* in ioformats_reg.c */
rewind(fp); /* in leptonlib.dll */
A reusable library and all of its users should use the same CRT library types and therefore the same compiler switch...
If you do choose to mix CRT libraries, remember that you have two separate copies of the CRT, with separate and distinct states, so you must be careful about what you try to do across a CRT-boundary. There are many ways to get into trouble with two CRTs. Here are just a few:
- There are two separate heaps. You cannot allocate (explicitly with new, malloc, or so on -- or implicitly with strdup, strstreambuf::str, or so on), and then pass the pointer across a CRT-boundary to be freed.
- You cannot pass a FILE* or file handle across a CRT-boundary and expect the "stdio low-level IO" to work.
- You cannot set the locale in one and expect the other's locale to be set.
Beginning with Visual C++ 4.0, the linker will issue a warning (LNK4098) if a resulting module attempts to combine more than one copy of the CRT library. For more information, search the Help file for LNK4098.
All modules passed to a given invocation of the linker must have been compiled with the same run-time library compiler option (/MD, /MT, /LD).
/Z7
Produces an .obj file containing full symbolic debugging information for use with the debugger. The symbolic debugging information includes the names and types of variables, as well as functions and line numbers. No .pdb file is produced.
For distributors of third-party libraries, there is an advantage to not having a .pdb file. However, the .obj files for the precompiled headers are necessary during the link phase, and debugging. If there is only type information (and no code) in the .pch object files, you will also have to compile with /Yl (Inject PCH Reference for Debug Library).
最佳答案
我缺少的一点是,当您使用 DLL 时,有 两个 链接器的调用,一次用于 DLL,一次用于与 DLL 链接的应用程序。当您使用静态库时,只有一次调用链接器(创建静态库使用 LIB)。
因此,DLL 链接到 C 运行时库,与链接到该 DLL 的任何应用程序分开。如果这两个 C 运行时不同,就会出现问题。
我可以使用 VS2010 调试器查看通过 Debug -> Windows -> Modules 窗口加载了哪些模块。当我与 Leptonica 静态库链接时,我看到了 msvcrt.dll 和 msvcr100d.dll。但是,当我与 Leptonica leptonlibd.dll 链接时,我可以看到 msvcrt.dll、msvcr90d.dll 和 msvcr100d.dll。
运行“dumpbin/imports leptonlibd.dll”也会显示对 msvcr90d.dll 的引用。
我想说这个问题有3个解决方案:
关于visual-studio-2008 - 使用 Visual Studio 2010,如何链接到 Visual Studio 2008 生成的 DLL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4171403/
我正在开发一个 voip 调用应用程序。我需要做的是在接到来电时将 Activity 带到前台。我在应用程序中使用 Twilio,并在收到推送消息时开始调用。 问题是我试图在接到任何电话时显示 Act
我是一名优秀的程序员,十分优秀!