?
Solved

No Links to Libs

Posted on 1998-06-23
4
Medium Priority
?
176 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
[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
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 40 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

752 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