@mratsim, so maybe its a nimble problem to setup compilation behavior properly, so you can use just header:"" without any hacks with {.passC.}.
2018-02-09 09:58:48

I tried to import a C file, that includes GLFW, in "test.nim", like this but I fail.


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

// Just for quick testing.
void version()
  printf("%s\n", glfwGetVersionString());


#ifndef TEST
#define TEST

#include <GLFW/glfw3.h>

void version();



{.link: "test.o".}

proc version() {.importc: "version".}


And finally the build commands (all files are in the same folder)

all: test.o
        nim c --passC:'`pkg-config glfw3 --static --cflags --libs`' test.nim

test.o: test.c
        gcc -Wall -c test.c

All GLFW symbols in the C file are "undefined references". I tried to build in full C (with à "main()"), this "pkg-config" works fine. Did I miss something ?

2018-02-09 22:18:44
I solved this by using "--passL" instead of "--passC "
2018-02-11 21:30:00