Build fail/missing file


#1

Hi there,
taking my first steps with the NAP framework, really excited to see where this might lead!
When running through the “Getting started” section on the site: https://www.napframework.com/doxygen/d1/d66/getting_started.html#compile_run, when building in XCode, the build fails as it cannot find the ‘imguiservice.h’ file. Checked “NAP-0.4.4-macOS/include” and there is no imguiservice to be found.
Any suggestions anyone?

From Xcode console:
newproject Group
Lexical or Preprocessor Issue Group
/Users/Satan/Documents/NAP/NAP-0.4.4-macOS/projects/newproject/src/newprojectapp.h:9:10: ‘imguiservice.h’ file not found
/Users/Satan/Documents/NAP/NAP-0.4.4-macOS/projects/newproject/src/newprojectapp.cpp:1:10: In file included from /Users/Satan/Documents/NAP/NAP-0.4.4-macOS/projects/newproject/src/newprojectapp.cpp:1:


#2

Oh, no, the ‘imguiservice.h’ is included in ‘NAP-0.4.4-macOS/modules’.


#3

Hi @differencetones, welcome to the community!

I was unfortunately unable to reproduce your issue on macOS Catalina, using a mac mini, fresh download and following instructions.

imguiservice.h is part of the mod_napimgui module, which is a dependency of mod_napparametergui. This module is declared as a required module in the project info:

{
    "Type": "nap::ProjectInfo",
    "mID": "ProjectInfo",
    "Title": "NewProject",
    "Version": "0.1.0",
    "RequiredModules": [
        "mod_napapp",
        "mod_napcameracontrol",
        "mod_napparametergui",
        "mod_newproject"
    ],
....
}

The build system should therefore automatically add mod_napimgui as a dependency to your project. Do you see it in the modules section in Xcode?

It’s also worth checking if the include directive is added to your project:

Another question, do the demos work? All of them use the mod_napimgui module, including the nap::IMGuiService.


#4

Hi!
Thanks for that! And thanks for the reply! I thrashed the project and made a new one, and realised that I had stupidly edited the project.json and not the modules.json. After editing the correct file, it builds. The demos also build without issues (it’s all me!).
But, there are 21 other different errors, from “Shell invocation script error” and no empty window pops up.


#5

Changed some settings in Xcode and it builds with no errors! However, there is no empty window that pops up, and the project.json cannot be loaded into Napkin. Feels like there is something pretty simple causing this issue, but can’t quite figure it out…


#6

Napkin only loads release builds, so make sure you’re building a release version of the application or demo. I recommend getting ‘helloworld’ to compile and run before starting your own project.

You must also run the unquarantine_framework.command after downloading and extracting the nap binary release, if you haven’t done that already:

NAP 0.4.4 supports macOS Catalina with XCode 11.7. Although NAP is known to work on other macOS releases, Catalina is the current supported platform. Other versions of XCode are not supported at this moment.

Follow these steps for a guided installation:

    - Extract the release by double clicking NAP-0.4.4-macOS.zip in Finder
    - Ctrl-click on tools/unquarantine_framework.command and select Open to remove the framework from macOS' Gatekeeper quarantine (see note below)
    - In NAP-0.4.4-macOS/tools run check_build_environment to guide you through installing prerequisites, following the instructions

What macOS version and architechture are your targeting? We don’t support M1 at the moment, only x86 (intel) together with Catalina, although macOS big sur is known to work as well. Regarding the launching of the window, can you provide us with the terminal output? Should read something like this:

