0

Sorry for this basic question :)

I have a very simple project with one cpp file:

#include <iostream>
#include <GLFW/glfw3.h>


int main() {
glfwInit();
return 0;
}

I added the path of .h file to proj-> properties-> C/C++-> Additional include directories

I added the path of .lib file to proj-> properties-> Linker-> General-> Additional Library Directories

I added the name of lib file to proj-> properties-> Linker-> Input-> Additional Dependencies

But it doesn't work :(

I can't build theproject.

The error is :

"Error 1 error LNK2019: unresolved external symbol _glfwInit referenced in function _main ...\OGL\first.obj OGL "

What could be a problem ?

Thank you !

Matvey
  • 163
  • 2
  • 10
  • possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – NathanOliver Jun 02 '15 at 17:27
  • Most likely, you added the wrong `.lib` file in the Linker's Additional dependencies. – CristiFati Jun 02 '15 at 18:00
  • NathanOliver, thanks. CristiFati, How can I know which lib should I add exactly? In other words how can I know what functions the specific lib contains? – Matvey Jun 03 '15 at 05:08
  • You didn't write what 'the name of the lib' you used is - is it glew32.lib? Does the bitness (32 / 64) of the one you link in match your executable? One possible way to know which functions a lib implements is dumpbin /symbols. – Ofek Shilon Jun 03 '15 at 10:42

0 Answers0