?
Solved

entry point __lc_collate_cp problem

Posted on 2003-03-27
15
Medium Priority
?
817 Views
Last Modified: 2013-11-20
I have an application that throws the following error when it is run on WinNT4 (SP6a) box.

"The procedure entry point __lc_collate_cp could not be located in the dynamic link library MSVCRT.dll"

I know that this issue is related to older version of MSVCRT.dll in System32 folder. And if I replace it with newer version, this error goes away.

The information that I am looking for...

1. What API or part of SDK triggered the use of this entry point.
2. Is there a workaround meaning that I remove some calls from app so that I don't have to use the newer DLL.

Please don't answer with comments "why don't you want to replace the old DLL?". Bottom line is replacing the older DLL is not an option because it requires a restart or server. And we can't afford that.

VC6.0 (SP5)
WinNT 4
MFC (SDI) App

Naveen
0
Comment
Question by:naveenkohli
[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
  • 8
  • 6
15 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 8217999
Try to place new version of MSVCRT.dll to program startup directory.
0
 
LVL 23

Author Comment

by:naveenkohli
ID: 8218073
AlexM,
I have already mentioned in my question ..."Replacing the DLL is not an option". And this DLL can't be replaced without restart because OS uses the same DLL.
0
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 8218259
>>"Replacing the DLL is not an option"

This might be too simple, but: Why don't you link the app statically to the CRT? IOW: Using /ML instead of /MT. In this case, using libc.lib instead of msvcrt.lib, you will be independant of teh msvcrt.dll installed on the machine at the cost of getting a bigger binary image...

0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 23

Author Comment

by:naveenkohli
ID: 8218327
jkr,
that might be an option. We really don't care about size of the binary. What I am trying to figure out is, why the app got dependency on this new DLL.
I have been looing at the export of MSVCRT.dll and MSVCp60.dll. And the stuff in MSVCP60.dll is mostly related to STL. And my app does use STL heavily. Can this be the reason of this dependeny? Inthat case I may have to remove STL from the app altogether.
let me give it a try and i will be back...
0
 
LVL 86

Expert Comment

by:jkr
ID: 8218514
STL should not be an issue - '__lc_collate_cp' is declared in 'setlocal.h'
0
 
LVL 23

Author Comment

by:naveenkohli
ID: 8220480
Static linking hasn't helped so far...
0
 
LVL 23

Author Comment

by:naveenkohli
ID: 8220561
Now I have got link errors...

unresolves external symbol __endthreadex
unresolves external symbol __beginthreadex

If I switch to /ML that mean i will be using Single threaded libs. And I have bunch of worker threads getting spawned in  my app. Will this setting affect the threads I have.
0
 
LVL 86

Expert Comment

by:jkr
ID: 8220589
Yikes, I meant from /MD to /MT of course...
0
 
LVL 23

Author Comment

by:naveenkohli
ID: 8220627
Infact thats the first thing I did.. that did not help either.
0
 
LVL 23

Author Comment

by:naveenkohli
ID: 8220889
My bad... I have one DLL which was using dynamically linking to CRT. After recompiling that DLL with static linking, everything worked ok with static linking.

thanks....
0
 
LVL 86

Expert Comment

by:jkr
ID: 8222201
Thanx :o)

You are welcome...
0
 
LVL 23

Author Comment

by:naveenkohli
ID: 8225580
jkr,
Now the app has become pretty unstable. The static linkin has introdcued the trouble with memory allocation and freeing with STL containers. I am getting crashes in new/delete operators all over the place. All projects are using /MT link switch now. Is there anything that needs to be done for STL containers. A lot of APIs reutrn list objects.
0
 
LVL 86

Expert Comment

by:jkr
ID: 8225634
>>The static linkin has introdcued the trouble with memory allocation and freeing with STL containers

Are you passing memory over module boudaries (i.e. allocating in one DLL and freeing in another)?
0
 
LVL 23

Author Comment

by:naveenkohli
ID: 8225753
I am afraid thats what is happening. The app was using Dynamic linking and this was not a problem. Is there is a quick fix to this problem or i have to modify the code so that memory allocation and freeing happens in the same dll boundary. Currently I am working on fixing this boubdary crossing problem but I was looking into something quick because changing the app is going to take some time.
0
 
LVL 86

Expert Comment

by:jkr
ID: 8227817
Well, the problem is that each module now has is own allocator and heap. An idea would be to supply allocators that take care of this. The 'cleaner' way would be to not allocate/free over module boundaries (apart from that being the 'clean' way anyway :o)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

770 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