[debug] Looking for project.json in '/Users/lala/Downloads/NAP-0.4.4-macOS/demos/helloworld/bin/Release'...
[debug] Looking for project.json in '/Users/lala/Downloads/NAP-0.4.4-macOS/projects/helloworld'...
[debug] Looking for project.json in '/Users/lala/Downloads/NAP-0.4.4-macOS/demos/helloworld'...
[debug] Found '/Users/lala/Downloads/NAP-0.4.4-macOS/demos/helloworld/project.json'...
[info] Loading project 'HelloWorld' ver. 1.0.0 (/Users/lala/Downloads/NAP-0.4.4-macOS/demos/helloworld)
[debug] Module loaded: mod_napmath
[debug] Module loaded: mod_napscene
[debug] Module loaded: mod_napinput
[debug] Module loaded: mod_napcolor
[debug] Module loaded: mod_napparameter
[debug] Module loaded: mod_napapp
[debug] Module loaded: mod_napfont
[debug] Module loaded: mod_naprender
[debug] Module loaded: mod_napsdlinput
[debug] Module loaded: mod_napimgui
[debug] Module loaded: mod_napcameracontrol
---------------------------------------
[info] Initializing service: nap::SceneService
---------------------------------------
[info] Initializing service: nap::InputService
----------------------------------------
[info] Initializing service: nap::RenderService
2021-11-11 12:37:06.209169+0100 helloworld[61555:25299640] Metal API Validation Enabled
2021-11-11 12:37:06.341960+0100 helloworld[61555:25300084] flock failed to lock maps file: errno = 35
2021-11-11 12:37:06.342664+0100 helloworld[61555:25300084] flock failed to lock maps file: errno = 35
[info] Display: 0, Philips 236VL, ddpi: 96.0, hdpi: 96.0, vdpi: 96.0, min: 0-0, max: 1920-1080
[info] Vulkan instance version: 1.2.141
[info] Vulkan requested version: 1.0.0
[info] Found 1 GPU(s):
[info] 0: Intel Iris Graphics, type: Integrated, version: 1.0
[info] 0: Compatible queue found at index: 0
[warn] Unable to find preferred device, selecting first compatible one
[info] Selected device: 0
[info] Max number of rasterization samples: 8
[info] Sample rate shading: Supported
[info] Anisotropic filtering: Supported
[info] Max anisotropic filter samples: 8
[info] Wide lines: Not Supported
[info] Large points: Supported
[info] Non solid fill mode: Supported
[info] Applying device extension: VK_KHR_maintenance1
[info] Applying device extension: VK_KHR_swapchain
--------------------------------------
[info] Initializing service: nap::FontService
---------------------------------------
[info] Initializing service: nap::IMGuiService
-------------------------------------------
[info] Initializing service: nap::ParameterService
------------------------------------------
[info] Initializing service: nap::SDLInputService
------------------------------------------
[info] loading font: fonts/Montserrat-Light.otf
[info] Window0: Created 3 swap chain images

#7

Working on 10.15.7 Catalina and Xcode 11.7. Just reinstalled Xcode commandline tools.
Sorry about this, been a long time since I worked with Xcode. Upgraded the OS recently to work on this framework.

The tools/unquarantine_framework.command done.
The check_build_environment done and pass.
Hello world demo built and runs, no problems.

In XCode:
Setting deployment target to 10.15, and Use to release.
First time: builds, no errors but no pop up window.
Regenerate.
Second time: builds, errors (see screenshot).
Both times no terminal output in Xcode.

Screenshot from build settings:


#8

I think you have selected the wrong target in XCode, try selecting newproject instead of install and press Run. You should also not have to explicitly select a macOS Deployment target (I never had to).


#9

Selecting targets/newproject builds successfully but still throws up the 21 errors. An orange hammer as well:


#10

Sorry, but from what I see you’re building the ‘install’ target instead of ‘newproject’ (Build install: Succeeded). Click on ‘install’ and select ‘newproject’ instead:

You can also edit the scheme there, click on ‘Edit Scheme’ and select ‘Release’. This target you can actually run, because it is the actual application:

If everthing goes well Xcode should launch the application after a successful build and show the terminal output. Alternatively, after building, you can go to the bin directory inside your newproject directory and launch the executable from there: ./newproject


#11

Facepalm.
Yes, I knew it was something simple, thanks, I was looking at the wrong place in the Xcode-project. It works now!
Thanks for all your patient help!
Off I go exploring!


#12

Glad it works! You should be able to build and run every demo and project now. When you’re ready to distribute your app, run ./package (from within the project directory) to package your project for distribution.

The demos are a great place to start. I also recommend reading the online docs, especially ‘Napkin’, ‘System’ and ‘Resources’. Don’t forget to build your projects in release mode if you want to edit them using Napkin. Napkin loads the release binaries, not debug ones. You can change the Build Configuration by selecting edit scheme in XCode.

Cheers!


#13

Thanks!
Looking forwards to getting in deep!