Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7995067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:18:03+00:00 2026-06-04T14:18:03+00:00

I’m trying to run this on OSX 10.7: /** * simple.d */ import std.stdio;

  • 0

I’m trying to run this on OSX 10.7:

/**
 * simple.d
 */

import std.stdio;
import derelict.sdl.sdl;
import derelict.sdl.macinit.SDLMain;
import derelict.opengl.gl;

pragma(lib, "/usr/local/src/Derelict2/lib/libDerelictUtil.a");
pragma(lib, "/usr/local/src/Derelict2/lib/libDerelictSDL.a");
pragma(lib, "/usr/local/src/Derelict2/lib/libDerelictGL.a");

int main(string[] args) {

    // Load Derelict
    writeln("Loading SDL...");
    DerelictSDL.load();

    // Initialise SDL
    if( SDL_Init( SDL_INIT_EVERYTHING ) == -1 ) {
        throw new Exception("SDL initialization failed");
    }

    // Enable Double Buffering
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);

    // Set up the screen 
    SDL_Surface* screen = SDL_SetVideoMode(640, 480, 0, SDL_OPENGL);
    if (screen == null) {
        throw new Exception("Screen is null");
    }
    SDL_WM_SetCaption("Simple", "Simple");

    // Print OpenGL and GLSL version
    writeln("Version Info");
    writeln("OpenGL:\t", glGetString(GL_VERSION));
    writeln("GLSL:\t", glGetString(GL_SHADING_LANGUAGE_VERSION));

    // Execute frame update
    SDL_GL_SwapBuffers();

    // Quit SDL; SDL_Quit() takes care of freeing the screen surface
    writeln("Quitting SDL...");
    SDL_Quit();

    writeln("Bye!");
    return 0;
}

It compiles fine, but when I try to run it I get:

$ ./simple 
Loading SDL...
Version Info
Segmentation fault: 11

Here’s the thread output:

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff8376282a __kill + 10
1   libsystem_c.dylib               0x00007fff8e965cfa _sigtramp + 26
2   ???                             000000000000000000 0 + 0
3   simple                          0x000000010d299db9 D2rt6dmain24mainUiPPaZi7runMainMFZv + 29
4   simple                          0x000000010d29976e D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv + 38
5   simple                          0x000000010d299e06 D2rt6dmain24mainUiPPaZi6runAllMFZv + 58
6   simple                          0x000000010d29976e D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv + 38
7   simple                          0x000000010d2996f9 main + 237
8   simple                          0x000000010d24a554 start + 52

Thread 1 Crashed:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff837637e6 kevent + 10
1   libdispatch.dylib               0x00007fff896b378a _dispatch_mgr_invoke + 923
2   libdispatch.dylib               0x00007fff896b231a _dispatch_mgr_thread + 54

Now if I try to compile both Derelict and simple.d in 32bit mode (-m32) I get this output instead:

$ ./simple 
Loading SDL...
Version Info
Bus error: 10

Thread output:

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x93107332 __kill + 10
1   libsystem_kernel.dylib          0x93106932 kill$UNIX2003 + 32
2   libsystem_c.dylib               0x943f175e raise + 26
3   libsystem_c.dylib               0x9447d59b _sigtramp + 43
4   ???                             0xffffffff 0 + 4294967295
5   SDL                             0x01bb7108 SDL_Error + 275
6   simple                          0x000760ab D2rt6dmain24mainUiPPaZi7runMainMFZv + 23
7   simple                          0x00075a6c D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv + 24
8   simple                          0x000760f3 D2rt6dmain24mainUiPPaZi6runAllMFZv + 59
9   simple                          0x00075a6c D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv + 24
10  simple                          0x00075a0c main + 184
11  simple                          0x00035bb5 start + 53

Thread 1 Crashed:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x9310890a kevent + 10
1   libdispatch.dylib               0x96a74e10 _dispatch_mgr_invoke + 969
2   libdispatch.dylib               0x96a7385f _dispatch_mgr_thread + 53

I’ve tried other gl... functions like glClearColor() and they yield the same results.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:18:04+00:00Added an answer on June 4, 2026 at 2:18 pm

    You didn’t load the gl function pointers.

    DerelictGL.load();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am doing a simple coin flipping experiment for class that involves flipping a
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.