-
Notifications
You must be signed in to change notification settings - Fork 40
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
cIncludeDir doesn't seem to be working #48
Comments
Also adding |
Try setting the search path to the include path using |
@zestyr thank you! This worked: import nimterop/cimport
import os
# cDebug()
# Below manual definition of s_vpi_vecval is a workaround for
# https://github.com/genotrance/nimterop/issues/47.
type
s_vpi_vecval* {.importc: "s_vpi_vecval".} = object
aval: uint32
bval: uint32
const
xlmIncludePath = getEnv("XCELIUM_ROOT") / ".." / "include"
static:
doAssert fileExists(xlmIncludePath / "svdpi.h")
doAssert fileExists(xlmIncludePath / "svdpi_compatibility.h")
# Below works
cAddSearchDir(xlmIncludePath)
cImport(cSearchPath("svdpi.h"))
# https://github.com/genotrance/nimterop/issues/48
# Below doesn't work
# cIncludeDir(xlmIncludePath)
# cImport("svdpi.h") Any idea why |
I think that the issue is probably that the proc findPath(path: string, fail = true): string =
# Relative to project path
result = joinPathIfRel(getProjectPath(), path).replace("\\", "/")
echo "debug = " & result # I added this debug
if not fileExists(result) and not dirExists(result):
doAssert (not fail), "File or directory not found: " & path
result = "" Above debug statement prints:
The From
.. and So looks like the assertion is kicking too soon? .. not sure .. |
Again - You need to use We can think about it again but it was separated out so that you don't confuse nimterop paths with gcc. |
Thanks! Closing this issue then. |
Hello,
I am using nimterop built from master and nim built from devel.
I am using nimterop this way:
The
svdpi.h
and the other header file needed are in that directory path that I have in the above example, but still they cannot be found. I get this error:The only way I can get the compilation to work is if I copy the .h files and put them in the directory containing the above .nim file.
Am I missing something in the
cIncludeDir
syntax?The text was updated successfully, but these errors were encountered: