Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-09-13
17:57 • Closed ticket [1031781fff]: Problems building on Windows 2k with VS.NET plus... artifact: 972cbc51bb user: patthoyts
13:42 • Ticket [1031781fff]: 4 changes artifact: d52f6b3f01 user: saurabh_b
2005-05-31
09:25 • Ticket [1031781fff]: 1 change artifact: e46e4b9ccb user: hobbs
2004-09-24
04:11 • Ticket [1031781fff]: 5 changes artifact: 0544f81b92 user: davygrvy
03:53 • Ticket [1031781fff]: 5 changes artifact: 3c67775569 user: davygrvy
03:34 • Ticket [1031781fff]: 1 change artifact: 9da961412d user: mdejong
2004-09-21
19:56 • Ticket [1031781fff]: 4 changes artifact: 4267193cdc user: nobody
09:50 • New ticket [1031781fff]. artifact: 979dcbb375 user: nobody

Problems building on Windows 2k with VS.NET

Closed1031781fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 21 years ago
Descriptionplain2004-09-21 09:50:47
I opened the tcl.dsw file, doing the conversion required, 
and built the static release. It built fine, but I could not 
link to it - when compiling my app_init.c file (pinched 
from the one for tclsh) the linker reported missing 
symbols. The usual cause of this problem is that the 
library cannot be found by the linker, but that is 
definitely not the case here.

I had seen this problem when building zlib once, and the 
answer then was to create a brand new fresh project 
from scratch, making sure I included all the correct 
source files and did the settings. After some effort I got 
that to build, only to find exactly the same problem.

I had changed the settings to compile as C code, so I 
figured that the way I was compiling my program (which 
is the same mechanism as we use to build our product, 
and cannot be changed) was using C++ name mangling, 
and thus the linker was having problems as the symbols 
in the library were mangled in the C style.

When I changed my project settings to compile the Tcl 
static library as C++ code, it failed to build quite 
horrendously, and for a quite obvious reason:

