Re: [CMake] CMake MFC

2011-10-20 Thread Robert Dailey
Going to bump this thread in hopes I get a more urgent response. I'm very
much blocked on this until I can figure out why my project is trying to find
mfc40.lib when I only have mfc71.lib on my system.

I looked through the C++ code for #pragma comment(lib, ... ) directives, I
found none. I looked at my system include/library paths in Tools  Options
in Visual Studio 2003, I find nothing strange.

Please help guys, I really need a quick solution!! I appreciate in advance
any help!

On Tue, Oct 18, 2011 at 3:10 PM, Robert Dailey rcdai...@gmail.com wrote:

 I've enabled MFC by setting CMAKE_MFC_FLAG to 2. I'm using CMake 2.8.6 and
 I'm generating for Visual Studio 7.1.

 When I'm linking, I get the following error:

 uploadlog fatal error LNK1104: cannot open file 'mfc40.lib'

 On my system I only have mfc71.lib. Why is it trying to load version 4.0?

 -
 Robert Dailey

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake MFC

2011-10-20 Thread David Cole
Is it possible to try VS 2005, 2008 or 2010 here?

I assume building an MFC app without CMake works on this system...?


On Thu, Oct 20, 2011 at 11:43 AM, Robert Dailey rcdai...@gmail.com wrote:
 Going to bump this thread in hopes I get a more urgent response. I'm very
 much blocked on this until I can figure out why my project is trying to find
 mfc40.lib when I only have mfc71.lib on my system.
 I looked through the C++ code for #pragma comment(lib, ... ) directives, I
 found none. I looked at my system include/library paths in Tools  Options
 in Visual Studio 2003, I find nothing strange.
 Please help guys, I really need a quick solution!! I appreciate in advance
 any help!
 On Tue, Oct 18, 2011 at 3:10 PM, Robert Dailey rcdai...@gmail.com wrote:

 I've enabled MFC by setting CMAKE_MFC_FLAG to 2. I'm using CMake 2.8.6 and
 I'm generating for Visual Studio 7.1.
 When I'm linking, I get the following error:

     uploadlog fatal error LNK1104: cannot open file 'mfc40.lib'
 On my system I only have mfc71.lib. Why is it trying to load version 4.0?
 -
 Robert Dailey


 --

 Powered by www.kitware.com

 Visit other Kitware open-source projects at
 http://www.kitware.com/opensource/opensource.html

 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/CMake_FAQ

 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake MFC

2011-10-20 Thread Robert Dailey
I just tried with VS2008 and I get the same:
fatal error LNK1104: cannot open file 'mfc40.lib'

Also I created a default MFC application using the new project wizard in
VS2008 and it compiled  linked just fine, so it seems like maybe this is a
CMake issue?

-
Robert Dailey


On Thu, Oct 20, 2011 at 10:47 AM, David Cole david.c...@kitware.com wrote:

 Is it possible to try VS 2005, 2008 or 2010 here?

 I assume building an MFC app without CMake works on this system...?
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake MFC

2011-10-20 Thread Bill Hoffman

On 10/20/2011 12:35 PM, Robert Dailey wrote:

I just tried with VS2008 and I get the same:
 fatal error LNK1104: cannot open file 'mfc40.lib'

Also I created a default MFC application using the new project wizard in
VS2008 and it compiled  linked just fine, so it seems like maybe this
is a CMake issue?



Can you take the default MFC app that you created, and write CMake files 
for it?  Then see if that works?


-Bill

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake MFC

2011-10-20 Thread David Cole
Can you do a grep of your source tree for mfc4 ??

We do not have any occurrences of mfc4 anywhere in the CMake source
tree... I do not think we generate anything that references any mfc
libs even when you have the setting on. We just let Visual Studio do
it's thing...


On Thu, Oct 20, 2011 at 12:35 PM, Robert Dailey rcdai...@gmail.com wrote:
 I just tried with VS2008 and I get the same:
     fatal error LNK1104: cannot open file 'mfc40.lib'
 Also I created a default MFC application using the new project wizard in
 VS2008 and it compiled  linked just fine, so it seems like maybe this is a
 CMake issue?
 -
 Robert Dailey


 On Thu, Oct 20, 2011 at 10:47 AM, David Cole david.c...@kitware.com wrote:

 Is it possible to try VS 2005, 2008 or 2010 here?

 I assume building an MFC app without CMake works on this system...?
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake MFC

