[ tcl-Bugs-1031781 ] Problems building on Windows 2k with VS.NET

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ tcl-Bugs-1031781 ] Problems building on Windows 2k with VS.NET

SourceForge.net
Bugs item #1031781, was opened at 2004-09-21 15:20
Message generated for change (Comment added) made by saurabh_b
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1031781&group_id=10894

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: 51. Configure and Build Tools
Group: obsolete: 8.4.7
Status: Open
Resolution: Invalid
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Pat Thoyts (patthoyts)
Summary: Problems building on Windows 2k with VS.NET

Initial Comment:
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
[hidden email]



----------------------------------------------------------------------

Comment By: Saurabh Bhatnagar (saurabh_b)
Date: 2005-09-13 12:12

Message:
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: [hidden email] [mailto:tcl-win-
[hidden email]]
Sent: Friday, September 09, 2005 3:45 PM
To: [hidden email]
Cc: [hidden email];
[hidden email]
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: [hidden email] [mailto:tcl-win-
[hidden email]] On Behalf Of Saurabh
Bhatnagar
Sent: Tuesday, September 06, 2005 10:56 AM
To: 'David Gravereaux'; [hidden email]
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: [hidden email]
[mailto:[hidden email]] On Behalf Of
David Gravereaux
Sent: Friday, September 02, 2005 12:03 PM
To: [hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tcl-win


----------------------------------------------------------------------

Comment By: David Gravereaux (davygrvy)
Date: 2004-09-24 02:41

Message:
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..

----------------------------------------------------------------------

Comment By: David Gravereaux (davygrvy)
Date: 2004-09-24 02:23

Message:
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

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2004-09-21 18:26

Message:
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).



----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1031781&group_id=10894


-------------------------------------------------------
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-Bugs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tcl-bugs