473,386 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

"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.public.dotnet.languages.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 4106
>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 "AdditionalDependencies" 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 AdditionalDependencies 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
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...
0
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): ____________________________________________________________...
6
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:...
0
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...
4
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...
11
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
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...
94
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...
9
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.