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

First application problem
Goto page 1, 2  Next
 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
DMINATOR



Joined: 20 Jun 2006
Posts: 15
Location: Tallinn, Estonia

PostPosted: Tue Jun 20, 2006 11:36 am    Post subject: First application problem Reply with quote

Hi.

I am both new to D and Derelict, and I have stumbled upon few problems.

First I couldn't find any tutorials or samples how to build applications with derelict. I checked the docs and examples, but there were code only, no instructions on how to compile it.

And second Here is what I get when I try to build one of the examples:

Code:

import std.stdio;

import derelict.util.exception; 
import derelict.opengl.gl;
import derelict.util.loader;
import std.string;

bool myMissingProcCallback(char[] libName, char[] procName)
{
   
   if(procName.cmp("glfwSetTime") == 0)     // some glfw shared libs are missing glfwSetTime
      return true;                          // continue loading

   return false;                            // throw an exception for any other missing functions
}

void main()
{
   // the callback must be set before loading the library(ies) you want the callback to handle
   Derelict_SetMissingProcCallback(&myMissingProcCallback);
   DerelictGL.load();
}


with this command:
Quote:
build.exe main.d derelictutil.lib derelictglfw.lib


I get this error message:
Quote:

C:\Documents and Settings\Dmitri\My Documents\D_Samples\Second>build.exe main.d derelictutil.lib derelictglfw.lib
OPTLINK (R) for Win32 Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved

main.obj(main)
Error 42: Symbol Undefined _D8derelict4util6loader149__T13GenericLoaderVG12aa12_6f70656e676c33322e646c6cVG8aa8_6c6962474c2e736fVG0aa0_S64_D8derelict6opengl2gl7loadAllFC8derelict4util6loader9SharedLibZvZ13GenericLoader4loadFAaZv
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Tue Jun 20, 2006 1:10 pm    Post subject: Reply with quote

Err.. for some reason it looks like the generic loader code is not in your .lib files.

Here are some tutorials for derelict, maybe these can help.

http://dmedia.dprogramming.com/Tutorials/SdlGlTutorial1
Back to top
View user's profile Send private message AIM Address
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Tue Jun 20, 2006 1:17 pm    Post subject: Reply with quote

Afaics, you should also link the DerelictGL.lib to make it work
But as Clay said, check the DMedia tutorial Smile It tells you how to sidestep static libs completely
Back to top
View user's profile Send private message MSN Messenger
DMINATOR



Joined: 20 Jun 2006
Posts: 15
Location: Tallinn, Estonia

PostPosted: Tue Jun 20, 2006 1:51 pm    Post subject: Reply with quote

Thank you for your replies. I got a little further.

The OpenGL.lib was missing, although I don't know why it wasn't build first place.

So now when building the same program with this command line:
Quote:

build.exe main.d derelictutil.lib derelictgl.lib


I get this, when starting builded program:
Quote:

Error: Failed to load proc wglUseFontBitmaps from shared library opengl32.dll


Some thing is still wrong Sad.

P.S. Nice tutorial, I wish I founded it before. It would be great if at least links to it were included with Derelict docs.
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Tue Jun 20, 2006 2:08 pm    Post subject: Reply with quote

Use this http://derelict.dsource.org/selective.html to work around and ignore that function.

Just remember, if you ever try to use that function it will crash because you didn't load it.
Back to top
View user's profile Send private message AIM Address
DMINATOR



Joined: 20 Jun 2006
Posts: 15
Location: Tallinn, Estonia

PostPosted: Tue Jun 20, 2006 2:40 pm    Post subject: Reply with quote

Thank you. I got it working without any errors now, here are some functions, I have specified:

Code:

bool myMissingProcCallback(char[] libName, char[] procName)
{
   
   if(procName.cmp("glfwSetTime") == 0)     // some glfw shared libs are missing glfwSetTime
      return true;                          // continue loading


   if( procName.cmp("wglUseFontBitmaps") == 0)
   return true;

   if( procName.cmp("wglUseFontOutlines") == 0)
    return true;

   
   return false;                            // throw an exception for any other missing functions
}


But what does it mean . Who is missing these functions ?
Back to top
View user's profile Send private message MSN Messenger
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Tue Jun 20, 2006 3:58 pm    Post subject: Reply with quote

DMINATOR wrote:

I get this, when starting builded program:
Quote:

Error: Failed to load proc wglUseFontBitmaps from shared library opengl32.dll


Please always make sure that you're using the most recent version of derelict. That problem has been recently fixed Smile
Back to top
View user's profile Send private message MSN Messenger
aldacron



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

PostPosted: Tue Jun 20, 2006 11:32 pm    Post subject: Re: First application problem Reply with quote

DMINATOR wrote:
First I couldn't find any tutorials or samples how to build applications with derelict. I checked the docs and examples, but there were code only, no instructions on how to compile it.


There is a page of documentation that explains how to download Build and then how to compile Derelict. You can find it from the index page. There's a link in the left frame, "Building Derelict with Derek Parnell's Build Utility". Did you read that? If so, what did you find lacking? If not, why not? Did you not see it? Is the title misleading? Any feedback you give can help to improve the documentation.
Back to top
View user's profile Send private message Send e-mail
DMINATOR



Joined: 20 Jun 2006
Posts: 15
Location: Tallinn, Estonia

