Board index » cppbuilder » TLIB and dashes in filenames

TLIB and dashes in filenames


2004-04-20 06:24:59 PM
cppbuilder78
Hi
I just posted this question on cppbuilder.ide, but I think it's better to
post it here:
I discovered that if a filename contains dashes, it's interpreted by TLIB as
the "-" command.
Example: I wish to add the object file called "a-b.obj" to the library
mylib.lib:
tlib mylib.lib +a-b.obj
This is interpreted by TLIB as: Add a, remove b.
I've tried with quotes around the filenames but with the same result. Is
there another work-around for this?
/Ren?Bųje Nielsen
 
 

Re:TLIB and dashes in filenames

Ren?Bųje Nielsen wrote:
Quote
I discovered that if a filename contains dashes, it's interpreted by TLIB as
the "-" command.

Example: I wish to add the object file called "a-b.obj" to the library
mylib.lib:

I've tried with quotes around the filenames but with the same result. Is
there another work-around for this?
ren a-b.obj a_b.obj
tlib mylib.lib +a_b.obj
ren a_b.obj a-b.obj
Or just rename all your source files so you don't have this problem
again. Underlines are ok in names, but many other items can confuse
things. Stick to letters and numbers and underlines, no spaces.
 

Re:TLIB and dashes in filenames

That was the answer I expected, but was afraid to hear, but also what I
already resorted to.
The problem is the next time I get an update from the vendor (it's 3rd party
software), then I'll have to do it all again (unless I do the smart renaming
within the makefile).
Anyway, thanks, Bob, for your answer.
/Ren?
"Bob Gonder" < XXXX@XXXXX.COM >wrote in message
Quote
Ren?Bųje Nielsen wrote:

>I discovered that if a filename contains dashes, it's interpreted by TLIB
as
>the "-" command.
>
>Example: I wish to add the object file called "a-b.obj" to the library
>mylib.lib:
>
>I've tried with quotes around the filenames but with the same result. Is
>there another work-around for this?

ren a-b.obj a_b.obj
tlib mylib.lib +a_b.obj
ren a_b.obj a-b.obj

Or just rename all your source files so you don't have this problem
again. Underlines are ok in names, but many other items can confuse
things. Stick to letters and numbers and underlines, no spaces.


 

{smallsort}

Re:TLIB and dashes in filenames

FYI:
Because the characters for a dash, plus, slash, backslash, quote,
vertical bar, greater than and less than are commonly used either as
command line option identifiers or parse points with specific meaning
on a command line it is common practice to not use them in file names.
Many people often don't even think about it and whatever they got away
with on their machine they take to be inherently correct.
You might mention the problem with dashes in the name to your vendor
before he decides to get really fancy and starts sending you files
with names such as:
+fi>l<e|n-a/m\e.o"bj
Other than a couple of Linux kiddies who, as a consequence of being
freshmen, immortal and all-knowing while not yet old enough to vote or
drink, I've not found any vendor who wouldn't be sympathetic to such a
problem. He surely wishes he could solve all of his customers'
problems so easily! <g>
. Ed
Quote
Ren?Bųje Nielsen wrote in message
news:40857fec$ XXXX@XXXXX.COM ...
 

Re:TLIB and dashes in filenames

Ren?Bųje Nielsen escreveu:
Quote
That was the answer I expected, but was afraid to hear, but also what I
already resorted to.
The problem is the next time I get an update from the vendor (it's 3rd party
software), then I'll have to do it all again (unless I do the smart renaming
within the makefile).
You can try the 'smart renaming within the makefile' with macro
substitutions:
OBJ = a-b.obj
mylib.lib:
tlib mylib.lib +$(OBJ:-=_)
D:\MyProjects>make -n -f tlib.mak
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
tlib mylib.lib +a_b.obj
HTH
Cesar Rabak
 

Re:TLIB and dashes in filenames

The next questions, that come to my mind are:
How come it works with dashes in filenames within the IDE? Doesn't the
IDE use the same TLIB? Or is the IDE renaming the obj-files as proposed
by Bob Gonder and Cesar Rabak before passing them on to TLIB?
And why isn't the generated makefile an exact copy of what goes on within
the IDE?
And why does the IDE's makefile-generator generate illegal makefile
code (this has nothing to do with our current discussion, but if you
try to store final output in a directory different from the current,
an "-l<output_dir>" option will be generated in the LFLAGS make-
variable, which in turn is passed to TLIB, which doesn't recognize this
option).
/Ren?
"Ed Mulroy [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
FYI:

Because the characters for a dash, plus, slash, backslash, quote,
vertical bar, greater than and less than are commonly used either as
command line option identifiers or parse points with specific meaning
on a command line it is common practice to not use them in file names.

Many people often don't even think about it and whatever they got away
with on their machine they take to be inherently correct.

You might mention the problem with dashes in the name to your vendor
before he decides to get really fancy and starts sending you files
with names such as:
+fi>l<e|n-a/m\e.o"bj

Other than a couple of Linux kiddies who, as a consequence of being
freshmen, immortal and all-knowing while not yet old enough to vote or
drink, I've not found any vendor who wouldn't be sympathetic to such a
problem. He surely wishes he could solve all of his customers'
problems so easily! <g>

. Ed

>Ren?Bųje Nielsen wrote in message
>news:40857fec$ XXXX@XXXXX.COM ...


 

Re:TLIB and dashes in filenames

The IDE uses DLL versions of the compiler, linker and I think of the
librarian. As they do not interface to the tools with the command
line they are not going to be effected by the rules for command lines
and what the command interpreter does.
Quote
And why does the IDE's makefile-generator...
I do not know what compiler or version of the compiler you are using.
I use BCB 6 and it does not have an IDE based makefile generator. It
does have a Bpr2Mak.exe tool to create a make file from a project
file. The contents in the result are as the IDE would internally use.
It does a fair job but is not perfect. If there is a wrinkle in the
text that bothers you then alter the contents to taste.
. Ed
Quote
Ren?Bųje Nielsen wrote in message
news:40861945$ XXXX@XXXXX.COM ...

The next questions, that come to my mind are:

How come it works with dashes in filenames within the
IDE? Doesn't the IDE use the same TLIB? Or is the IDE
renaming the obj-files as proposed by Bob Gonder and
Cesar Rabak before passing them on to TLIB? And why
isn't the generated makefile an exact copy of what goes
on within the IDE?

And why does the IDE's makefile-generator generate illegal
makefile code ...