2011-10-20 Thread Robert Dailey
I did this and it links just fine... hmmm. Let me grep my source tree for
mfc4 and see what I get. I really am running out of ideas, I don't know
what else to look for.

-
Robert Dailey


On Thu, Oct 20, 2011 at 11:46 AM, Bill Hoffman bill.hoff...@kitware.comwrote:

 On 10/20/2011 12:35 PM, Robert Dailey wrote:

 I just tried with VS2008 and I get the same:
 fatal error LNK1104: cannot open file 'mfc40.lib'

 Also I created a default MFC application using the new project wizard in
 VS2008 and it compiled  linked just fine, so it seems like maybe this
 is a CMake issue?


 Can you take the default MFC app that you created, and write CMake files
 for it?  Then see if that works?
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake MFC

2011-10-20 Thread Robert Dailey
I grepped everything possible, I found nothing related to mfc4. This is
getting scary...

Since I'm not a CMake developer or expert, can someone guide me with steps
on how to debug this issue? If I need to debug CMake itself from source,
that is acceptable but hopefully we don't need to start there.

Once I open the generated VS2008 solution, is there anything in project
settings I can look at to maybe see something suspicious? Just let me know
what I need to do and Ill post the information you need.

Thanks in advance...

-
Robert Dailey


On Thu, Oct 20, 2011 at 12:01 PM, Robert Dailey rcdai...@gmail.com wrote:

 I did this and it links just fine... hmmm. Let me grep my source tree for
 mfc4 and see what I get. I really am running out of ideas, I don't know
 what else to look for.

 -
 Robert Dailey



 On Thu, Oct 20, 2011 at 11:46 AM, Bill Hoffman 
 bill.hoff...@kitware.comwrote:

 On 10/20/2011 12:35 PM, Robert Dailey wrote:

 I just tried with VS2008 and I get the same:
 fatal error LNK1104: cannot open file 'mfc40.lib'

 Also I created a default MFC application using the new project wizard in
 VS2008 and it compiled  linked just fine, so it seems like maybe this
 is a CMake issue?


 Can you take the default MFC app that you created, and write CMake files
 for it?  Then see if that works?


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake MFC

2011-10-20 Thread Robert Dailey
Also for reference, our original build system uses Cygwin and makefiles.
Below I will paste the command line invoked to compile 1 source file in this
MFC project as well as the link command.

Also please note that when building through our original build system, which
also uses VS2003, it successfully builds. For some reason it isn't trying to
find mfc40.lib. I don't understand command line builds using MSVC so I'm
hoping someone with more experience can maybe find a missing piece to the
puzzle here.

There is a file called uploadlogDlg.cpp and this is the command used to
build it:

C:/PROGRA~1/MICROS~1.NET/Vc7/bin/cl.exe  -nologo -MDd -EHsc -GT
-Zm800 -YX -FpWINNT5.0_DBG.OBJ/vc7.pch -D_MBCS -D_AFXDLL -D_WINDOWS
-D_WINDLL -D_AFXDLL -D_USRDLL -D_HAVE_STL_ -D_WINDOWS
-D_WIN32_WINNT=0x0400 -DUNSAFE_CONFIGOPS_ALLOWED   -DPRODUCT_TESS
-DUSE_GTINET=true -DDEBUG -D_HAVE_STL_ -D_REENTRANT -D_STLP_DEBUG
-DBUILD_VERSION=\6.3.2.111019021006\ -D_X86_ -DWINNT -DWIN32
-D_WIN32_WINNT=0x0500 -DWINVER=0x500 -DWIN32_IMPORT_EXPORT -DSTL=std
-I. -IWINNT5.0_DBG.OBJ -I../../../work/B1/WINNT5.0_DBG.OBJ/bin
-I../../../work/B1/WINNT5.0_DBG.OBJ/include
-I../../../work/B1/WINNT5.0_DBG.OBJ/include/nspr
-I../../../work/B1/WINNT5.0_DBG.OBJ/include/stlport
-I../../../work/B1/WINNT5.0_DBG.OBJ/include/gtinet -X
-IC:/PROGRA~1/MICROS~1.NET/Vc7/include
-IC:/PROGRA~1/MICROS~1.NET/VC7/PlatformSDK/include
-I../../../work/B1/WINNT5.0_DBG.OBJ/include/mssdkutils
-IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include
-IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include   -Zi -D_DEBUG -Od -W3
-FdWINNT5.0_DBG.OBJ/vc7.pdb /RTC1 -we4103 -GR -GF -D_USE_32BIT_TIME_T
   -c \
