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

[OS X / Ubuntu ARM64] include file not found: <string> #154

Open
Sitin opened this issue Jun 28, 2023 · 3 comments
Open

[OS X / Ubuntu ARM64] include file not found: <string> #154

Sitin opened this issue Jun 28, 2023 · 3 comments

Comments

@Sitin
Copy link

Sitin commented Jun 28, 2023

I am trying to create bindings JSBSim and have the following error:

var/jsbsim/src/FGJSBBase.h:42:10: include file not found: <queue>
var/jsbsim/src/FGJSBBase.h:43:10: include file not found: <string>
var/jsbsim/src/FGJSBBase.h:44:10: include file not found: <cmath>
var/jsbsim/src/FGJSBBase.h:45:10: include file not found: <stdexcept>
var/jsbsim/src/FGJSBBase.h:46:10: include file not found: <random>
var/jsbsim/src/FGJSBBase.h:47:10: include file not found: <chrono>

Config

---
GENERATOR:
  PackageName: gojsbsim
  PackageDescription: "Package gojsbsim provides Go bindings for JSBSim."
  PackageLicense: "LGPL-2.1 licence follows the original JSBSim license."
  Includes:
    - var/jsbsim/src/JSBSim_API.h
    - var/jsbsim/src/FGJSBBase.h
    - var/jsbsim/src/FGFDMExec.h
  Options:
    SafeStrings: true

PARSER:
  Defines:
    _POSIX_C_SOURCE: 1
  IncludePaths:
    # From `c++ -xc++ /dev/null -E -Wp,-v 2>&1 | sed -n 's,^ ,,p'`
    - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1
    - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/include
    - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
    - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
    - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
    # Additional paths (everything what I've tried so far ツ):
    - /opt/homebrew/Cellar/gcc/13.1.0/include
    - /opt/homebrew/Cellar/gcc/13.1.0/include/c++/13
    - /opt/homebrew/Cellar/gcc/13.1.0/lib/gcc/13/gcc/aarch64-apple-darwin22/13/include
    - /Library/Developer/CommandLineTools/usr/include
    - /Library/Developer/CommandLineTools/usr/include/c++/v1
    - /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
    - /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1
    - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
    - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1
  SourcesPaths:
    - var/jsbsim/src/JSBSim_API.h
    - var/jsbsim/src/FGJSBBase.h
    - var/jsbsim/src/FGFDMExec.h
  Arch: arm64

TRANSLATOR:
  ConstCharIsString: true
  ConstUCharIsString: false
  ConstRules:
    defines: expand
    enum: eval

Command

Both

c-for-go -ccdefs -debug --out dist jsbsim.yaml

and (which AFAIU shold replace the inputs):

c-for-go -ccdefs -ccincl -debug --out dist jsbsim.yaml

return the same error.

I've also tried both with the following paths on Parallels Ubuntu with the following includes:

  IncludePaths:
    - /usr/include/c++/11
    - /usr/include/aarch64-linux-gnu/c++/11
    - /usr/include/c++/11/backward
    - /usr/lib/gcc/aarch64-linux-gnu/11/include
    - /usr/local/include
    - /usr/include/aarch64-linux-gnu
    - /usr/include

Same error. So, possibly this is not related to OS X.

@xlab
Copy link
Owner

xlab commented Jun 29, 2023

Hi, is this C++ source? CPP cannot be bound directly, has to be wrapped into C first and then you can bind pure C sources...

@xlab
Copy link
Owner

xlab commented Jun 29, 2023

Python (cpython) bindings for jsbsim are defined from this manifesto:
https://github.com/JSBSim-Team/jsbsim/blob/master/python/jsbsim.pxd

Which kinda skips intermediate step of creating plain C code that could be used in many many other languages through FFI.

@Sitin
Copy link
Author

Sitin commented Jun 29, 2023

Thank you @xlab for the advice! Since I want to map JSBSim classes to Golang struct/methods, C wrapper may be not the best option. Could you please suggest on the most reasonable aproach to this? Looks like Swig is what could be helpful but I am new for this kind of suff.

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