Solved

No Links to Libs

Posted on 1998-06-23
4
168 Views
Last Modified: 2010-04-01
therefore, I do the following:
tlink abc.obj 123.obj
123 calls other standard C routines and
there is no links to the library functions.
If I have to do a lengthy typing of all the libraries' names on the command line (e.g. tlink 1.obj 2.obj ..... xxx.lib)
It would be tedious and error-prone. How can I link all the libraries without typing the long DOS command?

0
Comment
Question by:whluk
  • 3
4 Comments
 

Author Comment

by:whluk
ID: 1166505
I lost one line of the above question?

The first line should say
'I got an assembly program which calls the C routine'

Sorry if you are confused.

0
 
LVL 22

Accepted Solution

by:
nietod earned 20 total points
ID: 1166506
answer coming.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1166507
For your sanity I would suggest a different approach.  Write an "empty" C++ program whose main() calls your assembly procedure and then that calls back to the C when needed.  This will proably make linking easier, but the real reason I suggest that is that if your program calls C++ code, then the program needs (potentialy) to do some initialization.  The C++ run-time libary needs to be initialized.  If not some of its procedures will fail (you may or may not be using these, but why take the chance.)  Also if your C++ procedure has any static variables or accesses global variables, these need to be initialized.  You can potentially do these initializations from assembly, but it is a lot easier to let C++ do it for you.

Does that sound like a better approach?
0
 
LVL 22

Expert Comment

by:nietod
ID: 1166508
By the way.  If you want to go with your original approach.  The easiest way is to use a batch file.  But the more typical way is to use a make file.
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

Suggested Solutions

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

937 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

10 Experts available now in Live!

Get 1:1 Help Now