Solved

3 Linking errors i don't know what library i need = unresolved externals

Posted on 2004-08-19
11
842 Views
Last Modified: 2007-12-19
hello i have 3 errors with linking i don't know what library i need so anyone can tell me what i need

my library list : kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Linking Problem

Linking...
lib.obj : error LNK2001: unresolved external symbol __chvalidator
mass.obj : error LNK2001: unresolved external symbol __chvalidator
Debug/hello.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

hello.exe - 3 error(s), 0 warning(s)


0
Comment
Question by:Hanble
  • 2
  • 2
  • 2
  • +2
11 Comments
 
LVL 5

Expert Comment

by:millsoft
ID: 11843879
Hi Hanble,

isctype.h in the CRT source for .NET has this:


/***
* __chvalidator
*
* Purpose:
*       This function is called by character testing functions in debug
*       versions. This function test for validation of c as character.
*       For improvement in performance, it is not used in non-debug
*       version.  It is available in the static single-thread non-debug
*       build, though, just in case C code that includes ctype.h is compiled
*       /D_DEBUG /ML.
*
*******************************************************************************/

Are you compiling release or debug?

Cheers!
Brad
0
 
LVL 86

Expert Comment

by:jkr
ID: 11844321
I am missing libcpd.lib and libcd.lib in the above list...
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 11844735
>> I am missing libcpd.lib and libcd.lib in the above list...

The include file afx.h contains a sequence

#ifndef _AFX_NOFORCE_LIBS

...  include some windows and mfc libs

#ifdef _DLL
     #if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
          #pragma comment(lib, "msvcrtd.lib")
     #else
          #pragma comment(lib, "msvcrt.lib")
     #endif
#else
#ifdef _MT
     #if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
          #pragma comment(lib, "libcmtd.lib")
     #else
          #pragma comment(lib, "libcmt.lib")
     #endif
#else
     #if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
          #pragma comment(lib, "libcd.lib")
     #else
          #pragma comment(lib, "libc.lib")
     #endif
#endif
#endif


So, in case of MFC these libraries got linked by #pragma comment.


Hanble,

are you using precompiled header files?


Regards, Alex






0
 
LVL 86

Accepted Solution

by:
jkr earned 43 total points
ID: 11844771
>>The include file afx.h contains a sequence

... in which libcpd.lib still is missing.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 41 total points
ID: 11844847
>> ... in which libcpd.lib still is missing.

It's the "C++ Debug Runtime Library". Didn't see it recently.

Could be obsolete because of msvcrt.lib??? Or because of STL resp. C++ Standard ???

Regards, Alex
0
 

Author Comment

by:Hanble
ID: 11851397
are you using precompiled header files?
no i don't use percompiled header


i don't know what can i do with this problem anyway!


Are you compiling release or debug?
debug
0
 
LVL 5

Assisted Solution

by:millsoft
millsoft earned 41 total points
ID: 11852523
Try changing your run-time library options to static-linked/single-thread. Then try dynamic-link/single-thread, then Static-Link/Multiple-thread, etc. to see if perhaps a different version of the CRT will make a difference.
0
 

Expert Comment

by:jac_goudsmit
ID: 23920482
For me the way to fix it was to change the runtime library options to Multithreaded and Debug Multithreaded instead of Single-Threaded and Debug SIngle-Threaded.

Setting the runtime libraries to the DLL option (i.e. using MSVCRT.DLL) also works.

(Visual Studio 6 with the Platform SDK Feb 2003 and DDK for Windows Server 2003 SP1 installed)

===Jac
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now