Author Topic: MAPI.Lib LNK1136 Invalid or corrupt file (VC++2010 Compiler)  (Read 10580 times)

Offline DMI-1407

  • Single posting newcomer
  • *
  • Posts: 4
MAPI.Lib LNK1136 Invalid or corrupt file (VC++2010 Compiler)
« on: March 24, 2013, 09:53:01 pm »
Hi Code::Blocks Community,

i'm a beginner in C++, i searched for a IDE and think that Code::Blocks is the best for me because i need more as one compiler.
I want to use GNU GCC Compiler, Borland C++ v5.5 and MS VC++ 2010 Compiler.

I've read the documentation and installed codeblocks-12.11mingw-setup.exe, Borland 5.5 Compiler, VC++2010 Express and MS SDK for Win7 (MS says is for XP too).
Downloaded it here: http://www.microsoft.com/en-us/download/details.aspx?id=3138
So i use WinXP in VMware Workstation, GNU GCC Compiler and Borland C++ v5.5 works great only VC++2010 not.

Code::Blocks has auto-detect the VC++2010 Compiler but the linker must i add manually, i tried the Libraries from this directory:
C:\Programme\Microsoft SDKs\Windows\v7.0A\Lib\
and from this directory:
C:\Programme\Microsoft SDKs\Windows\v7.0\Lib\
( v7.0A comes with VC++ Express and v7.0 comes with the SDK )
but the debugger says on every try the following:
C:\Programme\Microsoft SDKs\Windows\v7.0A\Lib\MAPI.Lib || fatal error LNK1136: Invalid or corrupt file.
I have test it with the HelloWorld code from the console app wth static crt.

I dunno what to do please help.  :(

Greets
DMI-1407
« Last Edit: March 24, 2013, 10:03:03 pm by DMI-1407 »

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: MAPI.Lib LNK1136 Invalid or corrupt file (VC++2010 Compiler)
« Reply #1 on: March 25, 2013, 02:02:50 am »
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Please post the Full Compiler "build log" in code tags.
The "Build Messages" is NOT the "build log".

Edit2: Before version 12.11, CB had a habit of adding too many search folders for MS VC++; I have no idea if the problem was fixed.
(I never used MS VC++ enough to care to report the problem.)

Tim S.
« Last Edit: March 25, 2013, 02:07:02 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: MAPI.Lib LNK1136 Invalid or corrupt file (VC++2010 Compiler)
« Reply #2 on: March 25, 2013, 06:20:04 am »
C:\Programme\Microsoft SDKs\Windows\v7.0A\Lib\MAPI.Lib || fatal error LNK1136: Invalid or corrupt file.

Error message is pretty clear MAPI.lib file is corrupt. A re-installation of Windows SDK may fix this problem.
Be a part of the solution, not a part of the problem.

Offline DMI-1407

  • Single posting newcomer
  • *
  • Posts: 4
Re: MAPI.Lib LNK1136 Invalid or corrupt file (VC++2010 Compiler)
« Reply #3 on: March 25, 2013, 03:40:24 pm »
I've copied the Full Compiler "build log" in a txt file because its longer as 20000 signs... (its not its only 19000 but SMF says that...).  :)

Quote from: Biplab
Error message is pretty clear MAPI.lib file is corrupt. A re-installation of Windows SDK may fix this problem.
I can read it self, befor i post my problem here, i has create a new VM with WinXP Pro x86, i installed all updates, framework 3,5 and 4 the VC++ Express and the SDK. After that i installed Code::Blocks and tried to compile the Halloworld code but the same error comes again.

I noticed that if i try to open a .cbp at the first time after i start Code::Blocks an error message comes which says that cl.exe can't find mspdb100.dll.
« Last Edit: March 25, 2013, 03:50:24 pm by DMI-1407 »

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: MAPI.Lib LNK1136 Invalid or corrupt file (VC++2010 Compiler)
« Reply #4 on: March 25, 2013, 04:14:33 pm »
Your cbp project file is NOT done the normal CB way.

You are doing full paths to the library; I think it is possible the command is too long and this might cause weird errors.
(Your link command is over 37 thousand characters long.)

I suggest doing it the normal CB way; add a linker search path to the lib folder.
Add, just the library name to the library list.

Did you confirm Microsoft Visual Studio 2010 express is compatible with Windows XP?
Remember to check the SP level on both items.

No idea if the item below is needed when using CB

From https://developer.mozilla.org/en-US/docs/Windows_SDK_versions#Windows_7_SDK
Under Troubleshooting
Quote
Run the Windows SDK Configuration Tool (if available) and make sure the right SDK is selected.

Tim S.
« Last Edit: March 25, 2013, 05:13:04 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline DMI-1407

  • Single posting newcomer
  • *
  • Posts: 4
Re: MAPI.Lib LNK1136 Invalid or corrupt file (VC++2010 Compiler)
« Reply #5 on: March 25, 2013, 05:23:46 pm »
Ah ok, i have insert all Libs on "Linker settings" -> "Link librarys" that was wrong.
I have removed them and add the path (C:\Programme\Microsoft SDKs\Windows\v7.0A\Lib) to "Search directories" -> "Linker", now it works thanks.  :D

But i don't understand why Code::Blocks gives me an error message when i open a .cbp at the first time after i have start Code::Blocks.
The error message says that cl.exe can't find mspdb100.dll.
 

[attachment deleted by admin]

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: MAPI.Lib LNK1136 Invalid or corrupt file (VC++2010 Compiler)
« Reply #6 on: March 25, 2013, 06:29:22 pm »
Find the folder that holds the correct mspdb100.dll.
Look under here first "C:\Programme\Microsoft SDKs\Windows\v7.0A"

Add this folder to "Toolchain Executable" Additional paths.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline DMI-1407

  • Single posting newcomer
  • *
  • Posts: 4
Re: MAPI.Lib LNK1136 Invalid or corrupt file (VC++2010 Compiler)
« Reply #7 on: March 25, 2013, 09:24:04 pm »
I've found it in "C:\Programme\Microsoft Visual Studio 10.0\Common7\IDE".
It works, thanks. ;D
« Last Edit: March 25, 2013, 09:25:56 pm by DMI-1407 »