[ 
https://issues.apache.org/jira/browse/THRIFT-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14530239#comment-14530239
 ] 

David Ehrmann edited comment on THRIFT-3129 at 5/6/15 9:40 AM:
---------------------------------------------------------------

Using the file, not the path, was a copy-and-paste mistake on my end. I tried 
that after {}thrift -I ../project1 --gen java wrapper.thrift{} failed. The file 
name shouldn't matter since it's not part of the class name, but I changed it, 
anyway, and no luck.

Also, it looks like you need a space after {{-I}}, unlike gcc.


was (Author: ehrmann):
Using the file, not the path, was a copy-and-paste mistake on my end. I tried 
that after {code}thrift -I ../project1 --gen java wrapper.thrift{code} failed. 
The file name shouldn't matter since it's not part of the class name, but I 
changed it, anyway, and no luck.

Also, it looks like you need a space after -I, unlike gcc.

> Unexpected include behavior
> ---------------------------
>
>                 Key: THRIFT-3129
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3129
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.9.2
>            Reporter: David Ehrmann
>            Priority: Minor
>
> I have the following directory structure:
> {code}
> ./project0/wrapper.thrift
> ./project1/struct.thrift
> {code}
> {code:title=project0/wrapper.thrift}
> include "struct.thrift"
> struct UserProfileResponse {
>   1: i32 responseCode,
>   2: UserProfile userProfile
> }
> {code}
> {code:title=project1/struct.thrift}
> struct UserProfile {
>     1: i32 uid,
>     2: string name
> }
> {code}
> While in project0 this command fails:
> {code}
> project0]$ thrift -I ../project1/struct.thrift --gen java wrapper.thrift
> [WARNING:/.../project0/wrapper.thrift:1] Could not find include file 
> struct.thrift
>  
> [ERROR:/.../project0/wrapper.thrift:5] (last token was 'UserProfile')
> Type "UserProfile" has not been defined.
> {code}
> This isn't what I expected. Since project1 is on the include path, I thought 
> it would be searched when includes happen (like how gcc does it).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to