Should dmd have given me a warning at least?

WhatMeWorry via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Sep 13 08:52:53 PDT 2014


On Saturday, 13 September 2014 at 08:09:15 UTC, Mike Parker wrote:
> On 9/13/2014 7:44 AM, WhatMeWorry wrote:
>>
>> // the following two lines compile cleanly but when executed, 
>> I get
>> // D:\Projects\Derelict>02_SimpleOpenGL_3_3_program.exe
>> // object.Error: Access Violation
>> // ----------------
>>
>> string glShadingLangVer =
>> to!string(glGetString(GL_SHADING_LANGUAGE_VERSION));
>> writeln("glShadingLangVer is ", glShadingLangVer);
>>
>>
>>
>>
>> glGetString has the following signature:
>>
>> const GLubyte* glGetString(GLenum name);
>>
>> I presume the const is causing the problem.  Is there a work 
>> around?
>>
>> Thanks.
>
> Can you show more of your code so we can get some context?
>
> ---
> This email is free from viruses and malware because avast! 
> Antivirus protection is active.
> http://www.avast.com

Well, this morning on another system, the code works beautifully

string glShadingLangVer = 
to!string(glGetString(GL_SHADING_LANGUAGE_VERSION));
writeln("glShadingLangVer is ", glShadingLangVer);

returns

glShadingLangVer is 4.20 - Build 10.18.10.3345

Thanks for you help.


More information about the Digitalmars-d-learn mailing list