int
TclpGetTimeZone (currentTime)
    unsigned long  currentTime;
{


Hmm - what an antiquated function declaration style. I 
haven't seen that used since I was at University around 
1995 or so. I am sure you have your reasons for 
declaring functions like this rather than like:

int
TclpGetTimeZone (unsigned long  currentTime)
{

However this is stopping me from compiling Tcl. Have 
you any ideas how I can set myself up so I can build the 
Tcl static library for Windows using VS.NET?

I suspect that for ease of development in the future I 
will need to integrate the Tcl source code into our build 
system. I am not sure it will be possible at the moment.

I will be eternally grateful for any help you can give me.

Alastair Growcott
[email protected]
nobodyplain2004-09-21 19:56:23
Logged In: NO 

It turns out that I need to define BUILD_STATIC when 
compiling source code that links to the static library.

Ugh!

This is because tcl.h interprets the BUILD_STATIC symbol to 
define EXTERN for DLL linking. Lots of other libraries can be 
built as either static or DLL/Dynamic without applications that 
link to them having to know about it or define any symbols to 
do so. I recommend using them as an example to figure out 
how to do it.

Ideally applications that link to Tcl should specify whether 
they want to statically link or dynamically link by linking to 
either tcl84s.lib or tcl84.lib respectively, and not by defining 
build symbols.

If you want some ideas, email me (email address in previous 
bit of bug report).
mdejong Ticket [1031781fff]: 1 change [History diff]2004-09-24 03:34:26
davygrvyplain2004-09-24 03:53:08
Logged In: YES 
user_id=7549

So where's the bug in this?

If I want a static library, I do this:

C:\tcl_src\win\>nmake -f makefile.vc OPTS=static

If I want a dynamic build with threads, I do this:

C:\tcl_src\win\>nmake -f makefile.vc OPTS=thread

If I want both, I do this:

C:\tcl_src\win\>nmake -f makefile.vc OPTS=thread,static

The Tcl source is C, not C++, so don't force -TP
davygrvyplain2004-09-24 04:11:07
Logged In: YES 
user_id=7549

Just post your code changes ideas here, rather than asking
me to ask you for them.

This topic has zero to do with makefile.vc.. setting new
ownership..
hobbs Ticket [1031781fff]: 1 change [History diff]2005-05-31 09:25:52
saurabh_bplain2005-09-13 13:42:16
Logged In: YES 
user_id=1343680

I am also trying to build TCL 64 bit on AMD64 machine using 
MS VS2005 Beta. I have a basci q'n. Do we have to use 
NMAKE tool?

Hi There,
Today I did some more research and was able to compile 
TCL x64!!!

The issue is in LINK as I get error “CVTRES : fatal error 
CVT1100: duplicate resource. type:VERSION, name:1, 
language:0x0409”. I suppose this is happening because we 
have two .rc files in the project. tclsh.rc and tcl.rc . There 
seems to be a conflict in what resource to use. One is for dll 
and the other for application.

I have a feeling that we need two modules(.dsp’s) for the dll 
and tclsh. Also, there are a couple of helper files like CAT.C 
and STUB16.C, each has a main() and this conflicts with the 
main of tclsh. I had to remove these from the project to 
compile. I guess that is wrong thing to do.

Also, in the MSVS VC6.0 the project loads itself in the 
Makefile mode and builds fine.

Now, I need to know which option is less time consuming and 
repeatable? 

1.Adapt the VC6.0 Makefile.vc to VC8.0 
2.Understand the dependencies of dll and tclsh and 
create new modules for the tcl project.

I am using TCL 8.4.2.

Thanks in advance,
Saurabh

-----Original Message-----
From: [email protected] [mailto:tcl-win-
[email protected]] 
Sent: Friday, September 09, 2005 3:45 PM
To: [email protected]
Cc: [email protected]; 
[email protected]
Subject: RE: [WINTCL] Re:Compiling tcl 8.4.9 with VS.NET 
2005 Beta 2 compiler?

Hi Experts,

The first issue is solved leading to the next!

.\tclWinFile.c(1604) : error C2037: 
left of 'st_size' specifies undefined struct/union '_stati64'

I found _stati_64 defined in <sys/stat.h>.
#define _fstati64   _fstat64

Hence I have included this header(hopefully no duplicate code 
will result!!!) in all the code which was throwing this error.

In tcl-8.4.2\generic\
tclCmdAH.c
tclFCmd.c
tclFileName.c
tclIOUtil.c
tclTest.c

In c:\tcl-8.4.2\win\tclWinFile.c 

Moved #include <sys/stat.h> before all other includes.

Previously, it was 

#include "tclWinInt.h"
#include <winioctl.h> 
#include <sys/stat.h>


Also, NULL was not being able to reference it's definition in 
stdio.h.
Add #include <stdio.h> to regc_nfa.c

Now, I am facing this error regarding old C way of defining 
functions:

..\generic\regerror.c(53) : error C2081: 'preg' : name in formal 
parameter list illegal

..\generic\regerror.c(53) : error C2081: 'errbuf' : name in formal 
parameter list illegal

..\generic\regerror.c(53) : error C2081: 'errbuf_size' : name in 
formal parameter list illegal


- regerror - the interface to error numbers
 */
/* ARGSUSED */
size_t/* actual space 
needed (including NUL) */
regerror(errcode, preg, errbuf, errbuf_size)
int errcode;/* error code, or 
REG_ATOI or REG_ITOA */
CONST regex_t *preg;/* associated 
regex_t (unused at present) */
char *errbuf;/* result buffer 
(unless errbuf_size==0) */
size_t errbuf_size;/* available space in errbuf, 
can be 0 */
{
.....
...
}

I can see #define regerror TclReError in regex.h as:

extern size_t regerror _ANSI_ARGS_((int, __REG_CONST 
regex_t *, char *, size_t));

To me the declaration and usage seems alright! &#61516;

Any clues?

Should I be writing to the TCL developers list?

Saurabh


-----Original Message-----
From: [email protected] [mailto:tcl-win-
[email protected]] On Behalf Of Saurabh 
Bhatnagar
Sent: Tuesday, September 06, 2005 10:56 AM
To: 'David Gravereaux'; [email protected]
Subject: RE: [WINTCL] Re:Compiling tcl 8.4.9 with VS.NET 
2005 Beta 2 compiler?

Okay!
I take this up.
I am less into applications so it may take me some time...

Attached is my build log.

The first issue to handle is this:

.\tclWinFile.c(1604) : error C2037: 
left of 'st_size' specifies undefined struct/union '_stati64'

If anyone is working on this, your comments are welcome!

Saurabh
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of 
David Gravereaux
Sent: Friday, September 02, 2005 12:03 PM
To: [email protected]
Subject: Re: [WINTCL] Re:Compiling tcl 8.4.9 with VS.NET 
2005 Beta 2
compiler?

Saurabh Bhatnagar wrote:
> Hi Jeff,
> Saw your email on VS.NET 2005 Beta 2 compiler.
> 
> I have similar issues.
> 
> I am building TCL 8.4.2 using x64(AMD64) compiler of VS 
2005 Beta.
> 
> Somehow there are too many conflicts with the VS header 
files for trivial
> functions like sprintf etc.
> 
> I wonder weather this version supports 64 bit at all. 
> 
> I am able to build TCL8.4.2 for 32 bit using MSVC++ 6.0 
compiler.
> 
> Can anyone confirm which version of TCL supports x64 
configuration?
> 
> Thanks
> Saurabh
> 


How about fixing it and submitting a patch?


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software 
Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development 
Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & 
Teams * Testing & QA
Security * Process Improvement & Measurement * 
http://www.sqe.com/bsce5sf
_______________________________________________
Tcl-win mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tcl-win
patthoytsplain2005-09-13 17:57:58
Logged In: YES 
user_id=202636

There is a patch #1096916 already submitted to deal with
build issues using MSVC 8.
The way to sort it out is to look and what that patch is
doing for tcl 8.5 and if required bring some of those build
modifications into your 8.4 tree. I would recommend always
arranging to be able to perform the build using NMAKE and
then to setup a Makefile project in Visual Studio. This
works well and avoids having to continually update a .dsp
file and the nmake file and the autoconf files.
Log in (anonymous is fine) to add a comment.