Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown type name 'huo_ast' compilation error #56

Open
rwhitworth opened this issue Jun 10, 2017 · 2 comments
Open

unknown type name 'huo_ast' compilation error #56

rwhitworth opened this issue Jun 10, 2017 · 2 comments

Comments

@rwhitworth
Copy link

Trying to compile with gcc or clang on Debian jessie. Receiving the following error (and a similar error with clang). Seeing this on git commit 152af3b.

cc -g3 -std=c11 -Werror -Wall -Wextra -pedantic -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -MD -MF .structures/huo_ast.mk -MP -MD -MF src/structures/huo_ast.o -MP -MD -MF .huo_ast.mk -MP  -c -o src/structures/huo_ast.o src/structures/huo_ast.c
In file included from src/structures/value.h:5:0,
                 from src/structures/huo_ast.h:7,
                 from src/structures/huo_ast.c:6:
src/structures/structures.h:20:5: error: unknown type name ‘huo_ast’
     huo_ast *ast;
     ^
src/structures/structures.h:29:9: error: unknown type name ‘huo_ast’
         huo_ast *ast;
         ^
<builtin>: recipe for target 'src/structures/huo_ast.o' failed
make: *** [src/structures/huo_ast.o] Error 1
@snordgren
Copy link
Contributor

From what I can see this is the result of this ordering, because value.h makes use of the huo_ast type:

#include "value.h"
typedef struct huo_ast_t huo_ast;

I tried swapping the two lines and it worked.

typedef struct huo_ast_t huo_ast;
#include "value.h"

@rwhitworth
Copy link
Author

This issue can be closed if #59 is merged to master.

Thanks @snordgren for getting me over this hurdle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants