Solved

Why LINK.EXE does not generate proper lib & exp files?

Posted on 1998-07-30
3
316 Views
Last Modified: 2013-11-19
My platform is MSVC++ and have a frontend. One of our DLL (backend) is created in Borland C++. We asked the programmers to give the library file of the DLL so that we can link with our front end. But during linking we get an error 'aaa.lib - file is invalid or corrupted.'. So I decided to create the lib file from the Dll by using LIB application which came with MSVC++. The command I used is LIB /DEF:AAA.DLL. It created a lib file and an exp file. But it does not have any information. I mean exported functions. So while linking the frontend application is giving unresolved externals. How can I create a lib/exp file so that it does have all exported functions? Am I missing any command line parameter here? Mine is a 32 bit system.
0
Comment
Question by:chacko
3 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1319936
Borland and Microsoft linkers generate different lib files. The problem is name mangling that is different for these linkers. If you want to use borland DLL with MFC EXE you can only export global functions and variable declaring then as extern "C" to avoid name mangling.
0
 
LVL 1

Author Comment

by:chacko
ID: 1319937
Galkin,

Thanx for the answer. But I was expecting something more than that. All the functions are in C only. But I was not not able to create the import library file. I solved the problem this way. I created a module definition file with all the functions I wanted to import. Then I used command LIB /DEF:aaa.def which created the import library file. We can get a list of the functions which are exported with the application DUMPBIN /EXPORTS aaa.dll.

with thanks
Varghese
0
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
ID: 1319938
How to Create 32-bit Import Libraries Without .OBJs or Source
http://support.microsoft.com/support/kb/articles/q131/3/13.asp 

And Implib32 makes it easier.

Implib32
http://www.geocities.com/SiliconValley/5806/

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now