TCL2C && MS VC++ && TCL8.0.3plus 
Author Message
 TCL2C && MS VC++ && TCL8.0.3plus

Hi,
  I have downloaded recently the tcl8.0.3plus at   http://www.*-*-*.com/ ~nijtmans/
and have tried to create a standalone application of the hello.
  From past posting i search at dejanews, I have
  1. tcl2c -o hello.c hello.tcl -tk -a (have also tried tcl2c -o hello.c -tk -tcl -a)
  2. added the following for linking: oldnames.lib, msvcrt.lib, libc.lib, tcl80s.lib, and tk80s.lib
     Are tcl80s.lib tk80s.lib the static libraries? I could not find the tcl80sa.lib and tk80sa.lib
     in the distribution.
  3. checked the "Ignore all default libraries" in the VC++ linking option

I have the following errors.

Quote:
> Compiling...
> hello.c
> C:\Program Files\Tcl\hello\hello.c(64) : warning C4273: 'Tcl_InitStandAlone' : inconsistent dll linkage.  dllexport assumed.
> Linking...
> LINK : warning LNK4049: locally defined symbol "_Tcl_GetStringResult" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_Write" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_GetVar" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_AddObjErrorInfo" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_DStringFree" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_Eval" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_DStringAppend" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_DStringSetLength" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_DStringInit" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_GetStdChannel" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_StaticPackage" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_Free" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_SetVar" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_Merge" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_CreateInterp" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_FindExecutable" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_SetPanicProc" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_CreateExitHandler" imported
> LINK : warning LNK4049: locally defined symbol "_Tcl_Alloc" imported
> msvcrt.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
> Debug/hello.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.
> hello.exe - 2 error(s), 20 warning(s)  

Please help.
Thanks


Mon, 07 May 2001 03:00:00 GMT  
 TCL2C && MS VC++ && TCL8.0.3plus

Quote:

>Hi,
>  I have downloaded recently the tcl8.0.3plus at  http://home.wxs.nl/~nijtmans/
>and have tried to create a standalone application of the hello.
>  From past posting i search at dejanews, I have
>  1. tcl2c -o hello.c hello.tcl -tk -a (have also tried tcl2c -o hello.c -tk -tcl -a)
>  2. added the following for linking: oldnames.lib, msvcrt.lib, libc.lib, tcl80s.lib, and tk80s.lib
>     Are tcl80s.lib tk80s.lib the static libraries? I could not find the tcl80sa.lib and tk80sa.lib
>     in the distribution.
>  3. checked the "Ignore all default libraries" in the VC++ linking option

>I have the following errors.

Take a look in tk8.0.3/win/makefile.vc (rename this to makefile).
Search for 'hello', the target has been set up already in the latest
of Jan's source distributions.  'nmake hello' should build the hello.exe
file for you.
Quote:
>Please help.
>Thanks



Mon, 07 May 2001 03:00:00 GMT  
 TCL2C && MS VC++ && TCL8.0.3plus

Quote:

>   2. added the following for linking: oldnames.lib, msvcrt.lib, libc.lib, tcl80s.lib, and tk80s.lib
>      Are tcl80s.lib tk80s.lib the static libraries? I could not find the tcl80sa.lib and tk80sa.lib
>      in the distribution.

At least libc.lib shouldn't be there. But you are missing
many others, such as kernel32.lib.

Quote:
>   3. checked the "Ignore all default libraries" in the VC++ linking option

Why? I don't see the reason to do that. If you start with configuring a win32
appliation, most libs that you need are already in the project.

Quote:
> > C:\Program Files\Tcl\hello\hello.c(64) : warning C4273: 'Tcl_InitStandAlone' : inconsistent dll linkage.  dllexport assumed.
> > Linking...
> > LINK : warning LNK4049: locally defined symbol "_Tcl_GetStringResult" imported

You should define the symbol STATIC_BUILD. Otherwise the header files
are assuming that you are building a dll.

Quote:
> > msvcrt.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main

You apparently set up a project for a 'console appliation', but you need to
set up a 'win32 application'.

The best you can do is just make your project a wrapper around your
own "makefile.vc". Then you have full control about what compiler
and linker options you use and what libs are included. The best
example is the "hello.exe" target in the makefile.vc as distributed
with the plus-patches.

Hope this helps (I never said it was easy.......)
--
Jan Nijtmans, CMG Arnhem B.V.


url:   http://home.wxs.nl/~nijtmans/



Tue, 08 May 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ABC Templates @#$%^&*&&*&*!!!!!!

2. Compatibility of MS Fortran & MS VC 6.0

3. Cybersex--(*&$%*&(*&^% C programmers

4. MS Fortan Powerstation & VC++4.2b Installation

5. hpux && snapshot && ./configure

6. tcl2c & Tk_CreateMainWindow

7. Translating &

8. *&$%*&%$ OBDC!!!

9. I am frustrated (*%^&^*&##

10. DataFlex & Q&A Conversion to Topspeed

11. Data Corruption in Clipper & Windows 2000

12. Clipper & R&R for Windows

 

 
Powered by phpBB® Forum Software