Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2004-08-19
11
851 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 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.

856 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