Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

mfc80d.lib linker error

I have a .dll project that I compiled under VS2005.  It utilizes the VISA runtimes as well as the DAQmx.  I am porting my projects over to VS2008 and I get a link error that it can't find mfc80d.lib, which is a VS2005 debug library.  I appears that the NI libraries that are being linked in are causing this.  Will I need to simply updated drivers, or do I need to purchase an upgrade to my Measurement Studio?

Thanks,

Eric

 

0 Kudos
Message 1 of 8
(7,501 Views)

Hi AiR_GuNNeR,

 

My guess is that  is for some reason the application is including BOTH 2005 and 2008 include and library paths If this is case, then the solution may be to remove the 2005 
paths. You can do this by going to Tools>>Options>>VC++ Directories>>Include File and Tools>>Options>>VC++ Directories>>Library Files. 

Regards,

Hassan Atassi
Senior Group Manager, Digital Support
0 Kudos
Message 2 of 8
(7,473 Views)

Thanks for the reply.  I was able to figure out why I was getting the link error on Friday, but not the root cause.  What I did was turn in the verbose option for the linker. 

I was including the file NiCommonComponent.h.  This file was then trying to link in NiCommon80.lib,.  However, this file was being picked up through the "C:\Program Files\National Instruments\MeasurementStudioVS2005\VCNET\Include" path for some reason.  I can't seem to find where that path is being referenced.  I even opend the .vcproj file with notepad and searched through that and it wasn't being called out anywhere.  I manualy added the "C:\Program Files\National Instruments\MeasurementStudioVS2008\VCNET\Include" in the included path and this fixed the issue.

Any idea why the VS2005 path was being used?  I looked at the environmental variables as well and it's not there either.

0 Kudos
Message 3 of 8
(7,465 Views)

Hi AiR_GuNNer,

 

Due to the fact that you were upgrading from VS 2005 to VS 2008, you would need to manually change this path.

Regards,

Hassan Atassi
Senior Group Manager, Digital Support
0 Kudos
Message 4 of 8
(7,446 Views)

I am having what appears to be a similar issue.  I'm using a new PC with a fresh installation of measurement studio and MSVS 2010.  I've imported a MSVS 2005 project and converted it into a MSVS 2010 solution.  It failed to build because of missing header files.  It appears that files previously supplied by measurement studio 2005 (I think) such as NiCommonComponent.h and associated libraries are missing; they do not exist within the c:\program file\national instruments\MeasurementStudioVS2010\... directory.

 

So, I copied those header and lib files from another computer, set the project properties to point to them, and tried to build.  Predictably, it failed to link, because it's looking for the MSVS 2005 foundation classes in the file mfc80d.lib, against which (presumably) the old NI files were built.

 

I called tech support and they told me that this is a known issue; they don't seem to have a solution.  I'm beginning to think that I'll have to downgrade to MSVS 2005 in order to make any progress.

 

Any insight out there?

0 Kudos
Message 5 of 8
(7,360 Views)

Set your linker to full verbose.  It will display files and their paths that are being linked.  I found a path that was clearly for vs2005.  I can't recall if it actuall said 2005, or if it used the VS version number 8, 9, 10.

Look one level up and you should see alternate paths for the different versions.  Specify the proper path in the linker options "Additional Library Directories"

0 Kudos
Message 6 of 8
(7,352 Views)

air_gunner,

  Thanks for the suggestion.  Here's the output from the liker (full verbose):

 

1>        Found WS2_32_NULL_THUNK_DATA

1>          Referenced in ws2_32.lib(WS2_32.dll)

1>          Loaded ws2_32.lib(WS2_32.dll)

1>      Searching C:\Program Files\Microsoft SDKs\Windows\v7.0A\lib\mswsock.lib:

1>LINK : fatal error LNK1104: cannot open file 'mfc80d.lib'

 

This doesn't really tell me the critical info: why did it try to load mfc80d.dll, and what does that have to do with mswsock.lib (if anything)?

 

Also, since I don't have MSVS 2005, it doesn't matter to me if I can set the paths differently - paths are not a problem here; the file it's looking for won't be found.  I'm not trying to find it, but to find out what is asking for it.

0 Kudos
Message 7 of 8
(7,346 Views)

What I would do is perform a search of your C: drive starting at the root for all instances of mswsock.lib.

Find take the one with the latest file date, and add that path to your project setting in the linker section for force it to pick up the correct version.

What I ran into was a header file that was looking at the _MFC_VER.  Depending on what version it was, it was looking into two different library paths.  When I checked out that path, I found a third path that corrosponded to my VS2008 installation.  I included that path in my project and the problem resolved itself.

0 Kudos
Message 8 of 8
(7,338 Views)