Solved

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

Posted on 1998-07-30
3
315 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

9 Experts available now in Live!

Get 1:1 Help Now