Solved

No Links to Libs

Posted on 1998-06-23
4
167 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

708 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