Home Dashboard Directory Help

VS2008 amd64 link error (LNK1103) when using /openmp and /GL flags by knutae


 as Fixed Help for as Fixed

Sign in
to vote
Type: Bug
ID: 608187
Opened: 10/1/2010 2:14:49 AM
Access Restriction: Public
User(s) can reproduce this bug


Note: I know this form is for Visual Studio 2010, but I didn't find a place to report Visual Studio 2008 compiler bugs. The bug ONLY applies to VS2008 (Visual C++ 9.0).

We got a LNK1103 error (debugging information corrupt; recompile module) after introducing OpenMP compilation in one of our projects. This only happens with Visual Studio 2008, 64-bit version, it works with all other combinations tested: 32-bit compilation works with VS2005, 2008 and 2010, and 64-bit compilation works with VS2005 and 2010.

I've reduced the problem as much as I could, will attach some C++ files and a script to compile and link them.
Sign in to post a comment.
Posted by Microsoft on 10/6/2010 at 3:19 PM
The fact that it works with 32-bit compilation on VS 2005/2008/2010 and with 64-bit compilation on VS 2005/2010 is just luck. For any version of VS products, it may work sometimes but fail other times.

We have identified the root cause and fixed it in our code base. The fix will be included in our next release. One work around to the attached repro case is to use /Zi (without specifying output PDB filename, or if you like, specify same output PDB filename) when doing compilation instead of /Z7. If you need a hotfix for VS2005, 2008 or 2010, please contact Microsoft PSS.

Thanks for the bug report.

YongKang Zhu
VC++ CodeGen and Tools
Posted by Microsoft on 10/3/2010 at 6:19 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by knutae on 10/4/2010 at 1:46 AM
Found a workaround, there is no link error if I change the code:

const int wanted_height = wh;
#pragma omp parallel
#pragma omp for schedule(static) nowait
        for (int y = 0; y < wanted_height; y++) { ... }


    int wanted_height = wh;
#pragma omp parallel firstprivate(wanted_height)
#pragma omp for schedule(static) nowait
        for (int y = 0; y < wanted_height; y++) { ... }

In other words, the error could be related to the end-of-loop variable being a "const int" instead of just an "int"?
File Name Submitted By Submitted On File Size  
vc90bug.zip 10/1/2010 2 KB
vc90bug.zip 10/1/2010 2 KB
vc90bug.zip 10/1/2010 2 KB