You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Konrad Grochowski (JIRA)" <ji...@apache.org> on 2015/05/06 11:15:00 UTC

[jira] [Commented] (THRIFT-3129) Unexpected include behavior

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

Konrad Grochowski commented on THRIFT-3129:
-------------------------------------------

try {{-I../project1}} - it should point to include directory, not include itself

btw: struct might be a bad name for file as it's a keyword in couple languages

> 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}
> wrapper.thrift:
> {code}
> include "struct.thrift"
> struct UserProfileResponse {
>   1: i32 responseCode,
>   2: UserProfile userProfile
> }
> {code}
> struct.thrift:
> {code}
> 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)