\
/FoWINNT5.0_DBG.OBJ/uploadlogDlg.obj \
\
uploadlogDlg.cpp



Also here is the linker command from what I can see:

C:/PROGRA~1/MICROS~1.NET/Vc7/bin/cl.exe \
\
/FeWINNT5.0_DBG.OBJ/uploadlog.exe \
\
WINNT5.0_DBG.OBJ/StdAfx.obj WINNT5.0_DBG.OBJ/uploader.obj
WINNT5.0_DBG.OBJ/uploadlog.obj WINNT5.0_DBG.OBJ/uploadlogDlg.obj
WINNT5.0_DBG.OBJ/mlog.obj  WINNT5.0_DBG.OBJ/uploadlog_exe.res
-FmWINNT5.0_DBG.OBJ/uploadlog.map /link /DEBUG /DEBUGTYPE:CV /FIXED:NO
/SUBSYSTEM:WINDOWS  -nologo /LIBPATH:WINNT5.0_DBG.OBJ
/LIBPATH:../common/WINNT5.0_DBG.OBJ
/LIBPATH:../../../work/B1/WINNT5.0_DBG.OBJ/lib
/LIBPATH:C:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/lib
/LIBPATH:../../../work/B1/WINNT5.0_DBG.OBJ/lib -debug -debugtype:cv
\
 advapi32.lib gdconfig.lib gdlog.lib gdlogviewer.lib gdnet.lib
gdutil.lib gdgsoap.lib gmmwsclient.lib ole32.lib Ws2_32.lib gdzlib.lib
-pdb:WINNT5.0_DBG.OBJ/uploadlog.pdb libnspr4.lib libplc4.lib
libplds4.lib
c:/cygwin/bin/cp.exe -fup WINNT5.0_DBG.OBJ/uploadlog.exe
WINNT5.0_DBG.OBJ/uploadlog.pdb WINNT5.0_DBG.OBJ/uploadlog.map
WINNT5.0_DBG.OBJ/uploadlog.pdb WINNT5.0_DBG.OBJ/uploadlog.map
../../../work/B1/WINNT5.0_DBG.OBJ/bin



-
Robert Dailey


On Thu, Oct 20, 2011 at 2:04 PM, Robert Dailey rcdai...@gmail.com wrote:

 I grepped everything possible, I found nothing related to mfc4. This is
 getting scary...

 Since I'm not a CMake developer or expert, can someone guide me with steps
 on how to debug this issue? If I need to debug CMake itself from source,
 that is acceptable but hopefully we don't need to start there.

 Once I open the generated VS2008 solution, is there anything in project
 settings I can look at to maybe see something suspicious? Just let me know
 what I need to do and Ill post the information you need.

 Thanks in advance...

 -
 Robert Dailey



 On Thu, Oct 20, 2011 at 12:01 PM, Robert Dailey rcdai...@gmail.comwrote:

 I did this and it links just fine... hmmm. Let me grep my source tree for
 mfc4 and see what I get. I really am running out of ideas, I don't know
 what else to look for.

 -
 Robert Dailey



 On Thu, Oct 20, 2011 at 11:46 AM, Bill Hoffman 
 bill.hoff...@kitware.comwrote:

 On 10/20/2011 12:35 PM, Robert Dailey wrote:

 I just tried with VS2008 and I get the same:
 fatal error LNK1104: cannot open file 'mfc40.lib'

 Also I created a default MFC application using the new project wizard in
 VS2008 and it compiled  linked just fine, so it seems like maybe this
 is a CMake issue?


 Can you take the default MFC app that you created, and write CMake files
 for it?  Then see if that works?



--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake MFC

2011-10-20 Thread David Cole
The quote placement look suspicious. Where are these coming from? Do
you have quotes embedded in environment variable values?

-IC:/PROGRA~1/MICROS~1.NET/Vc7/include
-IC:/PROGRA~1/MICROS~1.NET/VC7/PlatformSDK/include
-IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include
-IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include

/LIBPATH:C:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/lib

And is the mfc4 lib that it's looking for actually in the atlmfc/lib
folder of your Visual Studio installation?


