floooh / oryol-nuklear

Integrate Nuklear UI with Oryol engine
MIT License
5 stars 2 forks source link

-lNKUI link problem on xcode #1

Open joeld42 opened 7 years ago

joeld42 commented 7 years ago

Hey, this is probably me misunderstanding some fips thing, but I'm having a problem with the linking on this, on mac/xcode. If I follow the instructions in README.md for integrating this in, for example, the oryol-test-app project, I get the following linker error: ld: library not found for -lNKUI And the NKUI library is not added to the project. I can work around this by manually adding the path where libNKUI.a is built to the xcode project but I'm not sure what is different between this and oryol-samples (which does build, and includes the full path to the NKUI library). Thanks! (and if there's a better place to ask silly fips/oryol questions, please let me know)

floooh commented 7 years ago

Hi, I also just tried that (add NKUI to the oryol-test-app), and I think the problem is that the oryol-test-app doesn't use auto-imports (which the readme sort-of expects since auto-import is the default).

Look in the oryol-test-app/fips.yml, there's this block at the start:

policies:
    no_auto_import: true

If this is set, all imported modules must be added manually to the toplevel CMakeLists.txt file like this (I had to add 2 lines here, fips_import_oryol_Input() and fips_import_oryol_nuklear_NKUI():

fips_import_oryol_Core()
fips_import_oryol_Gfx()
fips_import_oryol_Assets()
fips_import_oryol_Resource()
fips_import_oryol_Input()
fips_import_oryol_nuklear_NKUI()

After that I was able to link.

Another option is to remove the no_auto_import: true block, and all fips_import_xxx (and fips_ide_group) from the toplevel CMakeLists.txt file. This will pull in more code into the Xcode project then strictly needed (all Oryol modules for instance), but it's easier to setup.

However, I just found out that you need to remove the import of Oryol from the fips.yml file in this case in the fips.yml file, so that only the oryol-nuklear import remains, otherwise the automatic import order will be wrong (oryol-nuklear will be imported before oryol, which will cause errors because the oryol_shader() cmake macro isn't found.

I'll write a fips ticket for myself for this issue.

But I hope the fix above (adding the 2 missing manual imports) works for you anyway :)

I think the best place to write such tickets is centrally in the Oryol repository btw.

Cheers, -Floh.

joeld42 commented 7 years ago

Thanks for the clear explanation! I almost had it but the shaders cmake thing threw me off. :) It's working now with the added import statement.