TCL 8.4 under Window OCC 5.2

Hello All,

Has anyone compiled OCC for TCL8.4.6 and TK8.4.6 under windows? I'm using standard version of these two packages compliled from source, not the activeTcl version. I have encountered several incompatible calls. Before, I dive into rearranging and probably breaking everything. I figured that I would ask around.

Regards, Kevin

Draw_Window.cxx
\OpenCASCADE5.2\ros\src\Draw\Draw_Window.cxx(52) : error C2440: '=' : cannot convert from 'const char *' to 'char *'
Conversion loses qualifiers
Draw_VariableCommands.cxx
\OpenCASCADE5.2\ros\src\Draw\Draw_VariableCommands.cxx(691) : error C2664: 'void Draw_Drawable3D::Name(const Standard_CString)' : cannot convert parameter 1 from 'const char *' to 'const Standard_CString'
Conversion loses qualifiers
\OpenCASCADE5.2\ros\src\Draw\Draw_VariableCommands.cxx(695) : error C2664: 'Tcl_TraceVar' : cannot convert parameter 4 from 'char *(ClientData,Tcl_Interp *,char *,char *,Standard_Integer)' to 'Tcl_VarTraceProc (__cdecl *)'
None of the functions with this name in scope match the target type
\OpenCASCADE5.2\ros\src\Draw\Draw_VariableCommands.cxx(753) : error C2664: 'Tcl_VarTraceInfo' : cannot convert parameter 4 from 'char *(ClientData,Tcl_Interp *,char *,char *,Standard_Integer)' to 'Tcl_VarTraceProc (__cdecl *)'
None of the functions with this name in scope match the target type
Draw_Interpretor.cxx
\OpenCASCADE5.2\ros\src\Draw\Draw_Interpretor.cxx(46) : error C2440: 'initializing' : cannot convert from 'const char *' to 'char *const '
Conversion loses qualifiers
\OpenCASCADE5.2\ros\src\Draw\Draw_Interpretor.cxx(140) : error C2664: 'Tcl_CreateCommand' : cannot convert parameter 3 from 'Standard_Integer (ClientData,Tcl_Interp *,Standard_Integer,char *[])' to 'Tcl_CmdProc (__cdecl *)'
None of the functions with this name in scope match the target type
\OpenCASCADE5.2\ros\src\Draw\Draw_Interpretor.cxx(166) : error C2664: 'Tcl_CreateCommand' : cannot convert parameter 3 from 'Standard_Integer (ClientData,Tcl_Interp *,Standard_Integer,char *[])' to 'Tcl_CmdProc (__cdecl *)'
None of the functions with this name in scope match the target type
Generating Code...

Kevin Smith's picture

I forgot to add to the email. This error occurred while compiling TKDraw, which VC7.0

Kevin

Christian's picture

Hi Kevin

I have exactly the same problem, did you found a solution to solve this problems ?

Christian's picture

Hi Kevin

I have exactly the same problem, did you found a solution to solve this problems ?

Kevin Smith's picture

Hello Christian,

I resolved the issues in TKDraw, but encountered some issues in WOK which I was not able to resolve as of yet. So, I will detail what I have done so far. If you resolve the issue in the WOK solution. Please let me know. Also, if this doesn't work for you let me know. I have may have missed one of the changes.

To get the Draw .sln to compile I changed 2 files in a total of 3 locations.

1) File Draw_Interpretor.cxx :
//static Standard_Integer CommandCmd
//(ClientData clientData, Tcl_Interp *interp,
//Standard_Integer argc, char* argv[])
//km changed the appove to below
static Standard_Integer CommandCmd
(ClientData clientData, Tcl_Interp *interp,
Standard_Integer argc, CONST84 char* argv[])

2) File Draw_VariableCommands.cxx

//static char* tracevar(ClientData CD, Tcl_Interp*, char*, char*, Standard_Integer)
//km converted above to below
static char* tracevar(ClientData CD, Tcl_Interp*, CONST84 char*, CONST84 char*, Standard_Integer)

3) File Draw_VariableCommands.cxx
This is places under the following function

void Draw::Set(Standard_CString& name,const Handle(Draw_Drawable3D)& D,const Standard_Boolean displ)

// D->Name(Tcl_SetVar(theCommands.Interp(),name,name,0));
// km changed above to below
CONST84 char * X;
int size_X;
X=Tcl_SetVar(theCommands.Interp(),name,name,0);
size_X = strlen(X);
D->Name((Standard_CString)X[size_X]);
// end of changes km
NOTE: This is not very clean but it seems to do the job

Wayne's picture

hi, kevin:

i just read your resolving method for the errors occured when compiling draw.*, because i just met the same errors as you have. i am very appreciated for your illustration for dealing with them.

actually i meet similar errors when compiling wok.* , and could you give me any suggestion to resolve them? especially the first three errors. thank you very very much.

the following is my errors

--------------------Configuration: TKWOKTcl - Win32 Debug--------------------
Compiling...
WOKTclTools_Interpretor.cxx
Information: tcl8.4.lib is using as TCL library
E:\OpenCASCADE5.2\ros\src\WOKTclTools\WOKTclTools_Interpretor.cxx(159) : error C2664: 'Tcl_CreateCommand' : cannot convert parameter 3 from 'int (void *,struct Tcl_Interp *,int,char *[])' to 'int (__cdecl *)(void *,struct Tcl_Interp *,int,const char
*[])'
None of the functions with this name in scope match the target type
E:\OpenCASCADE5.2\ros\src\WOKTclTools\WOKTclTools_Interpretor.cxx(179) : error C2664: 'Tcl_CreateCommand' : cannot convert parameter 3 from 'int (void *,struct Tcl_Interp *,int,char *[])' to 'int (__cdecl *)(void *,struct Tcl_Interp *,int,const char
*[])'
None of the functions with this name in scope match the target type
E:\OpenCASCADE5.2\ros\src\WOKTclTools\WOKTclTools_Interpretor.cxx(443) : error C2664: 'Tcl_SplitList' : cannot convert parameter 4 from 'char *** ' to 'const char *** '
Conversion loses qualifiers
E:\OpenCASCADE5.2\ros\src\WOKTclTools\WOKTclTools_Interpretor.cxx(688) : error C2664: 'int (void *,struct Tcl_Interp *,int,const char *[])' : cannot convert parameter 4 from 'char *[5]' to 'const char *[]'
Conversion loses qualifiers
E:\OpenCASCADE5.2\ros\src\WOKTclTools\WOKTclTools_Interpretor.cxx(709) : error C2664: 'int (void *,struct Tcl_Interp *,int,const char *[])' : cannot convert parameter 4 from 'char *[5]' to 'const char *[]'
Conversion loses qualifiers
E:\OpenCASCADE5.2\ros\src\WOKTclTools\WOKTclTools_Interpretor.cxx(727) : error C2664: 'int (void *,struct Tcl_Interp *,int,const char *[])' : cannot convert parameter 4 from 'char *[4]' to 'const char *[]'
Conversion loses qualifiers
Error executing cl.exe.

TKWOKTcl.dll - 6 error(s), 0 warning(s)

Bill Jones's picture

I have successfully compiled with Tcl/Tk versions 8.4.5 with the mods posted at http://www.opencascade.org/org/forum/thread_8531/. Note I can only verify that this works by means of the samples/standard/Qt and samples/tutorial (if they even use this functionality). I can however compile and get the libraries that I need.