[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Compiles in DEBUG mode when set to Release I get these errors.....

Posted on 2006-05-30
24
Medium Priority
?
1,037 Views
Last Modified: 2008-01-09
Hello:

I am using VS 2003 and I have a Multi-thread DLL project that compiles fine under debug mode.  I am ready to release this project.  I switch to release build and I get the following errors during linking!!!!

DLL works flawlessly in debug mode and I need to get it built under release mode.

I have double/tripple check settings, includes, additional libs etc.

Any clues why this is happening???

   Creating library .\Release/Grabber.lib and object .\Release/Grabber.exp
mfcs71.lib(stdafx.obj) : error LNK2001: unresolved external symbol __imp___resetstkoflw

DBuffer.obj : error LNK2019: unresolved external symbol __imp___resetstkoflw referenced in function "bool __cdecl ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable(unsigned long)" (?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z)

Grabber.obj : error LNK2001: unresolved external symbol __imp___resetstkoflw

ImageBuffer.obj : error LNK2001: unresolved external symbol __imp___resetstkoflw

StdAfx.obj : error LNK2019: unresolved external symbol __imp___resetstkoflw referenced in function "bool __cdecl ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable(unsigned long)" (?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z)

Grabber.obj : error LNK2019: unresolved external symbol __ftol2 referenced in function "public: int __thiscall FrameGrabber::SetAttribute(enum FG_VideoAttribute,float)" (?SetAttribute@FrameGrabber@@QAEHW4FG_VideoAttribute@@M@Z)

mfcs71.lib(stdafx.obj) : error LNK2019: unresolved external symbol __SEH_epilog referenced in function "bool __cdecl ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable(unsigned long)" (?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z)

atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol __SEH_epilog

mfcs71.lib(stdafx.obj) : error LNK2019: unresolved external symbol __SEH_prolog referenced in function "bool __cdecl ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable(unsigned long)" (?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z)

atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol __SEH_prolog

mfcs71.lib(stdafx.obj) : error LNK2019: unresolved external symbol ___security_cookie referenced in function "unsigned int __stdcall ATL::_AtlGetThreadACPFake(void)" (?_AtlGetThreadACPFake@ATL@@YGIXZ)

atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol ___security_cookie

mfcs71.lib(stdafx.obj) : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function "unsigned int __stdcall ATL::_AtlGetThreadACPFake(void)" (?_AtlGetThreadACPFake@ATL@@YGIXZ)

atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
.\Release/Grabber.dll : fatal error LNK1120: 6 unresolved externals
0
Comment
Question by:esblake
  • 11
  • 11
  • 2
24 Comments
 
LVL 4

Expert Comment

by:e_tadeu
ID: 16790861
Disable "Buffer Security Check" from Configuration Properties / C/C++ / Code Generation
Probably you are linking against old libraries (from VC6), and using runtime buffer overrun checking (they are not supported in older libraries).
0
 

Author Comment

by:esblake
ID: 16791002
Well, previous to this posting, I did remove this setting
Currently
"Buffer Security Check" = No
This is the same in both DEBUG and RELEASE as well.

I have all other Code Generations set to NO.
EXCEPT
"Enable C++ Exceptions" = Yes (/EHsc)

Still CRUMPS on linking with same errors.

Help me understand your statement "linking against old libraries (from VC6)"

This is an OLD DLL project I inherited.  HOWEVER I have another DLL project that works just find same Project/Properties settings.

0
 
LVL 4

Expert Comment

by:e_tadeu
ID: 16791022
Probably it is because your old DLL was compiled with Visual C++ 6, and now you are linking with Visual C++ 7.1 code. Try to recompile all your older DLL's on VS 2003!
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:esblake
ID: 16791087
I have, There are no other DLLs this is a stand-alone one.
0
 
LVL 4

Expert Comment

by:e_tadeu
ID: 16791175
Try to use the Dynamic RTL instead of the static one.

Also: Do you jave MSVC6 installed too? Is your Library Path pointing to the newer libraries of MSVC 2003?
0
 
LVL 4

Expert Comment

by:e_tadeu
ID: 16791224
Try to add sehprolg.obj to the list of objects too
0
 
LVL 86

Expert Comment

by:jkr
ID: 16791283
Which libs are you linking with in both configurations? I assume one is missing in the release build.
0
 

Author Comment

by:esblake
ID: 16792040
e_tadeu: OK on the Dynamic RTL, Where is this setting at VS2003??
0
 

Author Comment

by:esblake
ID: 16792061
e_tadeu: Copied on the sehprolg.obj....That fixed TWO of the unresolved.  Still left with __imp__resetstkoflw, __ftol2, __security_cookie @__security_check_cookie@4
0
 
LVL 86

Expert Comment

by:jkr
ID: 16792353
Have you tried to set

"Buffer Security Check" = Yes

?
0
 

Author Comment

by:esblake
ID: 16792432
jkr: Ok, Buffer Security Check = Yes Fixed the __ftol2 one only.
0
 
LVL 4

Expert Comment

by:e_tadeu
ID: 16792453
The Dynamic RTL option is under Configuration Properties / C/C++ / Code Generation / Runtime Library. Try a Multi-Threaded DLL (with or without debug). Are you sure you are not mixing VC6 libraries with VC7.1? Check the command line and the paths.
0
 

Author Comment

by:esblake
ID: 16799032
e_tadeu: ok, Got that....I am not mixing 6/7.1 I have Multi-Threaded DLL set. Same--Thing--..
0
 
LVL 4

Expert Comment

by:e_tadeu
ID: 16799407
Try changing "Basic Runtime Checks" to the other options ("Stack Frame", "Unitialized Variables", "Default")
0
 
LVL 4

Expert Comment

by:e_tadeu
ID: 16799445
Also try to link with the library bufferoverflowU.lib

See: http://support.microsoft.com/?id=894573
0
 

Author Comment

by:esblake
ID: 16799629
e_tadeu!!!
Way Cool!!

Only ONE unresolved reference left!!!

Grabber error LNK2001: unresolved external symbol __imp___resetstkoflw
Grabber error LNK2019: unresolved external symbol __imp___resetstkoflw referenced in function "bool __cdecl ATL(COLON)(COLON)_ATL_SAFE_ALLOCA_IMPL(COLON)(COLON)_AtlVerifyStackAvailable(unsigned long)" (?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z)

Any clues on this one?
0
 
LVL 4

Expert Comment

by:e_tadeu
ID: 16799737
Hmm... try to change C/C++ / Output Files / Expand Attributed Source
0
 
LVL 4

Expert Comment

by:e_tadeu
ID: 16799784
Or try to link with bufferoverflow.lib instead of bufferoverflowU.lib
0
 

Author Comment

by:esblake
ID: 16799860
e_tadeu:  Ok, Linked bufferoverflowU.lib.....No change.
Turned on Expand Attributed Source...No change (in messages or link errors).
???
0
 
LVL 4

Accepted Solution

by:
e_tadeu earned 2000 total points
ID: 16799982
Well, this function _resetstkoflw is defined in resetstk.c, a file from the CRT (C Runtime Library).
It seems you are linking against a wrong run-time library version?

See if you have resetstk.obj and try to link with it
0
 

Author Comment

by:esblake
ID: 16806851
e_tadeu:
Thanks for all of your assistance.  I am still a little confused as to why this functions in Debug and not in Release?
0
 

Author Comment

by:esblake
ID: 16806900
e_tadeu:  Here is something REAL interesting...At least I think so.
If, on release settings, I Choose Runtime Library Multi-threaded Debug Dll it compiles!
This of course is NOT what I need as I will then need to re-distribute all D versions of MS DLLs don't even want to go there!
Once I choose any NON-DEBUG DLL I the errors again.

Does this help?
0
 
LVL 4

Expert Comment

by:e_tadeu
ID: 16809143
Yes! I think the non-debug runtime DLL's do not have those functions for testing buffer overflow, stack overflow, etc... maybe that's why the linker was complaining.. the functions weren't there in the libs!
0
 

Author Comment

by:esblake
ID: 16809202
Thanks for your assistance....I need to review all code (again).  Seems like there is something hinky in the code.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question