title: Undefined reference despite netbeans showing function in code-completion
body: <p>I am new to c++, but I got some programming experience in other programming languages, so it is no problem to read c++ code with a little googling.</p>
  
  <p>For an uni project I need to write a game and we are supposed to use one of their libraries, called ACGL. We also use GLFW, which seems to work fine. (I copied the correct files of the GLFW-binaries to C:\MinGW\include and C:\MinGW\lib and added the .dll to the folder the main.cpp is located in)</p>
  
  <p>I am using MinGW with Netbeans 8.0.1 for Windows 7 32-bit.
  I downloaded ACGL and put the folders inside the include folder in C:\MinGW\include.</p>
  
  <p>Now I have some code in my main.cpp:</p>
  
  <pre><code>//#define ACGL_OPENGL_VERSION_32
  //#define ACGL_OPENGL_PROFILE_CORE
  #include &lt;ACGL/ACGL.hh&gt;
  //#include &lt;ACGL/OpenGL/GL.hh&gt;
  #include &lt;GLFW/glfw3.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  
  static void error_callback(int error, const char* description) {
      fputs(description, stderr);
  }
  
  static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) {
      if (key == GLFW_KEY_ESCAPE &amp;&amp; action == GLFW_PRESS)
          glfwSetWindowShouldClose(window, GL_TRUE);
  }
  
  int main(void) {
      GLFWwindow* window;
      glfwSetErrorCallback(error_callback);
      if (!glfwInit())
          exit(EXIT_FAILURE);
      window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
      if (!window || !(ACGL::init(true))) {
          glfwTerminate();
          exit(EXIT_FAILURE);
      }
      glfwMakeContextCurrent(window);
      glfwSetKeyCallback(window, key_callback);
      while (!glfwWindowShouldClose(window)) {
          float ratio;
          int width, height;
          glfwGetFramebufferSize(window, &amp;width, &amp;height);
          ratio = width / (float) height;
          glViewport(0, 0, width, height);
          glClear(GL_COLOR_BUFFER_BIT);
          glMatrixMode(GL_PROJECTION);
          glLoadIdentity();
          glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f);
          glMatrixMode(GL_MODELVIEW);
          glLoadIdentity();
          glRotatef((float) glfwGetTime() * 50.f, 0.f, 0.f, 1.f);
          glBegin(GL_TRIANGLES);
          glColor3f(1.f, 0.f, 0.f);
          glVertex3f(-0.6f, -0.4f, 0.f);
          glColor3f(0.f, 1.f, 0.f);
          glVertex3f(0.6f, -0.4f, 0.f);
          glColor3f(0.f, 0.f, 1.f);
          glVertex3f(0.f, 0.6f, 0.f);
          glEnd();
          glfwSwapBuffers(window);
          glfwPollEvents();
      }
      glfwDestroyWindow(window);
      glfwTerminate();
      exit(EXIT_SUCCESS);
  }
  </code></pre>
  
  <p>Essentially the GLFW example(which runs fine btw) with the ACGL include at top and the ACGL::init() function in the correct place.</p>
  
  <p>Everything seems fine, and Netbeans is able to find  (Ctrl-Click) and it also finds the init function in the corresponding ACGL.cc (Ctrl-Click)</p>
  
  <p>However when I try to compile the project with Netbeans the following error occurs:</p>
  
  <pre><code>"/C/MinGW/MSYS/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
  make.exe[1]: Entering directory `/c/Users/Tarek/Desktop/Netbeans Workspace/swpp-ws-14-15-a/MarbleGame'
  rm -f -r build/Debug
  rm -f dist/Debug/MinGW-Windows/marblegame.exe
  make.exe[1]: Leaving directory `/c/Users/Tarek/Desktop/Netbeans Workspace/swpp-ws-14-15-a/MarbleGame'
  
  CLEAN SUCCESSFUL (total time: 2s)
  "/C/MinGW/MSYS/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
  make.exe[1]: Entering directory `/c/Users/Tarek/Desktop/Netbeans Workspace/swpp-ws-14-15-a/MarbleGame'
  "/C/MinGW/MSYS/1.0/bin/make.exe"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/marblegame.exe
  make.exe[2]: Entering directory `/c/Users/Tarek/Desktop/Netbeans Workspace/swpp-ws-14-15-a/MarbleGame'
  mkdir -p build/Debug/MinGW-Windows
  rm -f "build/Debug/MinGW-Windows/main.o.d"
  g++    -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/main.o.d" -o build/Debug/MinGW-Windows/main.o main.cpp
  mkdir -p dist/Debug/MinGW-Windows
  g++     -o dist/Debug/MinGW-Windows/marblegame build/Debug/MinGW-Windows/main.o -lglfw3dll -lopengl32
  build/Debug/MinGW-Windows/main.o: In function `main':
  C:\Users\Tarek\Desktop\Netbeans Workspace\swpp-ws-14-15-a\MarbleGame/main.cpp:24: undefined reference to `ACGL::init(bool)'
  collect2.exe: error: ld returned 1 exit status
  make.exe[2]: *** [dist/Debug/MinGW-Windows/marblegame.exe] Error 1
  make.exe[2]: Leaving directory `/c/Users/Tarek/Desktop/Netbeans Workspace/swpp-ws-14-15-a/MarbleGame'
  make.exe[1]: *** [.build-conf] Error 2
  make.exe[1]: Leaving directory `/c/Users/Tarek/Desktop/Netbeans Workspace/swpp-ws-14-15-a/MarbleGame'
  make.exe": *** [.build-impl] Error 2
  
  BUILD FAILED (exit value 2, total time: 4s)
  </code></pre>
  
  <p>How can it be, that Netbeans finds the reference but the compiler doesn't?
  I don't have any .a files to copy to C:\MinGW\lib so I don't know if I maybe have to link stuff another way for the compiler? The init function is defined in a namespace called "ACGL", but I call ACGL::init() so this can't be a problem either, right? What am I not seeing here?</p>
  
  <p>If you need anything else (except for the code of ACGL - I don't think we're allowed to share that) please comment and I try to provide it.</p>
  
  <p>Thanks for your help.</p>