[comp.os.msdos.programmer] How do you command-line compile in TC++?

ong@d.cs.okstate.edu (ONG ENG TENG) (01/29/91)

I am attempting to use the command-line compile in TC++.  I went thru 
the manuals twice, tried all kinds of options (including -I and
-L), but still I get "undefined symbols" during link time for 
instructions like "setcolor", "kbhit", etc.  If I compile it
inside the IDE, it works fine.  What am I doing wrong?

Thanks in advance.

E. Teng Ong (ong@d.cs.okstate.edu) 

rdw2030@venus.tamu.edu (01/29/91)

In article <1991Jan28.214552.25542@d.cs.okstate.edu>, ong@d.cs.okstate.edu (ONG ENG TENG) writes...
>I am attempting to use the command-line compile in TC++.  I went thru 
>the manuals twice, tried all kinds of options (including -I and
>-L), but still I get "undefined symbols" during link time for 
>instructions like "setcolor", "kbhit", etc.  If I compile it
>inside the IDE, it works fine.  What am I doing wrong?
> 
>Thanks in advance.
> 
>E. Teng Ong (ong@d.cs.okstate.edu) 

Well, the only thing I can figure is that when you use the -I and -L options,
you may not be including the entire path to the appropriate directories.

If you want to be REALLY sure you get them right, you need to enter the
whole thing.  I usually use the IDE, but do experiment with TCC sometimes.
I enter:

           tcc -Id:\lang\tc\include -Ld:\lang\tc\lib foo.c

Now you know why MAKE is so nice!

Another problem you could be having is not linking in the right libraries
when you link.  If you are using the small model, you need some crap like

           link foo.obj+d:\lang\tc\lib\c0s.lib+d:\lang\tc\lib\graphics.lib /
                       +d:\lang\tc\lib\cs.obj

and so on and so forth.  I noticed you mentioned setcolor.  Make sure you
link in the graphics library!  

I told you all this from memory, so there are holes.  But experiment, and by
all means KEEP LOOKING AT THE MANUALS.  Even with the manuals, it takes time
to fully understand it all!

Me... I just use the IDE!  :-)

Mark C. "Bro!" Lowe - KB5III

PS- And by all means... LEARN HOW TO USE MAKE!!  It's a MUST so you don't have
    keep typing all those LONG lines!

psfales@cbnewsc.att.com (Peter Fales) (01/29/91)

In article <11577@helios.TAMU.EDU>, rdw2030@venus.tamu.edu writes:
> In article <1991Jan28.214552.25542@d.cs.okstate.edu>, ong@d.cs.okstate.edu (ONG ENG TENG) writes...
> >I am attempting to use the command-line compile in TC++.  I went thru 
> >the manuals twice, tried all kinds of options (including -I and
> >-L), but still I get "undefined symbols" during link time for 
> >instructions like "setcolor", "kbhit", etc.  If I compile it
> >inside the IDE, it works fine.  What am I doing wrong?

> If you want to be REALLY sure you get them right, you need to enter the
> whole thing.  I usually use the IDE, but do experiment with TCC sometimes.
> I enter:
> 
>            tcc -Id:\lang\tc\include -Ld:\lang\tc\lib foo.c
> 
> Now you know why MAKE is so nice!

Don't forget you can put those options in your TURBOC.CFG file. (It
goes in the directory where TCC.EXE is located).  Saves a lot
of typing, even if you are using make!

-- 
Peter Fales			AT&T, Room 5B-420
N9IYJ            		2000 N. Naperville Rd.
UUCP:	...att!ihlpb!psfales	Naperville, IL 60566
Domain: psfales@ihlpb.att.com	work:	(708) 979-8031

lwb@pensoft.UUCP (Lance Bledsoe) (01/29/91)

In article <1991Jan28.214552.25542@d.cs.okstate.edu> ong@d.cs.okstate.edu (ONG ENG TENG) writes:
>I am attempting to use the command-line compile in TC++.  I went thru 
>the manuals twice, tried all kinds of options (including -I and
>-L), but still I get "undefined symbols" during link time for 
>instructions like "setcolor", "kbhit", etc.  If I compile it
>inside the IDE, it works fine.  What am I doing wrong?

Here is part of a makefile that I use:

LIBS=   tct_t2s.lib
COMP=   -v -y -C -f- -c -w -Ic:\tcp\tct\include
LINK=   -lv -lc -ld -M -Lc:\tcp\tct\lib

win.exe : video.obj window.obj win.obj
        tcc $(LINK) win.obj video.obj window.obj $(LIBS)

video.obj : video.cpp video.hpp ascii.hpp
        tcc $(COMP) video.cpp

win.obj : win.cpp video.hpp window.hpp ascii.hpp
        tcc $(COMP) win.cpp

window.obj : window.cpp video.hpp window.hpp ascii.hpp
        tcc $(COMP) window.cpp

-- 
Lance Bledsoe                       Off:    (512) 343-1111                 
Pencom Software, Inc.               Fax     (512) 343-9650                 
8716 Loop 360 N. Suite 300          UUCP:   cs.utexas.edu!pensoft!lwb      
Austin, Texas  78759                UUNET:  uunet!uudell!pensoft!lwb       

jjohnson@peyote.cactus.org (Jeff Johnson) (01/31/91)

I almost always use the command line version, tcc.  I prefer PC/VI and
makefiles to some stupid IDE.  All you need to do is run tcinst and set
up the paths.  I have never had a problem at all.  You guys are making
this harder than it needs to be.

-- 
Jeff Johnson		10926 Jollyville #1420, Austin, TX 78759
Computer Consultant	(512) 343-0675		(512) 750-UNIX
jjohnson@peyote.cactus.org	{uunet|uiucuxc}!cs.utexas.edu!peyote!jjohnson