Re: Building a windows app with Tcl/Tk includes X.h



George Peter Staplin <georgepsSPAMMENOT@xxxxxxxxxxxx> writes:

SimonG wrote:
I'm building a windows app with Tcl and Tk embedded. Visual Studio is
generating the following error:

c:\Tcl\include\X11\X.h(51) : error C2371: 'Font' : redefinition;
different basic types
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include
\comdef.h(305) : see declaration of 'Font'


It seems to me that it shouldn't be trying to include anything from
X11. Is there a #define I should pass to the compiler, or #include
more than just "tk.h" ? I'm using 8.4 with 8.5 overlayed (both from
ActiveState).

Thanks,

Simon Geard


Tk uses the header files for X11 in Win32 for its X emulation layer.
This can be problematic, as you seem to have found.

I'm not aware of a solution to your Font type problem. Most of the Tk
developers and ActiveState are using older compilers, for backwards
compatibility reasons.

Pat Thoyts may have some advice, and I'll point out this thread to him.
He seems to be the Win32 expert maintainer, and did a lot of work on
Tile/Ttk's Win32 support.

Its clashing with the internal definition for the COM IFontDisp.
I'd suggest #define WIN32_LEAN_AND_MEAN before you
#include <windows.h> in case that helps. Otherwise you should put your
Tcl/tk interface code into a module that doesn't get the comdef header
loaded. Not much else you can do really.

--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
.



Relevant Pages

  • Re: Building a windows app with Tcl/Tk includes X.h
    ... different basic types ... Tk uses the header files for X11 in Win32 for its X emulation layer. ... I'm not aware of a solution to your Font type problem. ...
    (comp.lang.tcl)
  • Re: How to Change OE6 Print Defaults
    ... using OETool and Full Screen use the Times New Roman font? ... header and Date footer. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: How to Change OE6 Print Defaults
    ... In OE the message appears in what I assume is the Arial font, ... header and Date footer. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Page headers/footers
    ... any font I try. ... have never had on my Mac, Office X (which I also never had on my Mac, ... I could just click on the header area to select it directly for editing ... Layout trick and it appears to work but of course once the worksheet ...
    (microsoft.public.mac.office.excel)
  • Re: Page headers/footers
    ... It can be a font issue, ... type the first line into the center section of the header, ... update for Office so the preferences should be fresh and new. ... Header area in "Page layout". ...
    (microsoft.public.mac.office.excel)