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

symbol(s) not found for architecture x86_64 #82

Closed
MasterSwift opened this issue Mar 12, 2020 · 3 comments
Closed

symbol(s) not found for architecture x86_64 #82

MasterSwift opened this issue Mar 12, 2020 · 3 comments

Comments

@MasterSwift
Copy link

MasterSwift commented Mar 12, 2020

hi, im just testing out this framework. running on Mac OS 10.15, Xcode. Need plain English instructions in getting nuklear setup.

"symbol(s) not found for architecture x86_64". failed couple times in properly using the linker.

#include "nuklear.h"
#include <stdio.h>

enum {EASY, HARD};
static int op = EASY;
static float value = 0.6f;
static int i =  20;

struct nk_context ctx;
struct nk_user_font font;


void setup() {
    nk_init_default(&ctx, &font);

    if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220),
        NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
        // fixed widget pixel width
        nk_layout_row_static(&ctx, 30, 80, 1);
        if (nk_button_label(&ctx, "button")) {
            // event handling
        }
        // fixed widget window ratio width
        nk_layout_row_dynamic(&ctx, 30, 2);
        if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY;
        if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD;
        // custom widget pixel width
        nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
        {
            nk_layout_row_push(&ctx, 50);
            nk_label(&ctx, "Volume:", NK_TEXT_LEFT);
            nk_layout_row_push(&ctx, 110);
            nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
        }
        nk_layout_row_end(&ctx);
    }


    nk_end(&ctx);

}



int main(int argc, const char * argv[]) {
    setup();
    
}

Undefined symbols for architecture x86_64:
  "_nk_begin", referenced from:
      _setup in main.o
  "_nk_button_label", referenced from:
      _setup in main.o
  "_nk_end", referenced from:
      _setup in main.o
  "_nk_init_default", referenced from:
      _setup in main.o
  "_nk_label", referenced from:
      _setup in main.o
  "_nk_layout_row_begin", referenced from:
      _setup in main.o
  "_nk_layout_row_dynamic", referenced from:
      _setup in main.o
  "_nk_layout_row_end", referenced from:
      _setup in main.o
  "_nk_layout_row_push", referenced from:
      _setup in main.o
  "_nk_layout_row_static", referenced from:
      _setup in main.o
  "_nk_option_label", referenced from:
      _setup in main.o
  "_nk_rect", referenced from:
      _setup in main.o
  "_nk_slider_float", referenced from:
      _setup in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@dumblob
Copy link
Member

dumblob commented Mar 12, 2020

Please see Building in the readme: https://github.com/Immediate-Mode-UI/Nuklear#building (feel free to make a PR to e.g. rename the paragraph to something more descriptive like Usage & building).

@MasterSwift
Copy link
Author

close

@dumblob
Copy link
Member

dumblob commented May 12, 2020

I hope you made it to build. If not, just take any demo or example designated for your system and it should compile 😉.

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

No branches or pull requests

2 participants