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

Error: unhandled exception: getters.nim(189, 12) name.nBl Blank identifier error [AssertionError] #268

Open
mantielero opened this issue Jan 29, 2021 · 1 comment

Comments

@mantielero
Copy link

I am trying to wrap the following:

# nim c wrapper.nim > fmuTemplate.nim

import nimterop/cimport

static:
  cDebug()
  cDisableCaching()           # Regenerate Nim wrapper every time

#cDefine("HAS_ABC")            # Set #defines for preprocessor and compiler
#cDefine("HAS_ABC", "DEF")

cDefine("DISABLE_PREFIX")
cDefine("FMI2_Export")
cDefine("FMI2_FUNCTION_PREFIX", "MyModel_")

cIncludeDir("./fmusdk-master/fmu20/src/shared/include")   # Setup any include directories
#cExclude("clib/file.h")       # Exclude file from wrapped output

cImport("./fmusdk-master/fmu20/src/models/fmuTemplate.h", recurse = true, mode= "c")  # Generate wrappers for header specified

and I am geting the following error:

.......................................stack trace: (most recent call last)
/home/jose/.nimble/pkgs/nimterop-#head/nimterop/cimport.nim(632, 23) cImport
/home/jose/.nimble/pkgs/nimterop-#head/nimterop/cimport.nim(138, 11) getToast
/home/jose/.choosenim/toolchains/nim-1.4.2/lib/system/assertions.nim(30, 26) failedAssertImpl
/home/jose/.choosenim/toolchains/nim-1.4.2/lib/system/assertions.nim(23, 11) raiseAssert
/home/jose/.choosenim/toolchains/nim-1.4.2/lib/system/fatal.nim(49, 5) sysFatal
/home/jose/src/fmi.nim/src/wrapper/wrapper.nim(19, 8) template/generic instantiation of `cImport` from here
/home/jose/.nimble/pkgs/nimterop-#head/nimterop/cimport.nim(704, 10) template/generic instantiation of `cImport` from here
/home/jose/.choosenim/toolchains/nim-1.4.2/lib/system/fatal.nim(49, 5) Error: unhandled exception: /home/jose/.nimble/pkgs/nimterop-#head/nimterop/cimport.nim(138, 16) `false` 

# Generated @ 2021-01-29T15:37:49+01:00
# Command line:
#   /home/jose/.nimble/pkgs/nimterop-#head/nimterop/toast --preprocess -m:c --recurse --defines+=DISABLE_PREFIX --defines+=FMI2_Export --defines+=FMI2_FUNCTION_PREFIX=MyModel_ --includeDirs+=/home/jose/src/fmi.nim/src/wrapper/fmusdk-master/fmu20/src/shared/include --pnim --nim:/home/jose/.choosenim/toolchains/nim-1.4.2/bin/nim /home/jose/src/fmi.nim/src/wrapper/fmusdk-master/fmu20/src/models/fmuTemplate.h -o /home/jose/.cache/nim/nimterop/toastCache/nimterop_1122627657.nim

toast.nim(227)           toast
cligen.nim(733)          cligenDoNotCollideWithGlobalVar
cligen.nim(651)          dispatchmain
toast.nim(150)           main
toast.nim(30)            process
ast2.nim(1944)           parseNim
ast2.nim(1829)           searchTree
ast2.nim(1801)           processNode
ast2.nim(1346)           addType
ast2.nim(1193)           addTypeProc
ast2.nim(1170)           getTypeProc
ast2.nim(679)            newProcTy
ast2.nim(660)            newFormalParams
ast2.nim(504)            newIdentDef
comphelp.nim(95)         getNameInfo
getters.nim(189)         getIdentifier
assertions.nim(29)       failedAssertImpl
assertions.nim(22)       raiseAssert
fatal.nim(49)            sysFatal
Error: unhandled exception: getters.nim(189, 12) `name.nBl` Blank identifier error [AssertionError]
 [AssertionDefect]

Any clue of what am I doing wrong?

@genotrance
Copy link
Collaborator

Pass flags = '-d' to print out some debug info. Will tell you which struct it is struggling with.

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