Solved

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

Posted on 2004-08-19
11
852 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
[X]
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
  • 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
Technology Partners: 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!

 
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

730 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