KeepCoolWithCoolidge / nimlibxlsxwriter

Nim bindings for libxlsxwriter
26 stars 4 forks source link

Wrong path to xlsxwriter (Error: cannot open 'xlsxwriter') #2

Closed ThomasTJdev closed 6 years ago

ThomasTJdev commented 6 years ago

Prerequisites: nimble install nimlibxlsxwriter nimble setup nimlibxlsxwriter

Running: nim c -r testfile.nim was resulting in Error: cannot open 'xlsxwriter'. This was solved by changing the import path to: import nimlibxlsxwriter/xlsxwriter.

Folderstructure: The folder structure was created by running the setup: nimble/pkgs/nimlibxlsxwriter-0.1.0/nimlibxlsxwriter/xlsxwriter.nim

Testfile: testfile.nim:

#import xlsxwriter => This gives an error
import nimlibxlsxwriter/xlsxwriter => This is okay
proc main() =
  var workbook: ptr lxw_workbook = workbook_new("demo.xlsx")
  var worksheet: ptr lxw_worksheet = workbook_add_worksheet(workbook, nil)
  # .. Rest of the example ..
  discard workbook_close(workbook)
main()
KeepCoolWithCoolidge commented 6 years ago

Ah ya. This is true. Well, this is my first attempt at using genotrace's nimgen. I shall fix the imports for the tests and change the README file. I might ultimately change the cfg file so that the installation process moves the xlsxwriter.nim file upward structurally and import xlsxwriter will suffice.

ThomasTJdev commented 6 years ago

But besides that - it's a nice package! Good job!