Code Monkey home page Code Monkey logo

Comments (10)

dariolah avatar dariolah commented on September 1, 2024

Sorry about that, haven't tested it on Windows.
Error is from Linux specific code for dlopen workaround in 'niup'.
Try with latest 'niup' code: 3.27.3. I've committed fix but haven't tested it.

Or you can manually remove block of code from beginning of niup.nim, between lines:

# BEGIN workaround ...
...
# END workaround

from nim-iup-examples.

super-tomcat avatar super-tomcat commented on September 1, 2024

Hello,
I made the suggestions you said in that i removed the code between

BEGIN workaround ...

...

END workaround

And this did allow most of the examples to compile and work, however i got these errors.....

All examples 4_1 to 4_4 do not work because there is no niupext ?

simple_notepad.nim does not work because it looks for libiupimglib.dll ?

scintilla_notepad.nim does not compile because it says:
(28,15) Error: type mismatch: got but expected 'clong = int32'

from nim-iup-examples.

dariolah avatar dariolah commented on September 1, 2024

'niupext' is part of 'niup' package. In same folder where you removed code should be file niupext.nim. If it is missing please upgrade/install 'niup' with nimble.

Name of dll is wrong, prefix 'lib' should be removed. You can modify niup.nim and change references from 'lib*.dll' to '*.dll'. In this case it should be 'iupimglib.dll'.

For scintilla_notepad you'll need to rename 'libiup_scintilla.dll' to 'iup_scintilla.dll' in niup.nim.

From first error report I see that you are using nim 0.19.2. Please upgrade to 0.20.2 and try again.

If problem persists I'll install windows dev environment and try it.

from nim-iup-examples.

super-tomcat avatar super-tomcat commented on September 1, 2024

Hi, first of all thanks for all the help... I am going through your last message but here are some answers for now...

  1. ignore where it says I am using Nim 0.19.2, that is just a folder name from when I first installed Nim… I always update that folder with the current Nim so I am actually using the latest version which for me is version...0.20.2

  2. You say that the latest version of niup is version 3.27.3, yet when ever I install it with Nimble (tried a few times now) I only get version 3.27.2 ?

  3. Also each time I install niup with Nimble I look in the package folder and there is:

nimblemeta.json
niup.nim
niup.nimble

But no niupext.nim file ?

from nim-iup-examples.

super-tomcat avatar super-tomcat commented on September 1, 2024

After more tests i edited these to get rid of the lib prefix on the dll's....

when defined(windows):
const
libiupSONAME = "iup.dll"
libiupcdSONAME = "iupcd.dll"
libiupcontrolsSONAME = "iupcontrols.dll"
libiupglcontrolsSONAME = "iupglcontrols.dll"
libiupglSONAME = "iupgl.dll"
libiupimglibSONAME = "iupimglib.dll"
libiupimSONAME = "iupim.dll"
libiup_mglplotSONAME = "iup_mglplot.dll"
libiup_plotSONAME = "iup_plot.dll"
libiup_scintillaSONAME = "iup_scintilla.dll"
libiuptuioSONAME = "iuptuio.dll"
libiupwebSONAME = "iupweb.dll"

And simple_notepad.nim now compiles and works fine.

So its just scintilla_notepad.nim that i cannot get to compile, it stops on line 28 saying:

(28, 15) Error: type mismatch: got <int> but expected 'clong = int32'

from nim-iup-examples.

dariolah avatar dariolah commented on September 1, 2024

I've commited fix in scinetilla_notepad.nim
This whole proc setMarkerMask looks redundant. Probably planned for future usage but in this case is overhead.
Problem is probably in how windows and linux C compilers define long type (32 or 64 bit).

Regarding 'niup' upgrade to latest version
I don't know exactly how nimble works. Manual options are:

  1. delete 'niup' folder and reinstall with nimble
  2. or download from github and overwrite contents of 'niup' folder

scinetilla_notepad.nim is in github, update it same sa niup package.

I've tested it by cross compiling on Linux with Mingw and running it with wine:

  • iup-3.27_Win64_dllw6_lib.zip
  • x86_64-w64-mingw32-gcc, 7.3-win32 20180312

PS although examples are rewrites of official tutorial in C, code is not 100% same. I've made small changes possibly some bugs. This proc setMarkerMask is example, result of quick-n-dirty copy-paste, without analyzing it.

from nim-iup-examples.

super-tomcat avatar super-tomcat commented on September 1, 2024

Hello, I still only get version 3.72.2 when I install with Nimble? And that's after doing Nimble refresh and also deleting the niup folder and reinstalling.

I tried your new version scintilla_notepad.nim, which does compile but pops up a message box saying:

Error
could not load: iup_scintilla.dll

This is strange because the iup_scintilla.dll is in the same folder as scintilla_notepad.nim, so why it cannot find it I don't know??

from nim-iup-examples.

dariolah avatar dariolah commented on September 1, 2024

I forgot to push git tag. Try now with nimble.

I had to copy dll-s from /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/ to local folder, where iup dll-s are:

  • libgcc_s_seh-1.dll
  • libstdc++-6.dll

These are part of mingw compiler and iup_scintilla.dll sepends on them.

https://stackoverflow.com/questions/6404636/libstdc-6-dll-not-found/6404637#6404637

from nim-iup-examples.

super-tomcat avatar super-tomcat commented on September 1, 2024

That's it, now updated to 3.72.4 via Nimble.

You still need to change:

when defined(Windows):
const
libiupSONAME = "iup.dll"
libiupcdSONAME = "libiupcd.dll"
libiupcontrolsSONAME = "libiupcontrols.dll"
libiupglcontrolsSONAME = "libiupglcontrols.dll"
libiupglSONAME = "libiupgl.dll"
libiupimglibSONAME = "libiupimglib.dll"
libiupimSONAME = "libiupim.dll"
libiup_mglplotSONAME = "libiup_mglplot.dll"
libiup_plotSONAME = "libiup_plot.dll"
libiup_scintillaSONAME = "libiup_scintilla.dll"
libiuptuioSONAME = "libiuptuio.dll"
libiupwebSONAME = "libiupweb.dll"

to

when defined(Windows):
const
libiupSONAME = "iup.dll"
libiupcdSONAME = "iupcd.dll"
libiupcontrolsSONAME = "iupcontrols.dll"
libiupglcontrolsSONAME = "iupglcontrols.dll"
libiupglSONAME = "iupgl.dll"
libiupimglibSONAME = "iupimglib.dll"
libiupimSONAME = "iupim.dll"
libiup_mglplotSONAME = "iup_mglplot.dll"
libiup_plotSONAME = "iup_plot.dll"
libiup_scintillaSONAME = "iup_scintilla.dll"
libiuptuioSONAME = "iuptuio.dll"
libiupwebSONAME = "iupweb.dll"

I then copied the .dlls you said to the folder with the iup dlls and scintilla_notepad.nim

And it compiles and runs 👍

from nim-iup-examples.

dariolah avatar dariolah commented on September 1, 2024

Ok, last commit should be final for this issue, 3.27.5. Had it fixed and lost it :/

Thank you :)

from nim-iup-examples.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.