-
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
-
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
-
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.
-
Re: Release mode problem
[ merged thread ]
Please do not post the same question in multiple forums. Thank you.
-
Re: Release mode problem
Well, the program crash has some other reason. BTW, you should include "stdafx.h" before any other file.
-
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
-
Re: Release mode problem
merged threads! please avoid cross posts...
-
Re: Release mode problem