GLFW errors during c++ program compialtion on ubuntu

Started by
11 comments, last by VCAlfox 9 years, 7 months ago

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?

Advertisement

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

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 :)

May I recommend, if you're on Ubuntu, you use the Ubuntu way.

(1) Install the GLFW development package

sudo apt-get install libglfw-dev

(2) use the installed GLFW development package

MYCMD=$(shell pkg-config --libs libglfw glew)

Once you've got your game up and running, only then start poking around with the sharp corners of the OS, like statically linking custom-built third-party libraries.

Stephen M. Webb
Professional Free Software Developer

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

That's because the ubuntu glfw package is old, it's 2.7 or something, while you are using 3.0.4.

To use that simply download the 3.0.4 package, install it, and then use pkg-config in the same manner as before in the makefile.

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

You can download the package here: http://www.glfw.org/. I've personally never been able to find glfw3 in the repositories (I'm sure it exists somewhere, just never found it myself :P).

Post here, or let me know if you need any help compiling it. I'm unsure your familiarity with compiling. It's not terribly difficult, but can be a little tricky if you've never done it.

Beginner here <- please take any opinions with grain of salt

Install cmake:

sudo apt-get install cmake

Download from glfw.org, unpack it to a location, enter directory, type this in terminal:


cmake .
make -j4
sudo make install

Done.

Here is my output for static linking:


pkg-config glfw3 --libs --static
-L/usr/local/lib -lglfw3 -lrt -lXrandr -lXi -lGL -lm -ldl -lXrender -ldrm -lXdamage -lX11-xcb -lxcb-glx -lxcb-dri2 -lxcb-dri3 -lxcb-present -lxcb-sync -lxshmfence -lXxf86vm -lXfixes -lXext -lX11 -lpthread -lxcb -lXau -lXdmcp

So, to use that, add the command to linking process using `` qoutes, for example: -Llib -llzo2 `pkg-config glfw3 --libs --static`

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?

This topic is closed to new replies.

Advertisement