www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - How to set up Derelict GLFW3 with VisualD ?

reply Whirlpool <whirlpool cloudy.sky> writes:
Hi,

I would like to learn GLFW on Windows 10 with VisualD, but I 
don't know much about Visual Studio. I installed DMD 2.070.0 with 
Visual Studio Community 2013 and dub. Following the instructions 
here [http://derelictorg.github.io/compiling.html], I compiled 
DerelictGLFW3 and DerelictUtil. I put the resulting lib files 
into a libs\ folder in my project directory, and added that 
folder into the "Additional Import Paths" field in Solution 
properties > Configuration Properties > Compiler > General. I 
also added it into Configuration Properties > Linker > General > 
Library Search Path. But when trying to build the project, I get 
"Error	1	Error: module glfw3 is in file 'derelict\glfw3\glfw3.d' 
which cannot be read	C:\Users\username\documents\visual studio 
2013\Projects\ConsoleApp1\ConsoleApp1\main.d	1"

The code so far is only :

import derelict.glfw3.glfw3;

int main(string[] argv) {
	DerelictGLFW3.load();
	return 0;
}

I don't know how to proceed. Is there a tutorial for this 
somewhere ? Please could you help me ? Thank you
Jan 31 2016
parent WhatMeWorry <kheaser gmail.com> writes:
On Sunday, 31 January 2016 at 18:22:53 UTC, Whirlpool wrote:
 Hi,

 I would like to learn GLFW on Windows 10 with VisualD, but I 
 don't know much about Visual Studio. I installed DMD 2.070.0 
 with Visual Studio Community 2013 and dub. Following the 
 instructions here 
 [http://derelictorg.github.io/compiling.html], I compiled 
 DerelictGLFW3 and DerelictUtil. I put the resulting lib files 
 into a libs\ folder in my project directory, and added that 
 folder into the "Additional Import Paths" field in Solution 
 properties > Configuration Properties > Compiler > General. I 
 also added it into Configuration Properties > Linker > General
 Library Search Path. But when trying to build the project, I
get "Error 1 Error: module glfw3 is in file 'derelict\glfw3\glfw3.d' which cannot be read C:\Users\username\documents\visual studio 2013\Projects\ConsoleApp1\ConsoleApp1\main.d 1" The code so far is only : import derelict.glfw3.glfw3; int main(string[] argv) { DerelictGLFW3.load(); return 0; } I don't know how to proceed. Is there a tutorial for this somewhere ? Please could you help me ? Thank you
Since this is complaining about the .d file, this must be a compile error. So we can take the Library Search Paths out of the equation. I would take the Search path you used and append it to you import path and double check that it points to were your glfw3.d resides. For instance, in my project in the Compiler>General>Additional imports I have: N:\DUB_Packages\DerelictOrg\DerelictGLFW3\source And in my D project I have: import derelict.glfw3.glfw3; So now, When I navigate to the full path, N:\DUB_Packages\DerelictOrg\DerelictGLFW3\source\derelict\glfw3 I see that there is indeed a file present named: glfw3.d Note: I made one of the cardinal sins of programming by using a hard coded N:\... absolute path. But I wanted to keep things real simple. If that fails, a really kludgy solution, might be to simply move a copy of glfw3.d to you home directory. But that would only be if you want a quick a very dirty band aid. If a school project is due the next day :)
Mar 22 2016