Code generated with makefile not the same as code generated with IDE

Code generated with makefile not the same as code generated with IDE

Post by RenBe Niel » Wed, 21 Apr 2004 00:13:51


Hi,

I have a project (BCB v. 6 update 4) that I would like to compile on the
command-line rather than using the IDE. Therefore I exported a Makefile, and
tried to

$(BCB)/make -f mylib.mak

The resulting .LIB file is afterwards statically linked into another project
(resulting in myproj.dll).

This two-step process works fine from the IDE, but not from the command
line: The linker (generating myproj.dll) produces several "Error: Unresolved
external '_my_func'" error messages. The unresolved externals all stem from
the same source file.

Doing a TDUMP (and a grep) on both libraries yield:

426E01 PUBDEF '_my_func' Segment: _TEXT:0043

on the library build with the IDE and

31CE50 EXTDEF 1 : '_my_func' Type: 0

with the one build from the command line.

So it looks as if the function is not made public for some reason. Any clue?

Is there any way to see the exact command line executed by the IDE when
compiling (which I suspect is different from the command line executed when
doing a make from the command line, since it doesn't work)?

/RenBe Nielsen

P.S. The LIB-makefile's flag section contains the following:

# --------------------------------------------------------------------------
-
CFLAG1 = -Od -Hc -Vx -Ve -X- -r- -a8 \
-b- -k -y -v -vi- -c -tW -tWM
IDLCFLAGS =
PFLAGS = -N2..\obj\bcb -N0..\obj\bcb -$YD -$W -$O- -$A8 -v -JPHNE -M
RFLAGS =
AFLAGS = /mx /w2 /zd
LFLAGS = -l..\obj\bcb /P128 /C
# --------------------------------------------------------------------------
-
 
 
 

Code generated with makefile not the same as code generated with IDE

Post by RenBe Niel » Wed, 21 Apr 2004 19:20:10

I think I got it:

The problem is that some of the object filenames contain dashes ("-"). When
invoking TLIB, the dashes constituting the filenames are interpreted as the
"-" TLIB command, that is: delete the object from the library.

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



and> > tried to> >> > $(BCB)/make -f mylib.mak> >> > The resulting .LIB file is afterwards statically linked into another
project> > (resulting in myproj.dll).> >> > This two-step process works fine from the IDE, but not from the command> > line: The linker (generating myproj.dll) produces several "Error:
Unresolved> > external '_my_func'" error messages. The unresolved externals all stem
from> > the same source file.> >> > Doing a TDUMP (and a grep) on both libraries yield:> >> > 426E01 PUBDEF '_my_func' Segment: _TEXT:0043> >> > on the library build with the IDE and> >> > 31CE50 EXTDEF 1 : '_my_func' Type: 0> >> > with the one build from the command line.> >> > So it looks as if the function is not made public for some reason. Any
clue?> >> > Is there any way to see the exact command line executed by the IDE when> > compiling (which I suspect is different from the command line executed
when> > doing a make from the command line, since it doesn't work)?> >> > /RenBe Nielse>
> P.S. The LIB-makefile's flag section contains the following>
>
# ------------------------------------------------------------------------->
> >
> CFLAG1 = -Od -Hc -Vx -Ve -X- -r- -a8 >
> -b- -k -y -v -vi- -c -tW -tW>
> IDLCFLAGS >
> PFLAGS = -N2..\obj\bcb -N0..\obj\bcb -$YD -$W -$O- -$A8 -v -JPHNE ->
> RFLAGS >
> AFLAGS = /mx /w2 /z>
> LFLAGS = -l..\obj\bcb /P128 />
>
# ------------------------------------------------------------------------->
> >
>