Reputation: 101
I have tried two methods to the best of my capacity:
Both of them don't work
I have additionally linked following .lib for x64 Debug in both the cases:
I think the main errors I get are:
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol NK_MEMCPY NuklearTest D:\vs_project\NuklearT\NuklearTest\NuklearTest\Nuklear.lib(nuklear_buffer.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol NK_MEMSET NuklearTest D:\vs_project\NuklearT\NuklearTest\NuklearTest\Nuklear.lib(nuklear_context.obj) 1
Upvotes: 0
Views: 1246
Reputation: 531
Nuklear is self-contained in a single header file. The files in src
aren't designed to be built directly and should be packed into the proper library header via src/paq.bat
or src/paq.sh
, this means that src/nuklear.h
should not be included in your projects. A pre-built header that you could use without having to run any scripts whatsoever is in the project's main directory.
If you'd like to static link this library just build the packed header and then link it in your project.
nuklear.h
can be included in either implementation mode or header-only mode, the former must be only included once otherwise there'll be several linking errors and the latter can be used when including in other files. Also before every inclusion of the header all the optional flags should be redefined.
To include it in implementation mode the macro NK_IMPLEMENTATION
should be defined before including it.
#define NK_IMPLEMENTATION //< Include nuklear in implementation mode
#include "nuklear.h"
It's not required to link any other libraries, when using any of the functions of Nuklear. But in order to render anything a backend is needed, e.g. OpenGl or Allegro5, and it should be set up as you would in any other applications.
Abstractions aren't provided for render/event backends (no direct OS or window handling is done by the library), this means that any backend can be used to render the GUI generated by Nuklear not only the default ones provided by your system. Look in the API documentation for how to implement the rendering 'engine' and the input handling of your project.
There are several demonstrations in demo
for different backends. Those demo headers can be included in your project for most of the handling, and the remaining can be adapted from the main.c
file in the directory.
There are also examples of how to use each of the features in this folder (especially in demo/overview.c
).
Upvotes: 1