I think I found the issue.<div><br></div><div>Deep inside one of the Microsoft Exchange LIB files that I link against my MFC project executable is the following (I copied this out of the text editor):</div><div><br></div><div>
-defaultlib:mfc40.lib -defaultlib:mfcs40.lib -defaultlib:msvcrt.lib -defaultlib:kernel32.lib -defaultlib:user32.lib -defaultlib:gdi32.lib -defaultlib:comdlg32.lib -defaultlib:winspool.lib -defaultlib:advapi32.lib -defaultlib:shell32.lib -defaultlib:comctl32.lib /include:__afxForceEXCLUDE /include:__afxForceUSRDLL /include:__afxForceSTDAFX -defaultlib:LIBC -defaultlib:OLDNAMES </div>
<div><br></div><div><br></div><div>I don't know what the dash "-" means, but looks like maybe it is pulling that lib out from this lib? I don't know how that works but it's very sneaky... any idea what these command-line arguments are doing in a debug LIB file???<br clear="all">
<div><br></div><div>---------</div>Robert Dailey<br>
<br><br><div class="gmail_quote">On Thu, Oct 20, 2011 at 6:52 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
More updates.<div><br></div><div>I generated my MFC project as normal through CMake and still have the mfc40.lib can't be found linker error. So what I did was remove 1 CPP file from the project at a time, clean, rebuild and see what different results I get. Well, once all of the MFC related CPP files (the app class, dialog classes, etc) were removed, the remaining CPP files linked gave me this:</div>
<div><br></div><div>LNK1104: cannot open file 'libc.lib'</div><div><br></div><div>Now this is just confusing. What is this lib and why can't it find it?<br clear="all"><div><br></div><div>---------</div>Robert Dailey<div>
<div></div><div class="h5"><br>
<br><br><div class="gmail_quote">On Thu, Oct 20, 2011 at 3:38 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Those quotes do look suspicious but for some reason they work just fine in Cygwin.<div><br></div><div>Basically I load vsvars32.bat into my cygwin environment, and I have modified the paths in that batch file to the "short path" format since our makefile build scripts do not play friendly with spaces in the file paths. Don't ask me much more about it, I didn't write the scripts so I'm not very familiar with them.</div>
<div><br></div><div>No MFC4 libs are in my Visual Studio installation directory. Also there are NO mfc4 libs anywhere on my entire hard drive, as I did a search at that level as well.</div><div><br></div><div>What about the command switches? There are quite a few of them and I don't know what most of them do. Did you find anything related to this problem that CMake might be missing? One thing I've been trying to figure out is exactly how mfc40.lib is coming up. It's not in the command line, I haven't found it in the source code, so where the heck would it be coming from? I'm completely at a loss. Would _WIN_VER=0x400 (or whatever version) or something have anything to do with this?<div>
<br>
<br><div class="gmail_quote">On Thu, Oct 20, 2011 at 2:20 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The quote placement look suspicious. Where are these coming from? Do<br>
you have quotes embedded in environment variable values?<br>
<div><br>
-I"C:/PROGRA~1/MICROS~<a href="http://1.NET/Vc7" target="_blank">1.NET/Vc7</a>"/include<br>
-I"C:/PROGRA~1/MICROS~<a href="http://1.NET" target="_blank">1.NET</a>"/VC7/PlatformSDK/include<br>
</div><div>-I"C:/PROGRA~1/MICROS~<a href="http://1.NET/Vc7" target="_blank">1.NET/Vc7</a>"/atlmfc/include<br>
-I"C:/PROGRA~1/MICROS~<a href="http://1.NET/Vc7" target="_blank">1.NET/Vc7</a>"/atlmfc/include<br>
<br>
</div>/LIBPATH:"C:/PROGRA~1/MICROS~<a href="http://1.NET/Vc7" target="_blank">1.NET/Vc7</a>"/atlmfc/lib<br>
<br>
And is the mfc4 lib that it's looking for actually in the "atlmfc/lib"<br>
folder of your Visual Studio installation?</blockquote></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>