Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ERRORS WHEN SWITCHING FROM DEBUG TO RELEASE

Status
Not open for further replies.

noaaprogrammer

Programmer
May 4, 2001
36
US
I have a large project that builds perfectly in the debug mode. However, when I switch to release mode, I get a bunch of unresolved external symbol errors. Here is what I get:

process_dwa.obj : error LNK2001: unresolved external symbol _Calc_Polar
process_dwa.obj : error LNK2001: unresolved external symbol _Calc_Params
process_wa.obj : error LNK2001: unresolved external symbol _Calc_Params
process_wda.obj : error LNK2001: unresolved external symbol _Calc_Params
spectra.obj : error LNK2001: unresolved external symbol _Calc_Params
spectra.obj : error LNK2001: unresolved external symbol _Calc_Vnoise
spectra.obj : error LNK2001: unresolved external symbol _Calc_WPM_Vnoise
spectra.obj : error LNK2001: unresolved external symbol _Calc_SS_Vnoise
spectra.obj : error LNK2001: unresolved external symbol _Calc_Polar_WPM
Release/WaveProc.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.

Anyone know what could be the culprit?
 
The code is probably fine . . . The error that you are having is in the linking of the code which happens after the compile. check what libraries (*.lib) files you have referenced in the Link tab under project properties and make sure that all of the libraries that you used in Debug are refeerenced in Release. - Jeff Marler B-)
 
I this problem recently with a fairly complicated ATL project. Solving it required some tinkering with the build and linker settings and some tips I found at MSDN.
Besides what other people have posted I can only say this: In future projects, you might want to periodically compile in Release mode to make sure I don't get too far along and then suddenly have to deal with this problem.
Good luck
--Will Duty
wduty@radicalfringe.com

 
I can't really pick out a piece of code to show. The project has over 100 files in it. I can tell you that there are some 'C' source files and header files mixed in with the C++ files. All of the errors are of functions defined in a C header file and being accessed by C source files.
 
The problem is what in Release mode, the compiller put files in the subdirectory Release, not in Debug. Just put all the needed libraries in that directory. In all the rest projects what you compille in Release mode linked to it you should do the same. John Fill
1c.bmp


ivfmd@mail.md
 
I fixed the problem. In project settings, I selected the 'source files' from the list. The 'Always use custom build' box was checked. I unchecked it and it builds and runs fine now. Thanks for the assistance. Ahhh! Another project out of the way.
 
Glad to hear you fixed the problem. As a further note, If you ever have this problem when doing ATL try taking out _ATL_MIN_CRT from the build settings.
--Will Duty
wduty@radicalfringe.com

 
I found a tip which hopefully will help others with problems when compiling a release build..
In the project settings under the link tab. tick the "link incrementally" box for the release settings.

It fixed up some errors I was having. Mainly this error....

LINK : warning LNK4089: all references to "SHELL32.dll" discarded by /OPT:REF


Changing that setting did increase the size of the build by heaps :( but not as much as a debug build. I searched this forum and couldn't find anyone else who had this same error so hopefully there is a better way of fixing the warning.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top