473,837 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Whole program optimization" results in LNK1171 error - cannot find "c2.dll"

Hi,

I have a number of C++ solutions in Visual Studio .NET and when i compile them using "Whole Program Optimization", certain projects report a LNK1171 error saying that c2.dll could not be loaded. The error contains the correct path to c2.dll (and it is definately there).

This only happens on some projects and only when "whole program optimization" option is turned on. If i turn off this option, the problem goes away. I have other projects (in the same solution) and in other solutions, that work with the "whole program optimization" option turned on. Some of the projects that work are larger and some smaller than the projects that don't work, so it is not a size issue.

I have searched the newsgroups and the web and i could not find any solutions to this problem. (Although i did find other people reporting the same problem, eg in microsoft.publi c.dotnet.langua ges.vc newsgroup)

Is there any solution to this?

The version i'm using:
Microsoft Development Environment 2002 Version 7.0.9466
Microsoft .NET Framework 1.0 Version 1.0.3705

Thanks,

Nov 16 '05 #1
3 4147
>I have a number of C++ solutions in Visual Studio .NET and when i compile them using "Whole Program Optimization", certain projects report a LNK1171 error saying that c2.dll could not be loaded. The error contains the correct path to c2.dll (and it is definately there).

This only happens on some projects and only when "whole program optimization" option is turned on. If i turn off this option, the problem goes away.


Dmitry,

Do you have a small(ish) project that you can use to demonstrate this
problem?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 16 '05 #2
Hi,

The smallest of the projects is around 1000 files, so i cannot demostrate this problem easily.

Nonetheless, i have found a solution to this - it seems to come from the order of libraries in the
Linker's "AdditionalDepe ndencies" field. Changing the order in which libraries are linked to the
project seems to fix the problem.

Eg if your project links against libraries a.lib, b.lib, c.lib, d.lib etc, then AdditionalDepen dencies would
contain "a.lib b.lib c.lib d.lib". Moving a.lib to the end of the list (to form "b.lib c.lib d.lib a.lib") would
probably fix the problem. If not, try repeating with the next library ("c.lib d.lib a.lib b.lib") etc. Following
this algorithm has fixed all three of my projects that did not work before.

Regards,
Dmitry
----- David Lowndes wrote: -----
I have a number of C++ solutions in Visual Studio .NET and when i compile them using "Whole Program Optimization", certain projects report a LNK1171 error saying that c2.dll could not be loaded. The error contains the correct path to c2.dll (and it is definately there).
This only happens on some projects and only when "whole program optimization" option is turned on. If i turn off this option, the problem goes away.


Dmitry,

Do you have a small(ish) project that you can use to demonstrate this
problem?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 16 '05 #3
>Changing the order in which libraries are linked to the
project seems to fix the problem.


I think that's just as worrying as having the error in the first
place. It'd be good to get a repro for this situation to MS in order
to get it seen to.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2327
by: jr | last post by:
I am working in VC++ so this may be microsoft specific though I don't think so. Excuse me if it is. Assuming it isn't, can someone generally explain the purpose of having both - is it purely a deployment/distribution thing. I notice that the static library generates obj files and a Lib file. Could someone kindly explain how they relate to one another. Thanks very much
0
1770
by: news.iq.ca | last post by:
Hello. I have created a class, "CompiledPage.vb", and I need to compile it. When I run (using the VSNet Command Prompt): ____________________________________________________________ C:\Documents and Settings\Administrator>vbc /t:library /r:system.dll, system.web.dll, "C:\Documents and Settings\Administrator\My Documents\My Projects\ASPNETProjects\VSNet\CompiledForm\CompiledPage.vb"...
6
26034
by: John Doe | last post by:
Hi, I've got the following error when building my ASP.NET application called WebApplication1: Preparing resources... Updating references... Performing main compilation... error CS0006: Metadata file 'c:\inetpub\wwwroot\WebApplication1\bin\WebApplication1.dll' could not be
0
1924
by: LBeveridge | last post by:
Hi, This morning I installed Visual Studio 2005 side-by-side 2003. The first problem I've noted is that projects in 2003 that have "Start External Program" set don't do that. I'm creating a DLL plug-in for ArcMap (an ESRI product), so I set the external program to point to its EXE. When debugging, it shows the splash screen of the application it's supposed to start, then bombs with no error message, and the debugging stops (just...
4
4307
by: topmind | last post by:
I tried to install the sqlite extension to PHP using "php_sqlite.dll", but I get the following error message: PHP Warning: Unknown(): Unable to load dynamic library './php_sqlite.dll' - Access is denied. in Unknown on line 0 I am using IIS on Windows XP for development only. It is Php version 4.3.2. I added all permissions I could, including "write". It is finding the DLL okay because if I rename it I get a "not found" message...
11
2740
by: jobs239 | last post by:
Can I use this line inside C program "system(java -jar <jarfilename>)" to run a java program from C? Or do I have to use some JNI interface.?
2
14882
by: Chris | last post by:
Hi, I installed Visual Studio 2005 SP1, my application does not start on machines without Visual Studio installed any more. It was working without SP1. After searching the web, it seems caused by manifest file, I changed link option to generate external manifest file. The manifest lists dependency to two version of CRTs, is that the problem and why it lists both?
94
30393
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock Statement (C# Reference) statement to serialize access. " But when is it better to use "volatile" instead of "lock" ?
9
2923
by: Keith G Hicks | last post by:
I'm having a lot of trouble with "file in use" errors in my "folder watcher" project. Starting and stopping the watcher and reading my XML file work fine. Once the watcher is started, I'm reading the text files from the watched folder line by line into variables and then posting them to a SQL table. All of the code for the form is shown below. And it works fine except for 2 issues. First issue: In the Finally of the Try for teh SQL...
0
9846
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9683
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10579
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10633
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10276
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7814
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5674
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3126
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.