FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

use GLFW as static

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
bioinfornatics



Joined: 22 Jun 2010
Posts: 90

PostPosted: Wed Apr 18, 2012 5:12 pm    Post subject: use GLFW as static Reply with quote

i got a problem with derelict3

Code:

$ ldc2 main.d /usr/lib64/libDerelictGLFW3.a /usr/lib64/libDerelictGL3.a /usr/lib64/libDerelictUtil.a

$ ./main
derelict.util.exception.SharedLibLoadException@../import/derelict/util/exception.d(38): Failed to load one or more shared libraries:
   libglfw.so - libglfw.so: cannot open shared object file: No such file or directory


Code:

$ ls /usr/lib64/libglfw.a
/usr/lib64/libglfw.a


I think derellict is not able to search into /usr/lib64 on fedora and many other distro when you use a 64bits system 64bits library are located into /usr/lib64 and 32bits /usr/lib

Code:
module main;

import std.string;
import std.stdio;
import std.getopt;
import std.c.process;
import std.exception;
import derelict.opengl3.gl3;
import derelict.glfw3.glfw3;
import derelict.glfw3.types;

//~ pragma(lib, "DerelictGL3");
//~ pragma(lib,   "DerelictGLFW3");
//~ pragma(lib, "DerelictUtil");
//~ pragma(lib, "dl");

enum string v           = "0.1";
enum string[] authors   = [ "Jonathan MERCIER" ];
size_t verbosity        = 1;

// horizontal and vertical screen resolution
const int   xResolution     = 800;
const int   yResolution     = 600;

void main( string[] args ){
    void help(){
        writefln( "Usage: %s [option]", args[0] );
        writeln(
`
--help      -h  Display this message
--version   -v  Display program version
--verbose   -v  Increase verbosity
--quiet     -q  Turn off verbosity
`
        );
        exit(0);
    }
    void about(){
        writefln( "Imperium version %s", v );
        writeln( "Writen by:");
        foreach( author; authors )
            writefln( "\t- %s", author );
        exit(0);
    }
    void verbose( string option ){
        switch( option ){
           case("v"):
           case("verbose"):
               verbosity += 1;
               break;
           case("quiet"):
               verbosity = 0;
               break;
           default:
               verbosity = 1;
               break;
        }
    }

    getopt(
        args,
        "help|h",       &help,
        "version",      &about,
        "verbose|v",    &verbosity,
        "quiet|q",      &verbosity
    );

    principale();
}

void principale(){
    DerelictGL3.load();
    DerelictGLFW3.load();
    bool isRunning = true;
    scope(exit) glfwTerminate();
    scope(exit) isRunning = false;

    enforce( !glfwInit(), "Error GLFW fait at initialization" );

    glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
    glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);
    glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

    GLFWwindow window = glfwOpenWindow( xResolution, yResolution, GLFW_WINDOWED, "Imperium" , null );

    enforce(
            !window,
            " Error impossible to create the main window"
           );

    while( isRunning ){
        // OpenGL rendering goes here...
        glClear( GL_COLOR_BUFFER_BIT );
        // Swap front and back rendering buffers
        glfwSwapBuffers();
        // Check if ESC key was pressed or window was closed
        isRunning = glfwIsWindow(window) && glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS;
    }
}
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Wed Apr 18, 2012 9:45 pm    Post subject: Re: use GLFW as static Reply with quote

bioinfornatics wrote:
i got a problem with derelict3

Code:

$ ldc2 main.d /usr/lib64/libDerelictGLFW3.a /usr/lib64/libDerelictGL3.a /usr/lib64/libDerelictUtil.a

$ ./main
derelict.util.exception.SharedLibLoadException@../import/derelict/util/exception.d(38): Failed to load one or more shared libraries:
   libglfw.so - libglfw.so: cannot open shared object file: No such file or directory


Code:

$ ls /usr/lib64/libglfw.a
/usr/lib64/libglfw.a


I think derellict is not able to search into /usr/lib64 on fedora and many other distro when you use a 64bits system 64bits library are located into /usr/lib64 and 32bits /usr/lib


Derelict uses whatever the default search path for dlopen is. But I don't understand what you want with libglfw.a. Derelict doesn't load archive files (.a), only shared objects (.so).
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
bioinfornatics



Joined: 22 Jun 2010
Posts: 90

PostPosted: Thu Apr 19, 2012 4:14 am    Post subject: Reply with quote

oh ok then i need found how build with success glfw as shared lib

thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group