MrcSnm/HipremeEngine

Linker error

MetalMaxMX opened this issue · 6 comments

So, now all modules have successfully compiled and there are no issues there! Now I encountered a new bug, allow me to dump what it says on the terminal (user is mega):
Linking hipreme_engine
/usr/bin/ld: modules/windowing/.dub/build/default-debug-linux.posix-x86_64-dmd_v2.101.0-1487C0C4D73EE1149313B5787F50E73F491D7E43EBD1E7409DB3001BA1124E01/libwindowing.a(x11_4d_657.o): in function _D3hip9windowing9platforms3x1116initializeOpenGLFNbNiiiZb': /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:60: undefined reference to glXChooseFBConfig'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:64: undefined reference to XCloseDisplay' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:71: undefined reference to glXGetVisualFromFBConfig'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:74: undefined reference to glXGetFBConfigAttrib' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:75: undefined reference to glXGetFBConfigAttrib'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:85: undefined reference to XFree' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:91: undefined reference to XFree'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:92: undefined reference to glXGetVisualFromFBConfig' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:96: undefined reference to XCloseDisplay'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:106: undefined reference to XCreateColormap' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:126: undefined reference to XCreateWindow'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:134: undefined reference to XInternAtom' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:146: undefined reference to XSetWMProtocols'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:158: undefined reference to glXQueryExtensionsString' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:161: undefined reference to glXGetProcAddressARB'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:169: undefined reference to glXCreateNewContext' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:189: undefined reference to XSync'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:191: undefined reference to glXIsDirect' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:193: undefined reference to glXMakeCurrent'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:199: undefined reference to XClearWindow' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:200: undefined reference to XMapRaised'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:201: undefined reference to XStoreName' /usr/bin/ld: modules/windowing/.dub/build/default-debug-linux.posix-x86_64-dmd_v2.101.0-1487C0C4D73EE1149313B5787F50E73F491D7E43EBD1E7409DB3001BA1124E01/libwindowing.a(x11_4f_415.o): in function _D3hip9windowing9platforms3x1110swapBufferFZv':
/home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:212: undefined reference to glXSwapBuffers' /usr/bin/ld: modules/windowing/.dub/build/default-debug-linux.posix-x86_64-dmd_v2.101.0-1487C0C4D73EE1149313B5787F50E73F491D7E43EBD1E7409DB3001BA1124E01/libwindowing.a(x11_50_5bb.o): in function _D3hip9windowing9platforms3x1114setVsyncActiveFNbNibZv':
/home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:220: undefined reference to glXGetProcAddressARB' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:221: undefined reference to glXGetProcAddressARB'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:222: undefined reference to glXGetProcAddressARB' /usr/bin/ld: modules/windowing/.dub/build/default-debug-linux.posix-x86_64-dmd_v2.101.0-1487C0C4D73EE1149313B5787F50E73F491D7E43EBD1E7409DB3001BA1124E01/libwindowing.a(x11_53_1b7.o): in function _D3hip9windowing9platforms3x114pollFZv':
/home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:249: undefined reference to XPending' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:251: undefined reference to XNextEvent'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:257: undefined reference to XGetWindowAttributes' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:327: undefined reference to XKeycodeToKeysym'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:332: undefined reference to XKeycodeToKeysym' /usr/bin/ld: modules/windowing/.dub/build/default-debug-linux.posix-x86_64-dmd_v2.101.0-1487C0C4D73EE1149313B5787F50E73F491D7E43EBD1E7409DB3001BA1124E01/libwindowing.a(x11_56_740.o): in function _D3hip9windowing9platforms3x1118destroy_GL_ContextFZb':
/home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:359: undefined reference to XDestroyWindow' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:360: undefined reference to XCloseDisplay'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:361: undefined reference to XFree' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:362: undefined reference to XFreeColormap'
/usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:363: undefined reference to glXDestroyContext' /usr/bin/ld: modules/windowing/.dub/build/default-debug-linux.posix-x86_64-dmd_v2.101.0-1487C0C4D73EE1149313B5787F50E73F491D7E43EBD1E7409DB3001BA1124E01/libwindowing.a(x11_57_42a.o): in function _D3hip9windowing9platforms3x1110openWindowFiiZi':
/home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:372: undefined reference to XOpenDisplay' /usr/bin/ld: /home/mega/HipremeEngine/modules/windowing/source/hip/windowing/platforms/x11.d:379: undefined reference to glXQueryVersion'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
Error /usr/bin/dmd failed with exit code 1.

Not sure what is going on here admittedly, though so close to being compiled now! (not sure if this is something related to my linker, or the codebase, or something else entirely even)

Seems like it just didn't find libX11

I think it is an easy fix, let me get that done real quick.
How did you built the program? Was it only "dub" on HipremeEngine?

So, it is a bit strange, cause when windowing gets compiled, it finds pragma(lib, "X11"), either it is not finding the X11 library, or some bug could be occurring there.

Are you using Wayland or X11 for your linux?

Could you try passing on dub.json the version SharedX11?

That was fast! Uhh, I was using dub build. I'm using X11 on an XFCE session, and when retrying for dub alone I didn't get much of a difference. I also modified the json to add SharedX11 on one of the versions but that didn't do much either

I also do have libx11-dev so is not a problem related to lacking the headers necessary to build either

Okay, I'll do a clean test of x11 again on linux

I got the same error as you on a clean test, I'm gonna fix it real quick