-
September 23rd, 2005, 03:08 AM
#1
Release mode problem
Hi to all,
If I am compiling through debug mode my project works fine but I am compiling through release mode it gives following warning and program crashes at runtime.
LINK : warning LNK4089: all references to "ADVAPI32.dll" discarded by /OPT:REF
LINK : warning LNK4089: all references to "MSVCP60.dll" discarded by /OPT:REF
The above warning is given by compiler if am included one .cpp and .h file in my project.In that file I have included
#include <string>
#include "stdafx.h"
these two files and used STL string class.
I hope that I got answer from u.
Rahul
-
September 23rd, 2005, 03:18 AM
#2
Re: Release mode problem
Error occurs due to.
all references to 'dynamic-link library' discarded by /OPT:REF
The linker discarded all packaged functions that referenced exports in
dynamic-link library. As a result, dynamic-link library is not needed for
execution of the image.
You may want to consider removing references to dynamic-link library to
speed up the build.
Other occurrences of this warning can occur if an unused function in your
code references a .dll export that the linker has discarded. Use /VERBOSE
to see which of your functions the linker is discarding and then remove
them from your code.
for more details just go through MSDN and see how to use /VERBOSE
-
September 23rd, 2005, 03:20 AM
#3
Re: Release mode problem
No reason to worry... linker just says that as you dont need anything from these two files so the references to them are removed.
Just researched that myself...
If it seems to cause you trouble in in your application tho its unlikley you can remove the /OPT:REF parameter from linker options and this optimization does not occur.
Last edited by alexiadeath; September 23rd, 2005 at 03:30 AM.
Learning is a way of life...
A question you never ask, cannot be answered.
-
September 23rd, 2005, 03:32 AM
#4
Re: Release mode problem
[ merged thread ]
Please do not post the same question in multiple forums. Thank you.
-
September 23rd, 2005, 03:45 AM
#5
Re: Release mode problem
Well, the program crash has some other reason. BTW, you should include "stdafx.h" before any other file.
-
September 23rd, 2005, 04:46 AM
#6
Re: Release mode problem
You're sure this linker warning is related to the runtime crash?
The LNK4089 is just a warning telling you that you've referenced a library (you've told the linker too link a library), but the library is never used (no part of your code is using the library).
You should remove the library(-ies) from your project if you don't use them.
- petter
-
September 23rd, 2005, 06:48 AM
#7
Re: Release mode problem
merged threads! please avoid cross posts...
If you think you CAN, you can, If you think you CAN'T, you are probably right.
Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.
-
September 23rd, 2005, 08:27 AM
#8
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|