Hi James,

Do you know if the finished addin will be made available to the public?

Thanks

On Fri, Mar 12, 2010 at 4:15 PM, James King <[email protected]> wrote:

> Thanks, I totally missed that in my rush to get things running!
> Perhaps the keyword should be "import" instead of "include" (too late to
> change, I know).
>
> I will work with the dev team to get the single file code generator for
> Visual Studio 2008 in as part of the project.
>
> - Jim
>
> -----Original Message-----
> From: Bryan Duxbury [mailto:[email protected]]
> Sent: Friday, March 12, 2010 11:12 AM
> To: [email protected]
> Subject: Re: C# CodeGen - Windows - Include Files?
>
> Includes in Thrift are not straight textual includes. You need to prefix
> types from other files with the name of the file minus the .thrift
> extension
> to tell the compiler where to look.
>
> So in File1, you need to do "file2.HostType".
>
> On Fri, Mar 12, 2010 at 6:44 AM, James King <[email protected]> wrote:
>
> > I have a strange issue... I have compiled the trunk tip code under cygwin
> > and have a compiler for thrift.  I made two thrift files - one includes
> the
> > other.  When I try to compile it with -verbose, I can see that it is
> parsing
> > both files, then it complains that the type in the second file is not
> > declared!  If I compile the second file by itself, it works.  If I copy
> the
> > contents of the second file into the first, it all works.  I thought
> include
> > statements were supposed to work!!  Is this a known issue?  See below
> (I'm
> > finishing up a single-file code generator plug-in for Visual Studio that
> > will allow you to treat .thrift files just like any other code file in
> the
> > IDE):
> >
> > File 1:
> >
> > namespace csharp CodeGenMultiFileIncludeTest
> >
> > include "CodeGenTest2.thrift"
> >
> > /* When using ThriftCodeGen inside VS, the resulting C# code should only
> > define HostInfo for this file */
> >
> > struct HostInfo {
> >  1: HostType type,
> >  2: string   desc,    /* a descriptive string about the OS */
> >  3: string   name,    /* the name of the host */
> >  4: string   implang  /* language client is implemented in */
> > }
> >
> > File 2:
> >
> > namespace csharp CodeGenMultiFileIncludeTest
> >
> > /* When using ThriftCodeGen inside VS, the resulting C# code should only
> > define HostType for this file */
> >
> > enum HostType {
> >  WINDOWS = 1,
> >  LINUX = 2
> > }
> >
> > Compiler output when I compile the second file - it works fine:
> >
> > C:\temp>thrift  --gen csharp -v CodeGenTest2.thrift
> > Scanning /cygdrive/c/temp/CodeGenTest2.thrift for includes
> > Parsing /cygdrive/c/temp/CodeGenTest2.thrift for types
> > Program: /cygdrive/c/temp/CodeGenTest2.thrift
> > Generating "csharp"
> >
> > Compiler output when I compile the first file which includes the second
> > file - it fails!
> >
> > C:\temp>thrift  --gen csharp -v CodeGenTest1.thrift
> > Scanning /cygdrive/c/temp/CodeGenTest1.thrift for includes
> > Scanning /cygdrive/c/temp/CodeGenTest2.thrift for includes
> > Parsing /cygdrive/c/temp/CodeGenTest2.thrift for types
> > Parsing /cygdrive/c/temp/CodeGenTest1.thrift for types
> > [ERROR:/cygdrive/c/temp/CodeGenTest1.thrift:8] (last token was
> 'HostType')
> > Type "HostType" has not been defined.
> > 
> > Thanks for any help... I'll dig into the generator code if I need to.
> >
> >
> > James E. King, III                       300 Innovative Way, Suite 301
> > Senior Software Engineer                 Nashua, NH 03062
> > Dell (EqualLogic) HIT Team (ASM)         (603) 589-5895
> >
> >
>

Reply via email to