Compiling and linking, 4ć12 – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual
Page 39

Chapter 4
Programming Overview
4-12
Names of global variables in our libraries begin with g_. In addition, the
libraries contain a number of undocumented internal global variables
whose names begin with _q.
In summary, you can create conflicts with names in our libraries by naming
functions and extern variables beginning with g_, _q, io_, or IO_. To be
safe, stay away from those names and from the names of functions
documented in this manual.
These notes present a simple way of compiling and linking your
application program with the scanner code. This way may or may not be
the best way for your development. There are many alternatives –
Borland’s Integrated Development Environment, make files and project
files, and so on. You should evaluate the alternatives and decide which
way is most productive for you.
Decide which memory model you will use (small, compact, medium, large,
or huge). Please see the discussion of memory models in your compiler
manual. In the command below, replace %%%% with the first letter of the
memory model, in lower case.
Use this command to compile and link your program in one step:
BCC –N –K –w –m%%%% –lcd yourprogname.c 6008si%%%%b.lib
Important: –lcd upper/lower case is significant in public names; diagnose
duplicate names in libraries.
The options we recommend are listed in Table 4.C.
Table 4.C
Options for Compile and Link
Options:
Description:
-N
stack checking turned on
-K
default 'char' is 'unsigned char'
-w
show warnings at compile time
-m
select memory model
-O
turn off optimization
-d
set up for debugging
-v
link with debugging information
We recommend against the –a option (align structure members by word).
Our library routines were compiled without it, and may not be compatible
with code you compile with that option.
Compiling and Linking the
Borland C++ 2.0 Version