On 12/20/2022 2:11 AM, Ralf Fassel wrote:
* et4 <[email protected]>
| On 12/19/2022 11:10 PM, Christian Gollwitzer wrote:
| > Am 20.12.22 um 04:31 schrieb et4:
| ...
| > Shouldn't be too difficult, Ralf basically changed only the
| > returning of a result back into Tcl, which uses an outdated
| > mechanism, and removed the include of tclerrno.h. ....
| Ok, think I got it figured out, -u includes 3 lines of context by
| default, and that was confusing me.
Ah, I see. I figured that the 'diff' output might be easier to read
than trying to explain manually what needs to be changed, even if
someone applied the changes manually.
'cl' is the command line compiler provided by any Visual Studio release
I have worked with so far (starting approx in 2003). You should get it
if you open one of the "Visual Studio Command Prompt" entries from the VisualStudio submenu in 'Programs'.
| > But be prepared that there are some refactoring changes
| > necessary. The code is not 64bit-safe. I've quickly looked into the
| > warnings that Ralf got during the compilation. The code passes
| > pointers around as DWORDs between the windows API and callbacks,
| > which is 32 bit only. YOu may be lucky that replacing some DWORD
| > with DWORD_PTR is enough to get it working, but there is no
| > guarantee. In the worst case you need to adjust the parameter
| > passing.
It might be possible to just remove the DWORD casts, but I haven't
looked at the MIDI function signatures whether this would be enough.
| Hmmm, I guess I'll have to look at each error message and try to
| figure out what's wrong. If I'm lucky, the C compiler will complain
| until I fix them all.
| But with the first error at line 666, this could be a sign :)
:-) Good luck!
R'
Thanks. I will need a little more help with the command line and the tcl86.lib file, for my first try got this:
LINK : fatal error LNK1181: cannot open input file 'tcl86.lib'
So, I searched for the file but only found these 2 files
tcl86t.lib
tclstub86.lib
in Magicsplat's lib directory, so I tried both and also I gave it the full path
The last linker warning seems to suggest I'm not building a 64 bit version and the unresolve's cause a fatal error - wondering if I installed the right version of vis studio (the community 2022 version), do they have 32 and 64 bit versions ? They appear
to think I'm building a 32 bit program.
Here's the run using the 't' library, using the stub version produced the same results
cl -o midi.dll midi.c -IC:\Users\ET\AppData\Local\Apps\Tcl86\include /link -dll C:\Users\ET\AppData\Local\Apps\Tcl86\lib\tcl86t.lib Winmm.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31937 for x86 <<<<<<<<<<<<<< wondering about this <<<<<<<<<<<<
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
midi.c
midi.c(788): warning C4090: 'function': different 'const' qualifiers midi.c(788): warning C4113: 'int (__cdecl *)(ClientData,char *,int,int *)' differs in parameter lists from 'Tcl_DriverOutputProc (__cdecl *)'
midi.c(1031): warning C4090: 'function': different 'const' qualifiers midi.c(1031): warning C4113: 'int (__cdecl *)(ClientData,char *,int,int *)' differs in parameter lists from 'Tcl_DriverOutputProc (__cdecl *)'
midi.c(1222): warning C4090: 'function': different 'const' qualifiers midi.c(1222): warning C4113: 'int (__cdecl *)(ClientData,Tcl_Interp *,int,char **)' differs in parameter lists from 'Tcl_CmdProc (__cdecl *)'
midi.c(1223): warning C4090: 'function': different 'const' qualifiers midi.c(1223): warning C4113: 'int (__cdecl *)(ClientData,Tcl_Interp *,int,char **)' differs in parameter lists from 'Tcl_CmdProc (__cdecl *)'
midi.c(1224): warning C4090: 'function': different 'const' qualifiers midi.c(1224): warning C4113: 'int (__cdecl *)(ClientData,Tcl_Interp *,int,char **)' differs in parameter lists from 'Tcl_CmdProc (__cdecl *)'
midi.c(1225): warning C4090: 'function': different 'const' qualifiers midi.c(1225): warning C4113: 'int (__cdecl *)(ClientData,Tcl_Interp *,int,char **)' differs in parameter lists from 'Tcl_CmdProc (__cdecl *)'
midi.c(1226): warning C4090: 'function': different 'const' qualifiers midi.c(1226): warning C4113: 'int (__cdecl *)(ClientData,Tcl_Interp *,int,char **)' differs in parameter lists from 'Tcl_CmdProc (__cdecl *)'
midi.c(1227): warning C4090: 'function': different 'const' qualifiers midi.c(1227): warning C4113: 'int (__cdecl *)(ClientData,Tcl_Interp *,int,char **)' differs in parameter lists from 'Tcl_CmdProc (__cdecl *)'
midi.c(1228): warning C4090: 'function': different 'const' qualifiers midi.c(1228): warning C4113: 'int (__cdecl *)(ClientData,Tcl_Interp *,int,char **)' differs in parameter lists from 'Tcl_CmdProc (__cdecl *)'
Microsoft (R) Incremental Linker Version 14.34.31937.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:midi.exe
/out:midi.dll
-dll
C:\Users\ET\AppData\Local\Apps\Tcl86\lib\tcl86t.lib
Winmm.lib
midi.obj
Creating library midi.lib and object midi.exp
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_PkgProvideEx referenced in function _Midi_Init
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_Alloc referenced in function _GetMidiErrorMsg
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_Free referenced in function _Rpmidi_InClose
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_GetInt referenced in function _OpenOut_Cmd
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_NewIntObj referenced in function _Rpmidi_Error
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_NewStringObj referenced in function _Rpmidi_InOpen
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_AppendElement referenced in function _GetOutDevs_Cmd
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_CreateChannel referenced in function _Rpmidi_InOpen
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_CreateCommand referenced in function _Midi_Init
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_GetErrno referenced in function _Rpmidi_OutOutput
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_RegisterChannel referenced in function _Rpmidi_InOpen
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_SetResult referenced in function _OpenOut_Cmd
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_SetObjResult referenced in function _Rpmidi_Error
midi.obj : error LNK2019: unresolved external symbol __imp__Tcl_UnregisterChannel referenced in function _Rpmidi_InClose
midi.obj : error LNK2019: unresolved external symbol __imp__TclWinConvertError referenced in function _Rpmidi_OutOutput
C:\Users\ET\AppData\Local\Apps\Tcl86\lib\tcl86t.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
midi.dll : fatal error LNK1120: 15 unresolved externals
---------------
Here's some [info] running the "wish" console:
(bin) 2 % parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(engine) = Tcl
tcl_platform(machine) = amd64
tcl_platform(os) = Windows NT
tcl_platform(osVersion) = 10.0
tcl_platform(pathSeparator) = ;
tcl_platform(platform) = windows
tcl_platform(pointerSize) = 8
tcl_platform(threaded) = 1
tcl_platform(user) = et
tcl_platform(wordSize) = 4
(bin) 3 % info pa
8.6.11
(bin) 4 % info nameof
C:/Users/ET/AppData/Local/Apps/Tcl86/bin/wish.exe
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)