-
November 13th, 2003, 11:45 AM
#1
error LNK2001: unresolved external symbol __pctype
When I compile and link a simple test program using VC++ 6.0 I get the following errors:
error LNK2001: unresolved external symbol __pctype
error LNK2001: unresolved external symbol ___mb_curr_max
These symbols are not mine but are contained within two of my object modules.
Does anyone know where these are defined and how I can eliminate the linker error? It appears to me that these symbols are part of VC++. They aren't part of my code.
-
November 13th, 2003, 11:57 AM
#2
What runtime are you linking with? (VC++ 6.0: Project | Settings | C/C++ | Code Generation | Use run-time library)
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
-
November 13th, 2003, 11:59 AM
#3
I'm using the Debug Single-Theaded run time library.
-
November 13th, 2003, 12:01 PM
#4
Try the (debug) Multithreaded or (debug) Multithreaded DLL.
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
-
November 13th, 2003, 12:22 PM
#5
Thanks for a little bit of progress. Included below are the error messages from compilation and links using each of the different runtime options.
The errors that I encountered at first were with the Debug Single Threaded runtime package with an exclusion of the libcd.lib. I experimented with excluding this library because of the error message, similar to the one below, that indicated _fopen was alread defined in LIBCD.lib.
These error messages were generated without any exclusions and with the runtime package identified in << >>. As you can see, only the (Debug) Multi-threaded DLL runtime allowed the link to finish.
Can you help me understand why?
Thanks again.
<< Runtime - (Debug) Single Threaded, (Debug) Multi-Threaded >>
Linking...
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _printf already defined in LIBCMT.lib(printf.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fclose already defined in LIBCMT.lib(fclose.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fopen already defined in LIBCMT.lib(fopen.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncpy already defined in LIBCMT.lib(strncpy.obj)
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/TestReposit.exe : fatal error LNK1169: one or more multiply defined symbols found
<< Runtime Multi Threaded DLL >>
Compiling...
dumpmem.c
strutil.c
testReposit.cpp
m:\src\test\testreposit\testreposit.cpp(74) : warning C4273: '_errno' : inconsistent dll linkage. dllexport assumed.
Linking...
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
TestReposit.exe - 0 error(s), 2 warning(s)
<< Runtime - Debug Multi-Threaded DLL >>
Compiling...
dumpmem.c
strutil.c
testReposit.cpp
m:\src\test\testreposit\testreposit.cpp(74) : warning C4273: '_errno' : inconsistent dll linkage. dllexport assumed.
Linking...
TestReposit.exe - 0 error(s), 1 warning(s)
-
November 13th, 2003, 12:37 PM
#6
Of course, you should realize you would use the DEBUG runtime in DEBUG builds, and the non-DEBUG runtime in RELEASE builds of your application.
In short, you're likely using some static library (mysql? sqlite?) that was compiled with the multithreaded-dll option. Thus, your program should use the same CRT.
You may be able to use the non-DLL MT CRT by messing with the /NODEFAULTLIB linker option, but I personally avoid such situations.
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
-
November 13th, 2003, 12:39 PM
#7
Thanks for you help. I'm off and running again
-
July 4th, 2012, 04:32 AM
#8
Re: error LNK2001: unresolved external symbol __pctype
Hello, i also have the same problem. Here are the errors that occure while i'm building dream source code on visual studio 6:
libfftw.lib(wisdom.obj) : error LNK2001: unresolved external symbol __pctype
libfftw.lib(wisdom.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
Release/Dream.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Dream.exe - 3 error(s), 2 warning(s)
Can someone help me please?
-
July 5th, 2012, 02:22 AM
#9
Re: error LNK2001: unresolved external symbol __pctype
Originally Posted by miky228
Hello, i also have the same problem.
Well, seems like the solution is the same too, and you have to build with some multithreaded CRT flavor.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|