PostPosted: Wed Jun 21, 2006 1:29 am    Post subject: Re: First application problem Reply with quote

aldacron wrote:
DMINATOR wrote:
First I couldn't find any tutorials or samples how to build applications with derelict. I checked the docs and examples, but there were code only, no instructions on how to compile it.


There is a page of documentation that explains how to download Build and then how to compile Derelict. You can find it from the index page. There's a link in the left frame, "Building Derelict with Derek Parnell's Build Utility". Did you read that? If so, what did you find lacking? If not, why not? Did you not see it? Is the title misleading? Any feedback you give can help to improve the documentation.


Yes I have read it, but isn't this an instructions on how to build Derelict, not for how to build programs that use Derelict. I didn't find any samples on how to actually build applications that use Derelict. Clayasaurus has some good tutorials, why not include them or links to them in the docs.

Btw I told already that somehow one of the libs wasn't build- OpenGL lib , if it was build in the first place, then I wouldn't have that problem.

So my suggestions: Is it possible to include all the basic steps required for building application with derelict. Atleast one example would be enough (and list of possible problems that may occur). And is it possible to add some sort of control for buildme program. So that it would control if all the libs were build.

Btw you did a nice work.
Back to top
View user's profile Send private message MSN Messenger
aldacron



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

PostPosted: Wed Jun 21, 2006 9:34 am    Post subject: Re: First application problem Reply with quote

DMINATOR wrote:
Yes I have read it, but isn't this an instructions on how to build Derelict, not for how to build programs that use Derelict. I didn't find any samples on how to actually build applications that use Derelict. Clayasaurus has some good tutorials, why not include them or links to them in the docs.


Ah, okay. The thing is, this isn't unique to Derelict. Any application in D that uses a library will be built the same way. You either link to the prebuilt library or you compile the modules directly into your application. I want to keep the Derelict documentation focused on Derelict and not turn it into a D tutorial.

Quote:
So my suggestions: Is it possible to include all the basic steps required for building application with derelict. Atleast one example would be enough (and list of possible problems that may occur). And is it possible to add some sort of control for buildme program. So that it would control if all the libs were build.


I'm not sure what you mean by this. Any errors during the build process are printed to the console. Also, you can build packages one at a time by passing the name of the package on the command line. What sort of control do you want?
Back to top
View user's profile Send private message Send e-mail
DMINATOR



Joined: 20 Jun 2006
Posts: 15
Location: Tallinn, Estonia

PostPosted: Wed Jun 21, 2006 12:11 pm    Post subject: Re: First application problem Reply with quote

aldacron wrote:

I'm not sure what you mean by this. Any errors during the build process are printed to the console. Also, you can build packages one at a time by passing the name of the package on the command line. What sort of control do you want?


Well they are, but if you run buildme.exe, the program runs and closes after so it is not possible to see anything, unless cmd.exe is used.

The other thing that it builds fast, so if it finishes, the only way to know if there are problems, is to look through the message log, but I bet not everyone does that.

The best simple control method would be to actually check if the libs were build, ie the files are present in the output folder. And if not it should pause and show the libs that were not build.


Last edited by DMINATOR on Thu Jun 22, 2006 12:42 am; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Wed Jun 21, 2006 5:58 pm    Post subject: Reply with quote

Just create a batch file like

build main.d
PAUSE
main
PAUSE
Back to top
View user's profile Send private message AIM Address
DMINATOR



Joined: 20 Jun 2006
Posts: 15
Location: Tallinn, Estonia

PostPosted: Thu Jun 22, 2006 12:43 am    Post subject: Reply with quote

clayasaurus wrote:
Just create a batch file like

build main.d
PAUSE
main
PAUSE


Sorry I was talking about buildme.exe, I put the right name now.
Back to top
View user's profile Send private message MSN Messenger
aldacron



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

PostPosted: Thu Jun 22, 2006 1:25 am    Post subject: Reply with quote

DMINATOR wrote:
The other thing that it builds fast, so if it finishes, the only way to know if there are problems, is to look through the message log, but I bet not everyone does that.


They should be doing that. I know every time I finish a build I scroll up to make sure there were no errors.

DMINATOR wrote:
Sorry I was talking about buildme.exe, I put the right name now.


It's not an executable, it's a D script. Unless you're executing it from the Start->run menu, or have configured Windows to double-click, you need a command prompt open anyway. I'll think about adding something to the script or, at the very least, to the documentation.
Back to top
View user's profile Send private message Send e-mail
DMINATOR



Joined: 20 Jun 2006
Posts: 15
Location: Tallinn, Estonia

PostPosted: Thu Jun 22, 2006 1:07 pm    Post subject: Reply with quote

aldacron wrote:

They should be doing that. I know every time I finish a build I scroll up to make sure there were no errors.


Thats the problem, you think that people should do something, but real people don't do it exactly the way you want it. Thats why I had a problem, thats why there should be control for a "Dumb" user.

aldacron wrote:

It's not an executable, it's a D script. Unless you're executing it from the Start->run menu, or have configured Windows to double-click, you need a command prompt open anyway. I'll think about adding something to the script or, at the very least, to the documentation.

I think it is an executable. When I buld buildme.d I get buildme.exe. And then I use it as normal executable.
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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