Jump to content
  • Advertisement

VCAlfox

Member
  • Content count

    24
  • Joined

  • Last visited

Community Reputation

148 Neutral

About VCAlfox

  • Rank
    Member
  1. Thanks a lot for all the answers guys, tomorrow I'l try to do all
  2. Hi guys, I have this problem: I have a point as vector3 (x,y,z) in 3d space, and its direction (vector3 x,y,z). In the scene there are also many triangles eachone with 3 vertex (each vertex as a vector3)   this point moves along its direction, how can I know: 1. what triagle is hitted (I have many of them) 2. where exactly is hitted, as x,y,z coordinates   I'm using c++ for my project.   Thanks
  3. hi I tried with xvfb, first of all I installed it sudo apt-get install xvfb than lauched with command xvfb-run ./RayTracing But I receive an error: Ray.cpp Error: Failed to open GLFW window. This is the output that I write when glfwCreateWindow() fails window = glfwCreateWindow( WINDOW_WIDTH, WINDOW_HEIGHT, "Ray Tracing - Alfonso Oricchio", NULL, NULL); // Open a window and create its OpenGL context if( window == NULL ){ fprintf( stderr, "Ray.cpp Error: Failed to open GLFW window.\n" ); glfwTerminate(); return -1; } So maybe, I have to set up better xvfb-run? with what params?
  4. oh really thanks I'll try as soon as possible
  5. Hi followed Kaptein instruction This is the modified Makefile variables MYINC=-I/isis/AlfonsoOricchio/RayTracing/src/glfw/include/ -I/isis/AlfonsoOricchio/RayTracing/src/glew/include -I/isis/AlfonsoOricchio/RayTracing/src MYCUDAINC=-I/usr/local/cuda-5.5/include/ MYLIB=-L/usr/local/cuda-5.5/lib64/ MYCMD=$(shell pkg-config glfw3 --libs --static glew) -lcudart NVCC=/usr/local/cuda-5.5/bin/nvcc all: myexe myexe: render.o controls.o objloader.o shader.o Ray.o g++ render.o controls.o objloader.o shader.o Ray.o $(MYLIB) $(MYCMD) -o RayTracing Ray.o: Ray.cpp g++ -c $(MYINC) $(MYCUDAINC) Ray.cpp controls.o: controls.cpp g++ -c $(MYINC) controls.cpp objloader.o: objloader.cpp g++ -c $(MYINC) objloader.cpp shader.o: shader.cpp g++ -c $(MYINC) shader.cpp render.o: $(NVCC) -c -arch=sm_20 render.cu clean: rm -rf *o RayTracing Now compiling without errors.  And this is my output for statit linking g++ render.o controls.o objloader.o shader.o Ray.o -L/usr/local/cuda-5.5/lib64/ -L/usr/local/lib -lglfw3 -lrt -lXrandr -lXi -lXxf86vm -lXrender -lXfixes -lGLEW -lGLU -lGL -lm -lXext -lX11 -lpthread -lxcb -lXau -lXdmcp -lcudart -o RayTracing Thanks a lot guys.   I have a different problem now, when I launch the program I have this output: X Error of failed request: BadRRCrtc (invalid Crtc parameter) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 22 (RRGetCrtcGammaSize) Crtc id in failed request: 0x1a98e00 Serial number of failed request: 62 Current serial number in output stream: 62 I believe because the linux server has no monitor so Xrandr fails.   but I think I have to open another post for that. Because this is a different problem, right?
  6. thanks for reply I thought about that, and serching what lib I have to install, I tried to download this sudo apt-get install libglfw3-dev but I receive this error: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package libglfw3-dev
  7. Hi Bregma, I tried as you suggest. But MYCMD=$(shell pkg-config --libs libglfw glew) give me this errors: g++ render.o controls.o objloader.o shader.o Ray.o -L/isis/AlfonsoOricchio/RayTracing/src/lib -L/usr/local/cuda-5.5/lib64/ -lcudart -lglfw -lGLEW -lGLU -lGL -o RayTracing controls.o:controls.cpp:function computeMatricesFromInputs(): error: undefined reference to 'glfwGetCursorPos' controls.o:controls.cpp:function computeMatricesFromInputs(): error: undefined reference to 'glfwSetCursorPos' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwWindowHint' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwCreateWindow' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwMakeContextCurrent' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwSetInputMode' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwSetCursorPos' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwWindowShouldClose' collect2: ld returned 1 exit status
  8. UPDATE2: I solved my problem. the last library to link is -lrt, so the line in my Makefile is now this MYCMD=-lcudart -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi -lrt -lGLEW -lGL I hope this thread can help someone :)
  9. UPDATE: In my Makefile I modify this line as follow MYCMD=-lcudart -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi -lGLEW -lGL now the errors are only 2: /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_time.c.o):x11_time.c:function getRawTime: error: undefined reference to 'clock_gettime' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_time.c.o):x11_time.c:function _glfwInitTimer: error: undefined reference to 'clock_gettime' Maybe I need to link another library, but I don't find anything about that
  10. Hello! I receive a lot of errors when I try to compile my c++ program. I am  on a Ubuntu 12.04 machine, this machine is a server that I control. In order I had: downloaded the source code of GLFW from official site, then followed the instruction cd <glfw-root-dir> mkdir build cd build cmake .. after this in the "build" folder I launched the command make in the folder build/src I found the libglfw3.a and in the glfw folder root the /include folder. I copied all the glfw folder into my project src/ folder,  and also copied libglfw3.a in src/lib folder. In this folder I had also libGLEW.a used to my project too.   I created this Makefile for my project: #variables MYINC=-I/isis/AlfonsoOricchio/RayTracing/src/glfw/include -I/isis/AlfonsoOricchio/RayTracing/src/glew/include -I/isis/AlfonsoOricchio/RayTracing/src MYCUDAINC=-I/usr/local/cuda-5.5/include/ MYLIB=-L/isis/AlfonsoOricchio/RayTracing/src/lib -L/usr/local/cuda-5.5/lib64/ MYCMD=-lcudart -lglfw3 -lGLEW -lGL NVCC=/usr/local/cuda-5.5/bin/nvcc all: myexe myexe: render.o controls.o objloader.o shader.o Ray.o g++ render.o controls.o objloader.o shader.o Ray.o $(MYLIB) $(MYCMD) -o RayTracing Ray.o: Ray.cpp g++ -c $(MYINC) $(MYCUDAINC) Ray.cpp controls.o: controls.cpp g++ -c $(MYINC) controls.cpp objloader.o: objloader.cpp g++ -c $(MYINC) objloader.cpp shader.o: shader.cpp g++ -c $(MYINC) shader.cpp render.o: $(NVCC) -c -arch=sm_20 render.cu clean: rm -rf *o RayTracing But when I run the make, the "myexe" call give me this errors: g++ render.o controls.o objloader.o shader.o Ray.o -L/isis/AlfonsoOricchio/RayTracing/src/lib -L/usr/local/cuda-5.5/lib64/ -lcudart -lglfw3 -lGLEW -lGL -o RayTracing /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwInitGammaRamp: error: undefined reference to 'XRRGetScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwInitGammaRamp: error: undefined reference to 'XRRGetCrtcGammaSize' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwInitGammaRamp: error: undefined reference to 'XRRFreeScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformGetGammaRamp: error: undefined reference to 'XRRGetCrtcGammaSize' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformGetGammaRamp: error: undefined reference to 'XRRGetCrtcGamma' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformGetGammaRamp: error: undefined reference to 'XRRFreeGamma' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformGetGammaRamp: error: undefined reference to 'XF86VidModeGetGammaRampSize' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformGetGammaRamp: error: undefined reference to 'XF86VidModeGetGammaRamp' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformSetGammaRamp: error: undefined reference to 'XRRAllocGamma' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformSetGammaRamp: error: undefined reference to 'XRRSetCrtcGamma' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformSetGammaRamp: error: undefined reference to 'XRRFreeGamma' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformSetGammaRamp: error: undefined reference to 'XF86VidModeSetGammaRamp' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function translateKey: error: undefined reference to 'XkbKeycodeToKeysym' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function translateKey: error: undefined reference to 'XkbKeycodeToKeysym' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function updateKeyCodeLUT: error: undefined reference to 'XkbGetKeyboard' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function updateKeyCodeLUT: error: undefined reference to 'XkbFreeKeyboard' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function getSupportedAtom: error: undefined reference to 'XInternAtom' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XInternAtom' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XInternAtom' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XFree' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XFree' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XFree' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XFree' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XInternAtom' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XF86VidModeQueryExtension' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XRRQueryExtension' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XRRQueryVersion' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XQueryExtension' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XIQueryVersion' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XkbQueryExtension' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XkbSetDetectableAutoRepeat' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XCreatePixmap' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XCreateGC' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XFillRectangle' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XCreatePixmapCursor' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XFreePixmap' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XFreeGC' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function terminateDisplay: error: undefined reference to 'XCloseDisplay' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwGrabXErrorHandler: error: undefined reference to 'XSetErrorHandler' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwReleaseXErrorHandler: error: undefined reference to 'XSync' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwReleaseXErrorHandler: error: undefined reference to 'XSetErrorHandler' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwInputXError: error: undefined reference to 'XGetErrorText' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwPlatformInit: error: undefined reference to 'XInitThreads' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwPlatformInit: error: undefined reference to 'XOpenDisplay' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwPlatformInit: error: undefined reference to 'XrmUniqueQuark' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwPlatformTerminate: error: undefined reference to 'XFreeCursor' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRGetScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRGetCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRGetOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRSetCrtcConfig' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRFreeOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRFreeCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRFreeScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwRestoreVideoMode: error: undefined reference to 'XRRGetScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwRestoreVideoMode: error: undefined reference to 'XRRGetCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwRestoreVideoMode: error: undefined reference to 'XRRSetCrtcConfig' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwRestoreVideoMode: error: undefined reference to 'XRRFreeCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwRestoreVideoMode: error: undefined reference to 'XRRFreeScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRGetScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRGetOutputPrimary' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRGetCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRFreeCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRGetOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRFreeOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRFreeCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRFreeOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRFreeScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitorPos: error: undefined reference to 'XRRGetCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetVideoModes: error: undefined reference to 'XRRGetOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetVideoModes: error: undefined reference to 'XRRFreeOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_time.c.o):x11_time.c:function getRawTime: error: undefined reference to 'clock_gettime' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_time.c.o):x11_time.c:function _glfwInitTimer: error: undefined reference to 'clock_gettime' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function translateChar: error: undefined reference to 'XLookupString' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XCreateColormap' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XCreateWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XChangeProperty' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XSaveContext' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XChangeWindowAttributes' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XSetWMProtocols' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XChangeProperty' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XAllocWMHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XSetWMHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XAllocSizeHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XSetWMNormalHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XAllocClassHint' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XSetClassHint' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XISelectEvents' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XRRSelectInput' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function hideCursor: error: undefined reference to 'XUngrabPointer' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function hideCursor: error: undefined reference to 'XDefineCursor' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function captureCursor: error: undefined reference to 'XGrabPointer' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function showCursor: error: undefined reference to 'XUngrabPointer' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function showCursor: error: undefined reference to 'XUndefineCursor' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XGetScreenSaver' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XSetScreenSaver' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XChangeProperty' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XSendEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XSendEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XRaiseWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XSetInputFocus' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XMoveWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XResizeWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function leaveFullscreenMode: error: undefined reference to 'XSetScreenSaver' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function leaveFullscreenMode: error: undefined reference to 'XChangeProperty' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function leaveFullscreenMode: error: undefined reference to 'XSendEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function processEvent: error: undefined reference to 'XSendEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function processEvent: error: undefined reference to 'XGetEventData' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function processEvent: error: undefined reference to 'XFreeEventData' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function processEvent: error: undefined reference to 'XRRUpdateConfiguration' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwFindWindowByHandle: error: undefined reference to 'XFindContext' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwGetWindowProperty: error: undefined reference to 'XGetWindowProperty' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformDestroyWindow: error: undefined reference to 'XGetSelectionOwner' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformDestroyWindow: error: undefined reference to 'XDeleteContext' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformDestroyWindow: error: undefined reference to 'XUnmapWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformDestroyWindow: error: undefined reference to 'XDestroyWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformDestroyWindow: error: undefined reference to 'XFreeColormap' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowTitle: error: undefined reference to 'Xutf8SetWMProperties' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformGetWindowPos: error: undefined reference to 'XTranslateCoordinates' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformGetWindowPos: error: undefined reference to 'XTranslateCoordinates' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowPos: error: undefined reference to 'XMoveWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowPos: error: undefined reference to 'XFlush' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformGetWindowSize: error: undefined reference to 'XGetWindowAttributes' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowSize: error: undefined reference to 'XResizeWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowSize: error: undefined reference to 'XAllocSizeHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowSize: error: undefined reference to 'XSetWMNormalHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowSize: error: undefined reference to 'XResizeWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowSize: error: undefined reference to 'XFlush' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformIconifyWindow: error: undefined reference to 'XIconifyWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformRestoreWindow: error: undefined reference to 'XMapWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformShowWindow: error: undefined reference to 'XMapRaised' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformShowWindow: error: undefined reference to 'XFlush' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformHideWindow: error: undefined reference to 'XUnmapWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformHideWindow: error: undefined reference to 'XFlush' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformPollEvents: error: undefined reference to 'XPending' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformPollEvents: error: undefined reference to 'XNextEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformWaitEvents: error: undefined reference to 'XPending' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetCursorPos: error: undefined reference to 'XWarpPointer' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(glx_context.c.o):glx_context.c:function _glfwInitContextAPI: error: undefined reference to 'pthread_key_create' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(glx_context.c.o):glx_context.c:function _glfwTerminateContextAPI: error: undefined reference to 'pthread_key_delete' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(glx_context.c.o):glx_context.c:function _glfwPlatformMakeContextCurrent: error: undefined reference to 'pthread_setspecific' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(glx_context.c.o):glx_context.c:function _glfwPlatformGetCurrentContext: error: undefined reference to 'pthread_getspecific' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPushSelectionToManager: error: undefined reference to 'XConvertSelection' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPushSelectionToManager: error: undefined reference to 'XCheckIfEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformSetClipboardString: error: undefined reference to 'XSetSelectionOwner' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformSetClipboardString: error: undefined reference to 'XGetSelectionOwner' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformGetClipboardString: error: undefined reference to 'XGetSelectionOwner' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformGetClipboardString: error: undefined reference to 'XConvertSelection' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformGetClipboardString: error: undefined reference to 'XCheckTypedEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformGetClipboardString: error: undefined reference to 'XDeleteProperty' collect2: ld returned 1 exit status What Can I do?
  11. VCAlfox

    screen view to 3d space

    Hello KulSeran, thanks for reply I changed my code as you suggest: glm::vec3 cd = glm::vec3(0.0,0.0,1.0);//CamGetDirection(); glm::vec3 cp = glm::vec3(0.0,0.0,0.0);//CamGetPosition(); glm::vec4 viewport = glm::vec4(0.0f, 0.0f, WINDOW_WIDTH, WINDOW_HEIGHT); glm::mat4 tmpView = glm::mat4(1.0f);//getViewMatrix(); glm::mat4 tmpProj = glm::mat4(1.0f);//getProjectionMatrix(); glm::vec3 screenPosS = glm::vec3(0.0,0.0,0.0); glm::vec3 screenPosE = glm::vec3((float)WINDOW_WIDTH, (float)WINDOW_HEIGHT,0.0); glm::vec3 screenPosM = glm::vec3((float)WINDOW_WIDTH/2, (float)WINDOW_HEIGHT/2,0.0); glm::vec3 wpS = glm::unProject(screenPosS, tmpView, tmpProj, viewport); glm::vec3 wpE = glm::unProject(screenPosE, tmpView, tmpProj, viewport); glm::vec3 wpM = glm::unProject(screenPosM, tmpView, tmpProj, viewport); printf_s("CDir: %f %f %f\n",cd.x,cd.y,cd.z); printf_s("CPos: %f %f %f\n",cp.x,cp.y,cp.z); printf_s("WPStart: %f %f %f\n",wpS.x,wpS.y,wpS.z); printf_s("WPEnd: %f %f %f\n",wpE.x,wpE.y,wpE.z); printf_s("WMid: %f %f %f\n",wpM.x,wpM.y,wpM.z); I also added the middle screen position glm::vec3 screenPosM = glm::vec3((float)WINDOW_WIDTH/2, (float)WINDOW_HEIGHT/2,0.0); and the output is:   [attachment=23534:out.jpg]   so I think it works. Just a doubt on the Z axis...is normal it's -1?
  12. Hello, this is my problem. I have a camera with an origin point (Vector3 with x, y, z) and its vector3 direction , and a screen width and height. I want to transform each pixel of the screen view in a vector3 in 3d space. I found this code on internet, and adapted to my project: glm::vec3 cd = CamGetDirection(); glm::vec3 cp = CamGetPosition(); glm::vec4 viewport = glm::vec4(0.0f, 0.0f, WINDOW_WIDTH, WINDOW_HEIGHT); glm::mat4 tmpView = getViewMatrix(); glm::mat4 tmpProj = getProjectionMatrix(); glm::vec3 screenPosS = glm::vec3(0.0,0.0,0.0); glm::vec3 screenPosE = glm::vec3((float)WINDOW_WIDTH, (float)WINDOW_HEIGHT,0.0); glm::vec3 wpS = glm::unProject(screenPosS, tmpView, tmpProj, viewport); glm::vec3 wpE = glm::unProject(screenPosE, tmpView, tmpProj, viewport); CamGetDirection() give me the vec3 direction of the camera CamGetPosition() of course give me the vec3 position of the camera getViewMatrix() give me the view matrix and this is the code: ViewMatrix = glm::lookAt( position, // Camera is here position+direction, // and looks here : at the same position, plus "direction" up // Head is up (set to 0,-1,0 to look upside-down) ); getProjectionMatrix() is this: ProjectionMatrix = glm::perspective(FoV /* FoV is 45.0f degree */, 4.0f / 3.0f, 0.1f, 100.0f); glm::vec3 screenPosS and glm::vec3 screenPosE are two vec3 of the first pixel and last pixel of the screen view   WINDOW_WIDTH and WINDOW_HEIGHT are my screen project setting in this case 1024 and 768   It seems working but I'm not sure on the numbers, I printed this: printf_s("CDir: %f %f %f\n",cd.x,cd.y,cd.z); printf_s("CPos: %f %f %f\n",cp.x,cp.y,cp.z); printf_s("WPStart: %f %f %f\n",wpS.x,wpS.y,wpS.z); printf_s("WPEnd: %f %f %f\n",wpE.x,wpE.y,wpE.z); and the output is: [attachment=23532:out.jpg]   Can you confirm if this code works?   Thanks
  13. VCAlfox

    How to import GLFW in eclipse C++ IDE

    Hello! I modified my program, as you suggest as follow. #define GLEW_STATIC #include <iostream> #include <stdio.h> #include <stdlib.h> #include <GL/glew.h> #include <GLFW/glfw3.h> #include "TryClass.h" using namespace std; int main() { if( !glfwInit() ) { cout << "fail init glfw" << endl; return -1; } GLFWwindow* window = glfwCreateWindow( 1024, 768, "Window", NULL, NULL); if( window == NULL ){ cout << "failed to open window" << endl; glfwTerminate(); return -1; } glfwMakeContextCurrent(window); if (glewInit() != GLEW_OK) { cout << "fail init glew" << endl; return -1; } glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE); do{ // Swap buffers glfwSwapBuffers(window); glfwPollEvents(); } while( glfwGetKey(window, GLFW_KEY_ESCAPE ) != GLFW_PRESS && glfwWindowShouldClose(window) == 0 ); glfwDestroyWindow(window); glfwTerminate(); return 0; } And add -DGLEW_STATIC in commandline g++ -IC:\Users\Alfonso-PC\workspace\ProvaGLFW\glfw\include -IC:\Users\Alfonso-PC\workspace\ProvaGLFW\glew\include TryClass.cpp ProvaGLFW.cpp -LC:\Users\Alfonso-PC\workspace\ProvaGLFW\lib -static -lglfw3 -lgdi32 -lglew32s -lopengl32 -DGLEW_STATIC Now I have a "nice" well-functioning black window   Thanks a lot! now I'll search how to make a "make file" Again Thanks
  14. VCAlfox

    How to import GLFW in eclipse C++ IDE

    Hello! Really thanks for you availability, I downloaded your .a and I put it in the /lib folder. Now the error is changed. C:\Users\ALFONS~1\AppData\Local\Temp\ccXaI1XL.o:ProvaGLFW.cpp:(.text+0x17): unde fined reference to `glfwInit' C:\Users\ALFONS~1\AppData\Local\Temp\ccXaI1XL.o:ProvaGLFW.cpp:(.text+0x51): unde fined reference to `_imp__glewInit@0' c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\Users\A LFONS~1\AppData\Local\Temp\ccXaI1XL.o: bad reloc address 0x0 in section `.ctors' c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link  failed: Invalid operation collect2.exe: error: ld returned 1 exit status this is my little main: #include <iostream> #include <GL/glew.h> #include <GLFW/glfw3.h> using namespace std; int main() { if( !glfwInit() ) { cout << "fail init glfw" << endl; // prints Hello World!!! return -1; } if (glewInit() != GLEW_OK) { cout << "fail init glew" << endl; // prints Hello World!!! return -1; } cout << "Hello World!!!" << endl; // prints Hello World!!! return 0; } ===========EDIT============== My bad, I forgot the: #define GLEW_STATIC And I changed the compile command as follow g++ -IC:\Users\Alfonso-PC\workspace\ProvaGLFW\glfw\include -IC:\Users\Alfonso-PC\workspace\ProvaGLFW\glew\include ProvaGLFW.cpp -LC:\Users\Alfonso-PC\workspace\ProvaGLFW\lib -static -lglfw3 -lgdi32 -lglew32s -lopengl32 Now it compiles: but give me a Warning: corrupt .drectve at end of def file and when I launch the a.exe the program (above) enter in the glewInit() "if" and always print
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!