Solved

Ordinal Not Found in MFC DLL.

Posted on 2000-03-20
13
786 Views
Last Modified: 2013-11-20
I am trying to port a VC++ 5.0 project to VC++ 6.0. The build went through fine (after VC++ informed me that the .dsp file is being converted). But when I try to run it, I get a message:

"Ordinal Not Found

The ordinal 977 could not be located in the dynamic link library MFCD42D.DLL."


This happens in Debug build only; the release build works fine.

I have read a PAQ which addresses a similar problem. There, the answer said that when using VC++6.0, you must distribute MFC42.DLL, OR statically link MFC through project settings. I can understand this in a situation where a distribution of an executable is involved, where the target computer may have a different environment.

What I cannot understand is, when I rebuild the whole project from scratch (after CLEAN, I do Rebuild ALL) in VC++6.0, why does this problem still arise? As far as I can see, there should be only one version of MFC DLLs lying around on my computer, so my situation does not seem to be addressed by the PAQ.

What am I doing wrong? When I port a project from VC++5.0 to VC++6.0, what should I be doing? What I actually did is like this:

a. From the project folder, I deleted Debug and Release folders completely.
b. Copied everything remaining to the new machine which has VC++6.0.
c. Opened the .dsw file.
d. Did a Clean, and then rebuild all.

Is something else needed to be done?

thanks,
stochastic
0
Comment
Question by:stochastic
[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
  • 5
  • 3
  • 2
  • +3
13 Comments
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2639354
I suspect it is loading the wrong mfc42d.dll (it is probably linking with the mfc42d.lib from VC6 but loading the mfc42d.dll from vc5) have a look for all the mfc42d.dll on your machine. You should be able to fix it by copying the correct mfc42d.dll into your debug directory.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 2639397
Hi stochastic,

check which MFCD42D.DLL your debug executable uses (with dependency walker, i.e. right click on exe in explorer there should be a menu item 'View Dependencies' ... click on dependency walker's view menu item 'View Full Path' to see locations of DLLs used) and of which version it is.

ZOPPO
0
 
LVL 8

Author Comment

by:stochastic
ID: 2639436
ShaunWilde,

I'm afraid I had already checked for other mfc42d.dll's on my machine. There was only one, and I confirmed that it was indeed the one which VC6 installed. So this does not seem to be the answer.

I believe that the general convention on EE is not to post 'answers' (instead post them as comments) unless you are totally certain that your answer will work. Very often, even when the answerer is indeed certain, s/he still chooses to post it as a comment. That way, the question remains open, and other people, possibly with a better answer, get a chance. The asker can always convert a comment into an answer.

thanks anyway for your effort.

Zoppo, I am going to follow your suggestion and come back with a response.

- stochastic
0
Industry Leaders: 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 8

Author Comment

by:stochastic
ID: 2639446
Zoppo,

I don't get the 'view dependencies' option in the context menu in my explorer. Is there something I haven't installed?

- stochastic
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 2639476
Hmm, not sure ... try to find 'DEPENDS.EXE' in the MicroSoft Visual Studio directories and start it (should register itself to appear in explorers context menu). On my system it's 'C:\Program Files\MicroSoft Visual Studio\Common\Tools\Depend.exe'
0
 
LVL 32

Expert Comment

by:jhance
ID: 2639477
>I believe that the general convention on EE is not to post 'answers'

No that's not the general convention.

There are too many expert "wannabes" running around and copying real expert comments and then posting that as their own "answer".  Many question askers don't recognize this tactic and award them the credit. So they are accumulating expert points using other experts comments as their own answers.

Anyway, I'd encourage you to revisit ShaunWilde's answer.  He's right.  One or more of the DLLs or link library (.lib) files on your system is out of date.  

Have you installed the VC++ 6 service pack 3?
0
 
LVL 8

Author Comment

by:stochastic
ID: 2639523
Zoppo,

Thanks, I found depends.exe as part of Visual Studio's tools. I am now working on your suggestion.

jhance,
I could see the potential merit in ShaunWilde's answer. However, I did say earlier that I had only one version each of the concerned .libs and .dlls, and those are the ones which VC++ 6.0 put them.

I am checking on the service pack. Will be back soon.

- stochastic
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2639984
could be that the lib file you linked with doesn't correspond.
0
 
LVL 23

Expert Comment

by:chensu
ID: 2642141
ShaunWilde was right.

PRB: MFC Debug DLLs Are Not Compatible Between Versions
http://support.microsoft.com/support/kb/articles/Q190/4/87.ASP
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2643675
Sorry you didn't like my answer - however whenever I have had this (or come across this) problem in the past this has always been the solution. If of course it isn't correct you have every right to reject it.
0
 
LVL 8

Author Comment

by:stochastic
ID: 2643909
ShaunWilde (and others),

I am genuinely hoping that your answer does turn out to be right. Many other experts seem to be supporting it, and also some kb articles I saw on MSDN (including the one chensu suggested). I will be happy to accept your answer as correct answer once I fix my problem.

The present situation is:
I installed VC++6.0 SP3, and it has still not solved my problem! The exact same problem persists. I have checked the versions of concerned .lib and .dll files. I have also checked that my computer contains only one occurence of each file, and that seems to be correct - the VC6 SP3 version.

I have also checked through dependencies like Zoppo suggested. All versions seem to be right. But obviously something still _is_ wrong.

I am going to clean up my project folder completely, and create the project up from scratch, and add the source files to it. That should fix it, I guess. I wonder whether the CLEAN command omits cleaning something that causes this. Such as, say, .pch files?

Anyway, I will come back with more status updates soon, hopefully reporting that the problem is gone. I would only be too happy to award you the points.

I rejected your answer not because it might be wrong, but because it was presuming that the problem was solved, which wasn't true at that point. I wanted to get the benefit of others' answers too. Hope you understand.

To everyone: thanks folks. Regardless of whether the suggested remedies work or not, there is always education in your comments.

- stochastic
0
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 100 total points
ID: 2643988
Hi I've just lookied at my version of mfc42d.dll (6.00.8447.0) and it does have ordinal 977 - though I can't remember how to work out what function it relates to.
0
 
LVL 8

Author Comment

by:stochastic
ID: 2663015
ShaunWilde,

I think your answer was right after all. Although my problem is _still_ not fully solved, I could trace it to this: in my project I was using third party code, which had been already built into .libs, with VC++5.0, and therefore the problem continued despite my initial attempts. I have rebuilt those third party pieces again in VC++ 6.0, and things are progressing. I think I will get it working fully soon.

Happy to grant you the points.

I must say thanks to everyone else who, while echoing your solution, added further useful information.

- stochastic
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 209
Complete beginner needs help making a cron job 9 131
maxBlock challenge 30 146
isEverywhere  challenge 19 86
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.

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