开发者

C++ EXE made in VC++ 2008 runs on Windows 7 but not XP

I am working on reviving an old project (that only works with < 5.1) that essentially compiles PHP 5.3 into a PE C++ EXE. I have gotten everthing to work really well on multiple Windows 7 computers with only 2 dlls and 1 exe for most applications! Unfortunately, on XP I get:

the application failed to start because the application configuration is incorrect

I have installed Microsoft Visual C++ 2008 Redistributable Package to no avail. I have also copied msvcm90.dll, msvcr90.dll, msvcp90.dll to the same directory as the exe. This also did not work.

Do I just need to compile the project on XP for it to work on XP?

I am really good at PHP, but C is not my forte, so I assume I am missing something obvious in the compiler.

EDIT: When I compile with just Multi-threaded (/Mt) I get this:

MSVCRT.lib(MSVCR90.dll) : error LNK2005: _fflush already defined in 
LIBCMT.lib(fflush.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _free alre开发者_JS百科ady defined in LIBCMT.lib(free.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
out/console_debug.exe : fatal error LNK1169: one or more multiply defined symbols found


Try using Dependency Walker on XP to see if you can find any missing dependencies.

Also check the Event Viewer. And make sure you're building the application in Release mode.


Dependency Walker showing a dependency on DWMAPI.DLL is often an incorrect reporting, which can result from having a dependency on mshtml.dll on an XP box with IE7. Did you check the Event Viewer?

The build errors that you posted suggest that you're linking to libraries that are NOT built with /MT flag. Make sure you rebuild everything in your solution; your 2 DLLs, the .EXE and any static libraries with that same flag, assuming you own the DLLs as well.


Do you have the manifest files in your application directory? I'd recommend to make sure they are there and refer correctly to the DLL locations. Take a look at this reference:

http://msdn.microsoft.com/en-us/library/ms235342(VS.80).aspx


Have you tried Project/Properties/ Configuration Properties / C/C++ / Code Generation / Runtime Library -> Multi-threaded (/MT) ?


Try installing the VC2008 redistributables on the XP machine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