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

Building for macOS / OSX #13

Open
tcfunk opened this issue Jan 12, 2017 · 4 comments
Open

Building for macOS / OSX #13

tcfunk opened this issue Jan 12, 2017 · 4 comments

Comments

@tcfunk
Copy link

tcfunk commented Jan 12, 2017

Hi I was wondering if you knew any special steps I might need to take to build this library correctly for Mac? These were the steps I took:

  1. Check out v1.2
  2. cmake .
  3. make
  4. cp nuklear.so to my project directory
  5. Include nuklear with nk = require 'nuklear'

However when I try to run nk.init() I get the following:

Error: main.lua:16: attempt to call field 'init' (a nil value)
stack traceback:
        main.lua:16: in function 'load'
        [string "boot.lua"]:439: in function <[string "boot.lua"]:435>
        [C]: in function 'xpcall'

I tried checking what keys existed in the nk table, and printing those out gave me:

0       function: 0x15d32e50

Calling that function with nk[0]() produced:

Error: attempt to compare string with function
stack traceback:
        [C]: at 0x0f9c2960
        main.lua:17: in function 'load'
        [string "boot.lua"]:439: in function <[string "boot.lua"]:435>
        [C]: in function 'xpcall'

Am I missing something obvious? Any help is appreciated :) Thanks for the great library.

@karai17
Copy link

karai17 commented Jan 14, 2017

nuklear is now instanced so you can have multiple UI states. I think the readme just hasn't been updated yet.

local nk = require "nuklear"
local ui = nk.newUI()

@tcfunk
Copy link
Author

tcfunk commented Jan 17, 2017

So weirdly it seems the library works as expected on my older macbook pro, using the old nk.init() method. (I have the v1.2 branch checked out).

However it doesn't work on my newer macbook pro using the same nuklear.so

It also doesn't work if I build the nuklear.so on the newer laptop. Not sure what's going on 🙁

@keharriso
Copy link
Owner

This is indeed very weird. Does this still happen with the latest release? Unfortunately I'm unable to test the code on Mac OS.

@sashalemon
Copy link

Here's a datapoint: with the Love from Cask, on 14.14 (Mojave) with an older MacBook Air, and using the source from HEAD, the example in the Readme doesn't crash and seems to work as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants