Comments (10)
Just for note: generates fine with default Apple LLVM, I do not use --ccincl
(see Makefile)
$ clang -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
@terinjokes could you please post snippets or the whole file somewhere? Also please try -ccdefs
and -ccincl
flags (in different combinations):
c-for-go vorbis.yml
c-for-go --ccincl vorbis.yml
c-for-go --ccdefs vorbis.yml
c-for-go --ccincl --ccdefs vorbis.yml
from c-for-go.
c-for-go vorbis.yml
processing vorbis.yml ⠋[ERR] /data/data/com.termux/files/usr/include/stdint.h:33:10: include file not found: stddef.h. Search paths:
/usr/include
/data/data/com.termux/files/usr/include
/data/data/com.termux/files/home/go/src/github.com/xlab/vorbis-go
/usr/include
/data/data/com.termux/files/usr/include
/data/data/com.termux/files/home/go/src/github.com/xlab/vorbis-go (and 3 more errors)
--ccincl
included above
--ccdefs
processing vorbis.yml ⠹[ERR] /data/data/com.termux/files/usr/include/inttypes.h:268:33: unexpected '*', expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile] (and 3 more errors)
--ccincl --ccdefs
processing vorbis.yml ⠹/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:34:6: called object is not a function or function pointer (have 'int')
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:34:5: not a constant expression
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:48:6: called object is not a function or function pointer (have 'int')
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:48:5: not a constant expression
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:59:6: called object is not a function or function pointer (have 'int')
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:59:5: not a constant expression
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:71:29: called object is not a function or function pointer (have 'int')
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:70:5: not a constant expression
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:84:6: called object is not a function or function pointer (have 'int')
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:84:5: not a constant expression
too many errors
stddef.h
stddef.h hasn't changed in a number of years, and my version is a byte-for-byte match with master.
from c-for-go.
include file not found: stddef.h. Search paths:
/usr/include
On my machine, that file is available at:
/usr/include/stddef.h
/*
* Copyright (c) 2000-2013 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
Will check out your stddef..
from c-for-go.
Hey, just wanted to point out that on my system stddef.h is not located in /usr/include either. It's dependent on the compiler in question, so for me it's located under /usr/lib/gcc/x86_64-pc-linux-gnu//include, so I had to manually add that to the include paths. Apple's Clang probably assumes that it is the only compiler installed on the system and places its stddef.h in /usr/include.
from c-for-go.
Hello! Trying to make a change to the vulkan-go manifest and getting this issue when I try to rebuild. I'm using Mojave 10.14.2. Clang gives me:
$ clang -v
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
c-for-go -ccdefs -out .. vulkan.yml
processing vulkan.yml ⠹[ERR] vulkan/vk_platform.h:71:10: include file not found: stddef.h. Search paths:
/usr/include
/Users/noofapple/go/src/github.com/vulkan-go/vulkan
/usr/include
/Users/noofapple/go/src/github.com/vulkan-go/vulkan (and 2 more errors)
make: *** [all] Error 1
c-for-go -ccdefs -ccincl -out .. vulkan.yml
processing vulkan.yml ⠙/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:34:6: called object is not a function or function pointer (have 'int')
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:34:5: not a constant expression
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:48:6: called object is not a function or function pointer (have 'int')
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:48:5: not a constant expression
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:59:6: called object is not a function or function pointer (have 'int')
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:59:5: not a constant expression
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:71:29: called object is not a function or function pointer (have 'int')
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:70:5: not a constant expression
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:84:6: called object is not a function or function pointer (have 'int')
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:84:5: not a constant expression
too many errors
make: *** [all] Error 1
from c-for-go.
The issue seems to be coming from the __has_feature(modules)
macro for Clang. Is your stddef.h the Clang or GCC version?
ETA: Mine seems to be a copy of the one linked above. With the copyright (c) 2008 Eli Friedman header.
from c-for-go.
I have exactly the same problem as @Noofbiz on Mojave 10.14.6, and I don't have /usr/include/stddef.h.
from c-for-go.
@RobinWragg I believe nobody has now, Catalina nuked /usr/include
and there was some investigation in progress how to parse XCode internal includes that may contain weird macros:
#84
You may try something like
PARSER:
IncludePaths: [
"/usr/include",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"
]
from c-for-go.
@xlab thanks for the suggestion. After I added the full include path, I get the same errors as @terinjokes at the top of this thread, i.e. issues with parsing stddef.h.
from c-for-go.
@xlab I am also getting similar errors as stated above after including /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
from c-for-go.
Related Issues (20)
- How to make int8_t from c to int8 in golang? HOT 1
- With the latest commit (c95ebd03aba931e7248a6011f86d822ab878d00c), c-for-go can no longer generate defines HOT 10
- Go Integer overflows translated from large C enum numbers HOT 5
- define pointer to function HOT 1
- type C.struct_ in strut and func HOT 1
- How to handle a function returning a struct as value
- Type translation does not respect systems data model HOT 1
- Verbose argument to print more logs
- Avoid lock / unlock for some function call
- Wiki need to be updated
- panic: unknown type _Float128 HOT 2
- Non int return function pointer not recognized
- Generator uses underlying type of typedef when used as a parameter
- Website down HOT 3
- It would be nice to at least have an example of the YML required in the readme since the website does not work HOT 1
- build HOT 5
- [OS X / Ubuntu ARM64] include file not found: <string> HOT 3
- Extracting SAL annotations from declarations HOT 2
- Example where C const get translated into Go typed const
- Callback generation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c-for-go.