On Thu, Oct 20, 2011 at 3:12 PM, Robert Dailey rcdai...@gmail.com wrote:
 Also for reference, our original build system uses Cygwin and makefiles.
 Below I will paste the command line invoked to compile 1 source file in this
 MFC project as well as the link command.
 Also please note that when building through our original build system, which
 also uses VS2003, it successfully builds. For some reason it isn't trying to
 find mfc40.lib. I don't understand command line builds using MSVC so I'm
 hoping someone with more experience can maybe find a missing piece to the
 puzzle here.

 There is a file called uploadlogDlg.cpp and this is the command used to
 build it:

 C:/PROGRA~1/MICROS~1.NET/Vc7/bin/cl.exe  -nologo -MDd -EHsc -GT
 -Zm800 -YX -FpWINNT5.0_DBG.OBJ/vc7.pch -D_MBCS -D_AFXDLL -D_WINDOWS
 -D_WINDLL -D_AFXDLL -D_USRDLL -D_HAVE_STL_ -D_WINDOWS -D_WIN32_WINNT=0x0400
 -DUNSAFE_CONFIGOPS_ALLOWED   -DPRODUCT_TESS -DUSE_GTINET=true -DDEBUG
 -D_HAVE_STL_ -D_REENTRANT -D_STLP_DEBUG
 -DBUILD_VERSION=\6.3.2.111019021006\ -D_X86_ -DWINNT -DWIN32
 -D_WIN32_WINNT=0x0500 -DWINVER=0x500 -DWIN32_IMPORT_EXPORT -DSTL=std  -I.
 -IWINNT5.0_DBG.OBJ -I../../../work/B1/WINNT5.0_DBG.OBJ/bin
 -I../../../work/B1/WINNT5.0_DBG.OBJ/include
 -I../../../work/B1/WINNT5.0_DBG.OBJ/include/nspr
 -I../../../work/B1/WINNT5.0_DBG.OBJ/include/stlport
 -I../../../work/B1/WINNT5.0_DBG.OBJ/include/gtinet -X
 -IC:/PROGRA~1/MICROS~1.NET/Vc7/include
 -IC:/PROGRA~1/MICROS~1.NET/VC7/PlatformSDK/include
 -I../../../work/B1/WINNT5.0_DBG.OBJ/include/mssdkutils
 -IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include
 -IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include   -Zi -D_DEBUG -Od -W3
 -FdWINNT5.0_DBG.OBJ/vc7.pdb /RTC1 -we4103 -GR -GF -D_USE_32BIT_TIME_T -c
 \
   \
   /FoWINNT5.0_DBG.OBJ/uploadlogDlg.obj \
   \
   uploadlogDlg.cpp

 Also here is the linker command from what I can see:

 C:/PROGRA~1/MICROS~1.NET/Vc7/bin/cl.exe \
   \
   /FeWINNT5.0_DBG.OBJ/uploadlog.exe \
   \
   WINNT5.0_DBG.OBJ/StdAfx.obj WINNT5.0_DBG.OBJ/uploader.obj
 WINNT5.0_DBG.OBJ/uploadlog.obj WINNT5.0_DBG.OBJ/uploadlogDlg.obj
 WINNT5.0_DBG.OBJ/mlog.obj  WINNT5.0_DBG.OBJ/uploadlog_exe.res
 -FmWINNT5.0_DBG.OBJ/uploadlog.map /link /DEBUG /DEBUGTYPE:CV /FIXED:NO
 /SUBSYSTEM:WINDOWS  -nologo /LIBPATH:WINNT5.0_DBG.OBJ
 /LIBPATH:../common/WINNT5.0_DBG.OBJ
 /LIBPATH:../../../work/B1/WINNT5.0_DBG.OBJ/lib
 /LIBPATH:C:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/lib
 /LIBPATH:../../../work/B1/WINNT5.0_DBG.OBJ/lib -debug -debugtype:cv\
advapi32.lib gdconfig.lib gdlog.lib gdlogviewer.lib gdnet.lib 
 gdutil.lib
 gdgsoap.lib gmmwsclient.lib ole32.lib Ws2_32.lib gdzlib.lib
 -pdb:WINNT5.0_DBG.OBJ/uploadlog.pdb libnspr4.lib libplc4.lib libplds4.lib
 c:/cygwin/bin/cp.exe -fup WINNT5.0_DBG.OBJ/uploadlog.exe
 WINNT5.0_DBG.OBJ/uploadlog.pdb WINNT5.0_DBG.OBJ/uploadlog.map
 WINNT5.0_DBG.OBJ/uploadlog.pdb WINNT5.0_DBG.OBJ/uploadlog.map
 ../../../work/B1/WINNT5.0_DBG.OBJ/bin

 -
 Robert Dailey


 On Thu, Oct 20, 2011 at 2:04 PM, Robert Dailey rcdai...@gmail.com wrote:

 I grepped everything possible, I found nothing related to mfc4. This is
 getting scary...
 Since I'm not a CMake developer or expert, can someone guide me with steps
 on how to debug this issue? If I need to debug CMake itself from source,
 that is acceptable but hopefully we don't need to start there.
 Once I open the generated VS2008 solution, is there anything in project
 settings I can look at to maybe see something suspicious? Just let me know
 what I need to do and Ill post the information you need.
 Thanks in advance...

 -
 Robert Dailey


 On Thu, Oct 20, 2011 at 12:01 PM, Robert Dailey rcdai...@gmail.com
 wrote:

 I did this and it links just fine... hmmm. Let me grep my source tree for
 mfc4 and see what I get. I really am running out of ideas, I don't know
 what else to look for.

 -
 Robert Dailey


 On Thu, Oct 20, 2011 at 11:46 AM, Bill Hoffman bill.hoff...@kitware.com
 wrote:

 On 10/20/2011 12:35 PM, Robert Dailey wrote:

 I just tried with VS2008 and I get the same:
     fatal error LNK1104: cannot open file 'mfc40.lib'

 Also I created a default MFC application using the new project wizard
 in
 VS2008 and it compiled  linked just fine, so it seems like maybe this
 is a CMake issue?


 Can you take the default MFC app that you created, and write CMake files
 for it?  Then see if that works?


 --

 Powered by www.kitware.com

 Visit other Kitware open-source projects at
 

Re: [CMake] CMake MFC

2011-10-20 Thread Robert Dailey
Those quotes do look suspicious but for some reason they work just fine in
Cygwin.

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.

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.

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?

On Thu, Oct 20, 2011 at 2:20 PM, David Cole david.c...@kitware.com wrote:

 The quote placement look suspicious. Where are these coming from? Do
 you have quotes embedded in environment variable values?

 -IC:/PROGRA~1/MICROS~1.NET/Vc7/include
 -IC:/PROGRA~1/MICROS~1.NET/VC7/PlatformSDK/include
 -IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include
 -IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include

 /LIBPATH:C:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/lib

 And is the mfc4 lib that it's looking for actually in the atlmfc/lib
 folder of your Visual Studio installation?
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake MFC

2011-10-20 Thread Robert Dailey
More updates.

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:

LNK1104: cannot open file 'libc.lib'

Now this is just confusing. What is this lib and why can't it find it?

-
Robert Dailey


On Thu, Oct 20, 2011 at 3:38 PM, Robert Dailey rcdai...@gmail.com wrote:

 Those quotes do look suspicious but for some reason they work just fine in
 Cygwin.

 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.

 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.

 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?


 On Thu, Oct 20, 2011 at 2:20 PM, David Cole david.c...@kitware.comwrote:

 The quote placement look suspicious. Where are these coming from? Do
 you have quotes embedded in environment variable values?

 -IC:/PROGRA~1/MICROS~1.NET/Vc7/include
 -IC:/PROGRA~1/MICROS~1.NET/VC7/PlatformSDK/include
 -IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include
 -IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include

 /LIBPATH:C:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/lib

 And is the mfc4 lib that it's looking for actually in the atlmfc/lib
 folder of your Visual Studio installation?


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake MFC

2011-10-20 Thread Robert Dailey
I think I found the issue.

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):

-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


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???

-
Robert Dailey


On Thu, Oct 20, 2011 at 6:52 PM, Robert Dailey rcdai...@gmail.com wrote:

 More updates.

 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:

 LNK1104: cannot open file 'libc.lib'

 Now this is just confusing. What is this lib and why can't it find it?

 -
 Robert Dailey



 On Thu, Oct 20, 2011 at 3:38 PM, Robert Dailey rcdai...@gmail.com wrote:

 Those quotes do look suspicious but for some reason they work just fine in
 Cygwin.

 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.

 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.

 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?


 On Thu, Oct 20, 2011 at 2:20 PM, David Cole david.c...@kitware.comwrote:

 The quote placement look suspicious. Where are these coming from? Do
 you have quotes embedded in environment variable values?

 -IC:/PROGRA~1/MICROS~1.NET/Vc7/include
 -IC:/PROGRA~1/MICROS~1.NET/VC7/PlatformSDK/include
 -IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include
 -IC:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/include

 /LIBPATH:C:/PROGRA~1/MICROS~1.NET/Vc7/atlmfc/lib

 And is the mfc4 lib that it's looking for actually in the atlmfc/lib
 folder of your Visual Studio installation?



--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake