g++ - Trouble Compiling C++ (with GLFW) -


i've written simple program using glfw3 , believe i've linked applicable (static) libraries , included header file correctly.

#include "main.h" #include <gl/glew.h> #include <glfw/glfw3.h> #include <iostream> using namespace std;  main::main() {     if (glfwinit()) {         glfwwindow* window = glfwcreatewindow(640, 480, "woo", null, null);          glfwdestroywindow(window);     } }  int main() {     int val = 0;     main* test = new main();     return val; }  main::~main() {     // todo auto-generated destructor stub } 

below command line output:

23:20:58 **** incremental build of configuration debug project void **** info: internal builder used build g++ -l../lib -static -o void main.o -lglfw3 -lgdi32 -lglew32 -lopengl32  main.o: in function `zn4mainc2ev': g:\eclipse\cpp workspace\void\debug/../main.cpp:15: undefined reference `glfwinit' g:\eclipse\cpp workspace\void\debug/../main.cpp:16: undefined reference `glfwcreatewindow' g:\eclipse\cpp workspace\void\debug/../main.cpp:18: undefined reference `glfwcreatewindow' g:\eclipse\cpp workspace\void\debug/../main.cpp:20: undefined reference `glfwdestroywindow' collect2.exe: error: ld returned 1 exit status  23:20:59 build finished (took 205ms) 

i've been looking on google , stackoverflow , must missing something. libraries 32 bit , i'm trying compile 64 bit, though i'm not sure how check this.
also, you'll notice i've included glew header file. if call functions included in that, defined , don't cause problems. @ appreciated.

update: after attempting build 32 bit library glfw (libglfw3.a), got new error. ../lib\libglfw3.a(init.c.obj):init.c:(.text+0x49): undefined reference `__ms_vsnprintf'

hello subtlepseudonym,

the error : "../lib\libglfw3.a(init.c.obj):init.c:(.text+0x49): undefined reference `__ms_vsnprintf'"

in opinion due fact trying build code on linux, glfw binaries have windows platform.

i assume on linux/unix platform see compiler g++.

"__ms_vsnprintf" present in glfw libraries built windows platform.

i tried building code @ end little modification , building, using "glew" , "glfw" locally, , worked perfectly.

if still facing issue add details.


Comments