Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with compile on win 7 64 #59

Open
yahalom opened this issue Oct 9, 2015 · 3 comments
Open

issue with compile on win 7 64 #59

yahalom opened this issue Oct 9, 2015 · 3 comments
Labels

Comments

@yahalom
Copy link

yahalom commented Oct 9, 2015

I use visual studio 9 and critcl3
I try to create a package with this line:
tclsh critcl3.kit -pkg base64 base64\base64.tcl

upon linking I get the following error:
link
-nologo
-release
-opt:ref
-opt:icf,3
-ws:aggressive
-verbose:lib
$msvcbufferoverflowU.lib
-dll
-out:C:/Users/emet/.critcl/pkg32216.1444382408/v307_01bb8f5e3fbd9a66ef04
fb55e3bfdcc8.dll
@C:/Users/emet/.critcl/pkg32216.1444382408/link.fil

ERROR while linking C:/Users/emet/.critcl/pkg32216.1444382408/v307_01bb8f5e3fbd9
a66ef04fb55e3bfdcc8.dll:
LINK : warning LNK4044: unrecognized option '/ws:aggressive'; ignored
LINK : fatal error LNK1181: cannot open input file '$msvcbufferoverflowU.lib'
child process exited abnormally
Manifest Command: mt -manifest [list $outfile].manifest -outputresource:[list $o
utfile];2
Manifest File: <>, ignored

critcl build failed (D:/creditGuard/ashrait/tcllibc/base.dll)
(FAILED) Files left in C:/Users/emet/.critcl/pkg32216.1444382408
FAILURES 1
FAILED: <>
FAILED

The same code works fine with visual studio 6 on a 32 bits system.

the compile use this config:

cl
-nologo
-c
-DUSE_THREAD_ALLOC=1
-D_REENTRANT=1
-D_THREAD_SAFE=1
-DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1
-DHAVE_READDIR_R=1
-DTCL_THREADS=1
-DUSE_TCL_STUBS
-IC:/Users/emet/.critcl/pkg32216.1444382408/tcl8.4
-IC:/Users/emet/.critcl/pkg32216.1444382408
-FoC:/Users/emet/.critcl/pkg32216.1444382408/v307_01bb8f5e3fbd9a66ef04fb
55e3bfdcc8_pic.obj
C:/Users/emet/.critcl/pkg32216.1444382408/v307_01bb8f5e3fbd9a66ef04fb55e
3bfdcc8.c
-W3
-O2
-Op
-Gs
-MD
-DNDEBUG

cl : Command line warning D9002 : ignoring unknown option '-Op'

@andreas-kupries
Copy link
Owner

Look like and issue with the "Config" file of critcl. It contains Tcl code which determines if the mscvbufferoverflowU.lib is available or not. That check seems to fail in some way.

To find the file in question interactively do (in a tclsh)

% package ifneeded critcl [package require critcl]

The Tcl command should be a "source" of the main critcl.tcl file. The "Config" file is a sibling to that.

Note, I do not have a Windows box available to me at the moment.
Further investigations will have to go through you, I believe.

@yahalom
Copy link
Author

yahalom commented Oct 17, 2015

I followed the interactive mode (using the latest critcl from teapot) and without using critcl3 and it seems that the compile works fine as it does not add the option mscvbufferoverflowU.lib. But after compile the .dll is not usable. I am getting:
% aes256Encrypt asd
couldn't load library "C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451.dll": invalid argument

Below is the build log:

Sat Oct 17 10:35:58 +0530 2015 - D:/creditGuard/ashrait/tcllibc/aes-critcl/aes256c.tcl

cl
-nologo
-c
-DUSE_THREAD_ALLOC=1
-D_REENTRANT=1
-D_THREAD_SAFE=1
-DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1
-DHAVE_READDIR_R=1
-DTCL_THREADS=1
-DUSE_TCL_STUBS
-IC:/Users/emet/.critcl/win32-x86_64/tcl8.4
-IC:/Users/emet/.critcl/win32-x86_64
-FoC:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451_pic.obj
C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451.c
-W3
-O2
-Op
-Gs
-MD
-DNDEBUG

cl : Command line warning D9002 : ignoring unknown option '-Op'
v3112_0bbce8f15e1d72e855f505bf80b34451.c
C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451_pic.obj: 11673 bytes

link
-nologo
-release
-opt:ref
-opt:icf,3
-ws:aggressive
-verbose:lib
-dll
-out:C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451.dll
@C:/Users/emet/.critcl/win32-x86_64/link.fil

LINK : warning LNK4044: unrecognized option '/ws:aggressive'; ignored

Searching libraries
Searching G:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB\MSVCRT.lib:
Searching G:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB\OLDNAMES.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:
Searching G:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB\MSVCRT.lib:
Searching G:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB\OLDNAMES.lib:

Finished searching libraries
Creating library C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451.lib and object C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451.exp

Searching libraries
Searching G:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB\MSVCRT.lib:
Searching G:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB\OLDNAMES.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:

Finished searching libraries

Searching libraries
Searching G:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB\MSVCRT.lib:
Searching G:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB\OLDNAMES.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:

Finished searching libraries
C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451.dll: 10240 bytes
Manifest Command: mt -manifest [list $outfile].manifest -outputresource:[list $outfile];2
Manifest File: C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451.dll.manifest

mt
-manifest
C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451.dll.manifest
-outputresource:C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451.dll;2

Microsoft (R) Manifest Tool version 5.2.3790.2075

Copyright (c) Microsoft Corporation 2005.

All rights reserved.

C:/Users/emet/.critcl/win32-x86_64/v3112_0bbce8f15e1d72e855f505bf80b34451.dll: 11264 bytes, with manifest

@apnadkarni
Copy link
Contributor

This is in all likelihood a mixup between 32- and 64-bit compiles. Note that the -target option to critcl has to match the cl that is actually invoked (32 vs 64-bit) based on the Visual Studio command line or equivalent that you are using. Of course, the tclsh also has to match the arch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants