You should mention in the tutorial that you need to install DMD from dlang.org first. Maybe it's obvious to most people, but I didn't realize that installing dub wasn't enough.
Also, once I got it to compile, it gives an error "The program can't start because dsfml-graphics-2.dll is missing from your computer. Try reinstalling the program to fix this problem."
I don't know where it could be looking for the dll's other than the folder that I initially specified in the package.json...?
Also, for those who were used to building things in the past, is this download that is now linked to everywhere everything we need to get DSFML working on our system? I.E. this has DSFML and DSFML-C all wrapped up and we don't need to build DSFML on these seemingly DSFML-C files?
Also, for those who were used to building things in the past, is this download that is now linked to everywhere everything we need to get DSFML working on our system? I.E. this has DSFML and DSFML-C all wrapped up and we don't need to build DSFML on these seemingly DSFML-C files?
Correct.
OK, I did manage to find the instructions a little buried, but doesn't it build against the DSFML-C libraries?
How do I tell it where to look? It seems to succeed automatically, but I don't know how to guarantee it's building against the latest libs.
OK, I did manage to find the instructions a little buried, but doesn't it build against the DSFML-C libraries?
Buried? There was a link to the build instructions on the page I linked above. :P And it wouldn't build correctly if it couldn't find the dsfml-xxx.lib files. Those are what connect it to the dll's.
Edit:
Some of the wording in the wiki could probably be improved. I'll look into this and see what I can fix.QuoteHow do I tell it where to look? It seems to succeed automatically, but I don't know how to guarantee it's building against the latest libs.
On Windows, you need to use the -L+Path compiler option. For example:dmd main.d -L+C:\Users\Jeremy\Desktop\dsfml\ dsfml-graphics.lib dsfml-window.lib dsfml-system.lib
This looks for all the .lib files in C:\Users\Jeremy\Desktop\dsfml\
You have to make sure the right dll's end up in the exe directory though.
So if it is finding the lib files automatically when building DSFML, where do I put the new ones I just downloaded for it to build against? Will what you posted (the dmd main.d line) work for building DSFML too?
{
"name": "shmup",
"stringImportPaths": ["content/"],
"lflags" : ["-Llib"],
"libs": [
"jpeg",
"GL",
"GLU",
"GLEW",
"freetype",
"X11",
"Xrandr"
],
"dependencies": {
"dsfml:graphics": "~master"
}
}
Linking...
lib/libdsfml-graphics.so: undefined reference to `XCreateIC'
lib/libdsfml-graphics.so: undefined reference to `XQueryExtension'
lib/libdsfml-graphics.so: undefined reference to `__glewDeleteFramebuffersEXT'
lib/libdsfml-graphics.so: undefined reference to `XRRFreeScreenConfigInfo'
lib/libdsfml-graphics.so: undefined reference to `glXMakeCurrent'
lib/libdsfml-graphics.so: undefined reference to `XFree'
lib/libdsfml-graphics.so: undefined reference to `glEnable'
lib/libdsfml-graphics.so: undefined reference to `__glewUniformMatrix4fvARB'
lib/libdsfml-graphics.so: undefined reference to `XMoveWindow'
lib/libdsfml-graphics.so: undefined reference to `__GLEW_EXT_blend_func_separate'
lib/libdsfml-graphics.so: undefined reference to `glTexCoordPointer'
lib/libdsfml-graphics.so: undefined reference to `XFreeCursor'
lib/libdsfml-graphics.so: undefined reference to `__GLEW_ARB_shading_language_100'
lib/libdsfml-graphics.so: undefined reference to `glXGetConfig'
lib/libdsfml-graphics.so: undefined reference to `glPushClientAttrib'
lib/libdsfml-graphics.so: undefined reference to `FT_Select_Charmap'
lib/libdsfml-graphics.so: undefined reference to `glPopAttrib'
lib/libdsfml-graphics.so: undefined reference to `__glewGetHandleARB'
lib/libdsfml-graphics.so: undefined reference to `jpeg_write_scanlines'
lib/libdsfml-graphics.so: undefined reference to `glEnableClientState'
lib/libdsfml-graphics.so: undefined reference to `FT_Set_Pixel_Sizes'
lib/libdsfml-graphics.so: undefined reference to `XStoreName'
lib/libdsfml-graphics.so: undefined reference to `glMatrixMode'
lib/libdsfml-graphics.so: undefined reference to `__glewBindFramebufferEXT'
lib/libdsfml-graphics.so: undefined reference to `glDisable'
lib/libdsfml-graphics.so: undefined reference to `XLookupString'
lib/libdsfml-graphics.so: undefined reference to `__glewGenFramebuffersEXT'
lib/libdsfml-graphics.so: undefined reference to `__glewCheckFramebufferStatusEXT'
lib/libdsfml-graphics.so: undefined reference to `glClear'
lib/libdsfml-graphics.so: undefined reference to `__glewAttachObjectARB'
lib/libdsfml-graphics.so: undefined reference to `XCreateImage'
lib/libdsfml-graphics.so: undefined reference to `glXChooseFBConfig'
lib/libdsfml-graphics.so: undefined reference to `__glewRenderbufferStorageEXT'
lib/libdsfml-graphics.so: undefined reference to `__GLEW_ARB_fragment_shader'
lib/libdsfml-graphics.so: undefined reference to `XRRSetScreenConfig'
lib/libdsfml-graphics.so: undefined reference to `glGetError'
lib/libdsfml-graphics.so: undefined reference to `__glewUniform1fARB'
lib/libdsfml-graphics.so: undefined reference to `__glewFramebufferTexture2DEXT'
lib/libdsfml-graphics.so: undefined reference to `glXDestroyContext'
lib/libdsfml-graphics.so: undefined reference to `XListDepths'
lib/libdsfml-graphics.so: undefined reference to `glXCreateContext'
lib/libdsfml-graphics.so: undefined reference to `XSetWMNormalHints'
lib/libdsfml-graphics.so: undefined reference to `XGrabPointer'
lib/libdsfml-graphics.so: undefined reference to `FT_Done_FreeType'
lib/libdsfml-graphics.so: undefined reference to `FT_Outline_Embolden'
lib/libdsfml-graphics.so: undefined reference to `XConvertCase'
lib/libdsfml-graphics.so: undefined reference to `__glewLinkProgramARB'
lib/libdsfml-graphics.so: undefined reference to `XCreateWindow'
lib/libdsfml-graphics.so: undefined reference to `glPushAttrib'
lib/libdsfml-graphics.so: undefined reference to `__glewGetObjectParameterivARB'
lib/libdsfml-graphics.so: undefined reference to `XCreateColormap'
lib/libdsfml-graphics.so: undefined reference to `glClearColor'
lib/libdsfml-graphics.so: undefined reference to `XQueryKeymap'
lib/libdsfml-graphics.so: undefined reference to `XOpenDisplay'
lib/libdsfml-graphics.so: undefined reference to `glReadPixels'
lib/libdsfml-graphics.so: undefined reference to `XAllocWMHints'
lib/libdsfml-graphics.so: undefined reference to `XFilterEvent'
lib/libdsfml-graphics.so: undefined reference to `jpeg_set_defaults'
lib/libdsfml-graphics.so: undefined reference to `jpeg_set_quality'
lib/libdsfml-graphics.so: undefined reference to `XDrawPoint'
lib/libdsfml-graphics.so: undefined reference to `XDestroyWindow'
lib/libdsfml-graphics.so: undefined reference to `XCloseDisplay'
lib/libdsfml-graphics.so: undefined reference to `Xutf8LookupString'
lib/libdsfml-graphics.so: undefined reference to `glXGetCurrentContext'
lib/libdsfml-graphics.so: undefined reference to `__GLEW_ARB_shader_objects'
lib/libdsfml-graphics.so: undefined reference to `__glewUniform2fARB'
lib/libdsfml-graphics.so: undefined reference to `glXSwapBuffers'
lib/libdsfml-graphics.so: undefined reference to `glPopClientAttrib'
lib/libdsfml-graphics.so: undefined reference to `glGetTexImage'
lib/libdsfml-graphics.so: undefined reference to `XUnsetICFocus'
lib/libdsfml-graphics.so: undefined reference to `XUnmapWindow'
lib/libdsfml-graphics.so: undefined reference to `glewInit'
lib/libdsfml-graphics.so: undefined reference to `glBlendFunc'
lib/libdsfml-graphics.so: undefined reference to `XCreatePixmapFromBitmapData'
lib/libdsfml-graphics.so: undefined reference to `__GLEW_EXT_framebuffer_object'
lib/libdsfml-graphics.so: undefined reference to `XCreatePixmapCursor'
lib/libdsfml-graphics.so: undefined reference to `glCopyTexSubImage2D'
lib/libdsfml-graphics.so: undefined reference to `FT_Open_Face'
lib/libdsfml-graphics.so: undefined reference to `__glewDeleteRenderbuffersEXT'
lib/libdsfml-graphics.so: undefined reference to `XFreeGC'
lib/libdsfml-graphics.so: undefined reference to `jpeg_start_compress'
lib/libdsfml-graphics.so: undefined reference to `__GLEW_ARB_texture_non_power_of_two'
lib/libdsfml-graphics.so: undefined reference to `glBindTexture'
lib/libdsfml-graphics.so: undefined reference to `__glewDeleteObjectARB'
lib/libdsfml-graphics.so: undefined reference to `FT_Get_Kerning'
lib/libdsfml-graphics.so: undefined reference to `XSetWMProtocols'
lib/libdsfml-graphics.so: undefined reference to `glLoadMatrixf'
lib/libdsfml-graphics.so: undefined reference to `glDeleteTextures'
lib/libdsfml-graphics.so: undefined reference to `glewGetErrorString'
lib/libdsfml-graphics.so: undefined reference to `FT_Init_FreeType'
lib/libdsfml-graphics.so: undefined reference to `__glewCreateProgramObjectARB'
lib/libdsfml-graphics.so: undefined reference to `__glewUseProgramObjectARB'
lib/libdsfml-graphics.so: undefined reference to `XResizeWindow'
lib/libdsfml-graphics.so: undefined reference to `glGetIntegerv'
lib/libdsfml-graphics.so: undefined reference to `XMapWindow'
lib/libdsfml-graphics.so: undefined reference to `FT_Bitmap_Embolden'
lib/libdsfml-graphics.so: undefined reference to `jpeg_destroy_compress'
lib/libdsfml-graphics.so: undefined reference to `__glewCreateShaderObjectARB'
lib/libdsfml-graphics.so: undefined reference to `XCreateGC'
lib/libdsfml-graphics.so: undefined reference to `__glewUniform3fARB'
lib/libdsfml-graphics.so: undefined reference to `XSelectInput'
lib/libdsfml-graphics.so: undefined reference to `XDestroyIC'
lib/libdsfml-graphics.so: undefined reference to `XFlush'
lib/libdsfml-graphics.so: undefined reference to `__glewGetInfoLogARB'
lib/libdsfml-graphics.so: undefined reference to `glTexImage2D'
lib/libdsfml-graphics.so: undefined reference to `XSetICFocus'
lib/libdsfml-graphics.so: undefined reference to `XWarpPointer'
lib/libdsfml-graphics.so: undefined reference to `XRRConfigSizes'
lib/libdsfml-graphics.so: undefined reference to `XPutImage'
lib/libdsfml-graphics.so: undefined reference to `glDrawArrays'
lib/libdsfml-graphics.so: undefined reference to `XCheckIfEvent'
lib/libdsfml-graphics.so: undefined reference to `FT_Done_Glyph'
lib/libdsfml-graphics.so: undefined reference to `__glewUniform1iARB'
lib/libdsfml-graphics.so: undefined reference to `XOpenIM'
lib/libdsfml-graphics.so: undefined reference to `jpeg_CreateCompress'
lib/libdsfml-graphics.so: undefined reference to `FT_New_Memory_Face'
lib/libdsfml-graphics.so: undefined reference to `FT_Glyph_To_Bitmap'
lib/libdsfml-graphics.so: undefined reference to `__glewUniform4fARB'
lib/libdsfml-graphics.so: undefined reference to `FT_New_Face'
lib/libdsfml-graphics.so: undefined reference to `XRRConfigCurrentConfiguration'
lib/libdsfml-graphics.so: undefined reference to `__glewGenRenderbuffersEXT'
lib/libdsfml-graphics.so: undefined reference to `glTexSubImage2D'
lib/libdsfml-graphics.so: undefined reference to `jpeg_stdio_dest'
lib/libdsfml-graphics.so: undefined reference to `XDefineCursor'
lib/libdsfml-graphics.so: undefined reference to `glPushMatrix'
lib/libdsfml-graphics.so: undefined reference to `FT_Load_Char'
lib/libdsfml-graphics.so: undefined reference to `glFlush'
lib/libdsfml-graphics.so: undefined reference to `XInternAtom'
lib/libdsfml-graphics.so: undefined reference to `glGetString'
lib/libdsfml-graphics.so: undefined reference to `XGrabKeyboard'
lib/libdsfml-graphics.so: undefined reference to `FT_Get_Char_Index'
lib/libdsfml-graphics.so: undefined reference to `__glewBlendFuncSeparateEXT'
lib/libdsfml-graphics.so: undefined reference to `__glewGetUniformLocationARB'
lib/libdsfml-graphics.so: undefined reference to `__glewActiveTextureARB'
lib/libdsfml-graphics.so: undefined reference to `XQueryPointer'
lib/libdsfml-graphics.so: undefined reference to `XGetVisualInfo'
lib/libdsfml-graphics.so: undefined reference to `XVisualIDFromVisual'
lib/libdsfml-graphics.so: undefined reference to `XKeysymToKeycode'
lib/libdsfml-graphics.so: undefined reference to `jpeg_std_error'
lib/libdsfml-graphics.so: undefined reference to `XGetWindowAttributes'
lib/libdsfml-graphics.so: undefined reference to `XRRGetScreenInfo'
lib/libdsfml-graphics.so: undefined reference to `FT_Get_Glyph'
lib/libdsfml-graphics.so: undefined reference to `__glewCompileShaderARB'
lib/libdsfml-graphics.so: undefined reference to `XChangeProperty'
lib/libdsfml-graphics.so: undefined reference to `glVertexPointer'
lib/libdsfml-graphics.so: undefined reference to `glPopMatrix'
lib/libdsfml-graphics.so: undefined reference to `XFreePixmap'
lib/libdsfml-graphics.so: undefined reference to `__GLEW_ARB_vertex_shader'
lib/libdsfml-graphics.so: undefined reference to `glXGetProcAddress'
lib/libdsfml-graphics.so: undefined reference to `glViewport'
lib/libdsfml-graphics.so: undefined reference to `__glewShaderSourceARB'
lib/libdsfml-graphics.so: undefined reference to `FT_Done_Face'
lib/libdsfml-graphics.so: undefined reference to `XCreatePixmap'
lib/libdsfml-graphics.so: undefined reference to `__glewBindRenderbufferEXT'
lib/libdsfml-graphics.so: undefined reference to `glColorPointer'
lib/libdsfml-graphics.so: undefined reference to `jpeg_finish_compress'
lib/libdsfml-graphics.so: undefined reference to `XCloseIM'
lib/libdsfml-graphics.so: undefined reference to `glTexParameteri'
lib/libdsfml-graphics.so: undefined reference to `__glewFramebufferRenderbufferEXT'
lib/libdsfml-graphics.so: undefined reference to `XSetWMHints'
lib/libdsfml-graphics.so: undefined reference to `XSetWindowColormap'
lib/libdsfml-graphics.so: undefined reference to `glGenTextures'
collect2: error: ld returned 1 exit status
Having trouble using the nightly DSFML-C on Linux. My dub config looks like this:Code: [Select]{
"name": "shmup",
"stringImportPaths": ["content/"],
"lflags" : ["-Llib"],
"libs": [
"jpeg",
"GL",
"GLU",
"GLEW",
"freetype",
"X11",
"Xrandr"
],
"dependencies": {
"dsfml:graphics": "~master"
}
}
I have the DSFML-C shared libraries in "lib" in my project folder, however, when it comes time to build, the linker spits back this error:QuoteLinking...
undefined reference to everything!
collect2: error: ld returned 1 exit status
Having trouble using the nightly DSFML-C on Linux. My dub config looks like this:Code: [Select]{
"name": "shmup",
"stringImportPaths": ["content/"],
"lflags" : ["-Llib"],
"libs": [
"jpeg",
"GL",
"GLU",
"GLEW",
"freetype",
"X11",
"Xrandr"
],
"dependencies": {
"dsfml:graphics": "~master"
}
}
I have the DSFML-C shared libraries in "lib" in my project folder, however, when it comes time to build, the linker spits back this error:QuoteLinking...
undefined reference to everything!
collect2: error: ld returned 1 exit status
This problem happens because DUB includes all the libraries before the DSFML-C libs, so you get all those pesky undefined references. This was a problem someone else had mentioned to me, but I only just had fixed it last night. Maybe DUB hasn't updated the repo on your computer yet? You shouldn't have to add all the libraries any longer either. They are now included automatically.