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

getHeader doesn't find a header #259

Open
mantielero opened this issue Nov 23, 2020 · 1 comment
Open

getHeader doesn't find a header #259

mantielero opened this issue Nov 23, 2020 · 1 comment

Comments

@mantielero
Copy link

While looking for a workaround for issue #257, it looks like getheader might not be managing well header files with symbols like _:

I have the file occt_wrapper.nim:

# nim c -d:Geom2dCartesianPointStd occt_wrapper
import nimterop/[build, cimport]

static:
  cDebug()                                                # Print wrapper to stdout

cIncludeDir("/usr/include/opencascade")

# The following should create the variables: "Geom2d_CartessianPointPath" 
# and "Geom2d_CartessianPointLPath"
getHeader( "opencascade/Geom2d_CartesianPoint.hxx", altNames = "TKG2d", outdir= "/usr/lib" )

# Checking if nim was called with "-d:headerStatic"
when not isDefined(headerStatic):
  c2nImport(Geom2d_CartesianPointPath, recurse = true, mode="cpp", dynlib = Geom2d_CartesianPointLPath)       # Pass dynlib if not static link
else:
  c2nImport(Geom2d_CartesianPointPath, recurse = true, mode="cpp")

but when I compile:

nim c -d:Geom2dCartesianPointStd occt_wrapper

I get the error in the getHeader line:

/home/jose/.choosenim/toolchains/nim-1.2.6/lib/system/fatal.nim(49, 5) Error: unhandled exception: /home/jose/.nimble/pkgs/nimterop-#head/nimterop/build/getheader.nim(506, 16) `Geom2dCartesianPointPath.len != 0` 
Header opencascade/Geom2d_CartesianPoint.hxx not found - missing/empty outdir or -d:Geom2dCartesianPointStd -d:Geom2dCartesianPointGit -d:Geom2dCartesianPointDL -d:Geom2dCartesianPointConan or -d:Geom2dCartesianPointJBB not specified [AssertionError]

I have tried using the header name: /usr/include/opencascade/Geom2d_CartesianPoint.hxx and I get the error:

Header /usr/include/opencascade/Geom2d_CartesianPoint.hxx not found - missing/empty outdir or -d:Geom2dCartesianPointStd -d:Geom2dCartesianPointGit -d:Geom2dCartesianPointDL -d:Geom2dCartesianPointConan or -d:Geom2dCartesianPointJBB not specified [AssertionError]

but that file obviously exists.

@genotrance
Copy link
Collaborator

I tried this with SDL_version.h and libSDL2.so and it worked for me. I suspect it has to do with you setting outdir = "/usr/lib". I'll recommend simply setting it to getProjectCacheDir("opencascade") or currentSourcePath.parentDir() and retrying.

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