Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2006

Tip: Looking for answers? Try searching our database.

ordinal nnnn could not be located in the dynamic link library (my dll)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
yhebib@gmail.com - 08 Jun 2006 00:08 GMT
Hello All,

I've been browsing and reading all articles I could find on technet
,msdn and other knowledgeable sources to understand the issue I'm
dealing with.
However, I did not find so far how to fix that.
Investigations are still under progress and I hope you'll be able to
give hints or feedback that will drive me to the solution.

The applications I'm working on until the next release that will soon
go GA did not include any Windows platforms; just AIX and Solaris. For
this new release we've added XP and RedHat Linux.
All the GUI front-ends originally based on native Xview were ported to
Qt. That helped a lot in supporting Windows platforms.
These new applications version do not use any shared libraries, just
static libraries. That works fine for all platforms including Windows.

But now, we're in the process of changing that and migrating all our
static libraries to shared libraries for Unix and Windows platforms.
I have to confess that under Unix platforms it's just the matter of
recompiling the libraries to shared libs and recompiling the binaries
to use these shared libs.

Under windows XP with Visual Studio .Net 2003 I have the following
issue :
All the dlls use implicit export (about 200 dlls for 20 binaries).
For each library, we generate a .def file through "dumpbin" utility on
the .o files which is then parsed to obtain a well-formatted .def file
with ordinal numbers and function names.
Then we build the export libraries through "lib" utility using the .def
file we've generated above.
Then the dlls are built and the binaries linked.
So far, so good, the application starts normally. (we then have static
initialization order fiasco for our TLS variables but this is a
different story)
Then, I change one of the libs, the JB.lib library, I put a trace in
one of the functions - no new interfaces or change in any interfaces -
and the JB.dll gets built again.
Now if I start the same application I have a "ordinal nnnn could not be
located in the dynamic link library JB.dll"
This ordinal nnnn is in a range that has nothing to do with exports in
JB.dll (exports for JB.dll go from, ordinal 1 to 1520)
Dependency walker show me indeed a lot of unresolved symbols for the
application and all the dlls that depend on JB.dll.
All these unresolved symbols have ordinals far behind exports in
JB.dll.
I have tried to rebase all the dlls without any success.
Now, If I relink all JB.dll dependent dlls and the application, then
the application starts normally again.

As you can imagine, that's not acceptable since very heavy for our
development environment to relink all dependent dlls and applications
even when no interface has evolved.
We will, in a second phase, implement explicit export in all our shared
libraries. This implies a lot of changes in our 200 libraries. We will
code a batch that will do all these changes.
But for now we have strict deadlines and need to get the implicit
export version running.
Anyway, we may face the same issue even with the the explicit version.

Any hint or advice that you may have will be more than welcomed.

Cheers,

Yahia Hebib
yhebib@gmail.com
Bob Milton - 08 Jun 2006 04:12 GMT
Yahia,
   Do you by chance regenerate the .def files when changing a library? If
so, you almost certainly have to rebuild every user of that library (since
the ordinal numbers tend to change with automated .def file generation).
   Bob

> Hello All,
>
[quoted text clipped - 62 lines]
> Yahia Hebib
> yhebib@gmail.com
yhebib@gmail.com - 08 Jun 2006 10:52 GMT
Bob,
Yes the .def files get regenerated.
However, they are exactly the same, confirmed with diff.
Therefore, I expect the libraries we generate with "lib -nologo
-out:JB.lib -def:JB.def" to be exactly the same as well.
YH
yhebib@gmail.com - 08 Jun 2006 10:52 GMT
Bob,
Yes the .def files get regenerated.
However, they are exactly the same, confirmed with diff.
Therefore, I expect the libraries we generate with "lib -nologo
-out:JB.lib -def:JB.def" to be exactly the same as well.
YH
yhebib@gmail.com - 08 Jun 2006 19:09 GMT
I figured out the .def files were the same BUT, the symbols files
generated with "dumpbin" utility : dumpbin -symbols -out:... Xobjects
... were not the same.
The section corresponding to the Dump of the file I have modifed, and
this section only, was quite different, in particular the header
locations were not the same.

I have relinked all the dlls and the binary to make sure they all refer
to the same up to date .lib and now everything goes smoothly. Changes
in a source of one of the dlls does not produce strange "ordinal could
not be located" messages at runtime.

Watch out your development environment !

Thanx,

YH

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.