Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1998-07-30
3
Medium Priority
?
322 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
[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
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 200 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

719 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