www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Setting the GtkD Include Path in dexed?

reply Ron Tarrant <rontarrant gmail.com> writes:
I managed to get dexed to compile a single-file dub project, but 
for completeness sake, I'm also trying to configure it to use dmd 
(non-dub) to compile GtkD projects using Compilation (menu) > 
Compile File and Run.

To that end, I have two questions...

Should I be supplying dexed with the include (read: import) path: 
/usr/include/dmd/gtkd3/

Or the runtime: /usr/lib/x86_64-linux-gnu/libgtkd-3.so

And where in dexed does one set the path so it can find a library 
such as gtkd?
Mar 12 2019
next sibling parent reply Ron Tarrant <rontarrant gmail.com> writes:
Another way of asking this, I suppose, would be:

How do I pass command line arguments to dmd from within dexed?
Mar 12 2019
parent reply JN <666total wp.pl> writes:
On Tuesday, 12 March 2019 at 17:39:06 UTC, Ron Tarrant wrote:
 Another way of asking this, I suppose, would be:

 How do I pass command line arguments to dmd from within dexed?
How about Project -> Project editor -> Categories -> Other -> dmdOtherOptions ?
Mar 12 2019
next sibling parent Ron Tarrant <rontarrant gmail.com> writes:
On Tuesday, 12 March 2019 at 21:54:36 UTC, JN wrote:
 On Tuesday, 12 March 2019 at 17:39:06 UTC, Ron Tarrant wrote:
 Another way of asking this, I suppose, would be:

 How do I pass command line arguments to dmd from within dexed?
How about Project -> Project editor -> Categories -> Other -> dmdOtherOptions ?
I missed that one. I'll give it a try. Thanks.
Mar 12 2019
prev sibling parent Ron Tarrant <rontarrant gmail.com> writes:
On Tuesday, 12 March 2019 at 21:54:36 UTC, JN wrote:

 How about Project -> Project editor -> Categories -> Other -> 
 dmdOtherOptions ?
I take it this starts in the Project menu? I found Project Editor in the Project menu, but the rest eludes me. Can't find it.
Mar 13 2019
prev sibling next sibling parent reply Basile B. <b2.temp gmx.com> writes:
On Tuesday, 12 March 2019 at 15:48:14 UTC, Ron Tarrant wrote:
 I managed to get dexed to compile a single-file dub project, 
 but for completeness sake, I'm also trying to configure it to 
 use dmd (non-dub) to compile GtkD projects using Compilation 
 (menu) > Compile File and Run.

 To that end, I have two questions...

 Should I be supplying dexed with the include (read: import) 
 path: /usr/include/dmd/gtkd3/

 Or the runtime: /usr/lib/x86_64-linux-gnu/libgtkd-3.so

 And where in dexed does one set the path so it can find a 
 library such as gtkd?
There's two different things here. 1. "Compile File and Run" It's for the scripts-like program, i.e single module. For this, the dependencies must be registered in the "library manager". An entry defines the import path (the dmd -I option), and the static library file (*.a, *.lib depending on the platform), and a few others fields. When you execute the action "Compile File and Run", the source is analyzed and the rights imports are automatically passed to DMD, if the matching lib is registered in the libman. 2. Dexed projects. The "native" project format was created before I understood that DUB was the official way to make a D project so it's somewhat not recommended to use it, although it works (for example at some points I had translated non trivial projects, such as dlangUI, to this format, and I still have a few stuff working using them). In this case as you've been said you have the dmdOtherOpts, which can be used to pass whatever you want and will be passed to DMD as is, after (however) the IDE variables expansion. see https://basile-z.github.io/dexed/widgets_dexed_project_editor#other-options for more details. But the dexed project format can also use the library manager. In this case, just like for the "runnable modules" the libraries must be registered in the library manager. Then you specify the alias of the dependencies in the project, see https://basile-z.github.io/dexed/widgets_dexed_project_editor#general-options (libraryAliases). example: https://github.com/Basile-z/kheops/blob/master/kheops.dprj#L58 ___ Finally: the most important thing is to register the library in the libman. https://basile-z.github.io/dexed/widgets_library_manager#library-manager
Mar 13 2019
parent reply Ron Tarrant <rontarrant gmail.com> writes:
Thanks for replying, Basile. It's always nice to get info 
straight from the original code author. :)

On Wednesday, 13 March 2019 at 11:59:11 UTC, Basile B. wrote:

 1. "Compile File and Run"

 It's for the scripts-like program, i.e single module. For this, 
 the dependencies must be registered in the "library manager". 
 An entry defines the import path (the dmd -I option), and the 
 static library file (*.a, *.lib depending on the platform), and 
 a few others fields.
I added gtk-d to the library manager and now my code compiles when I select either 'Compile file', 'Compile file and run', or 'Compile file and run...' However, with the last two, the executible doesn't go the next step and actually run. The dexed window becomes deselected (and in the case of 'Compile file and run...', a dialog opens to ask for args) but I see no indicator of the application opening its window. Unless it's opening somewhere off my screen. I have two external monitors connected to a laptop which seems to confuse some applications, especially on Linux. I've been testing on Windows today, however, so I don't know if this is related or not.
Mar 14 2019
parent reply Basile B. <b2.temp gmx.com> writes:
On Thursday, 14 March 2019 at 15:50:55 UTC, Ron Tarrant wrote:
 Thanks for replying, Basile. It's always nice to get info 
 straight from the original code author. :)

 On Wednesday, 13 March 2019 at 11:59:11 UTC, Basile B. wrote:

 1. "Compile File and Run"

 It's for the scripts-like program, i.e single module. For 
 this, the dependencies must be registered in the "library 
 manager". An entry defines the import path (the dmd -I 
 option), and the static library file (*.a, *.lib depending on 
 the platform), and a few others fields.
I added gtk-d to the library manager and now my code compiles when I select either 'Compile file', 'Compile file and run', or 'Compile file and run...' However, with the last two, the executible doesn't go the next step and actually run. The dexed window becomes deselected (and in the case of 'Compile file and run...', a dialog opens to ask for args) but I see no indicator of the application opening its window. Unless it's opening somewhere off my screen. I have two external monitors connected to a laptop which seems to confuse some applications, especially on Linux. I've been testing on Windows today, however, so I don't know if this is related or not.
You must register put the static library file, not the object I thing, anyway, i just made you a video showing exactly what to do since finally the linker error is gone (yay !), also launch one of the demo file as a "runnable module". https://www.reddit.com/r/d_language/comments/b120dc/register_gtkd_in_dexed/ It's good to see that the hard work to make this libman useful works...
Mar 14 2019
parent reply Ron Tarrant <rontarrant gmail.com> writes:
On Thursday, 14 March 2019 at 16:02:01 UTC, Basile B. wrote:

 You must register put the static library file, not the object I 
 thing, anyway, i just made you a video showing exactly what to 
 do since finally the linker error is gone (yay !), also launch 
 one of the demo file as a "runnable module".

 https://www.reddit.com/r/d_language/comments/b120dc/register_gtkd_in_dexed/

 It's good to see that the hard work to make this libman useful 
 works...
I got this to work on Linux following your video. Thanks! But when I went back to Windows to try it there, dexed doesn't open. I check in Task Manager and dexed runs, but it just doesn't open its window. Also, Task Manager says dexed's power usage is "Very high" whatever that means. I waited about 30 seconds, but nothing changed. I killed dexed and dcd-server, then tried running it again. Same result.
Mar 14 2019
parent Basile B. <b2.temp gmx.com> writes:
On Thursday, 14 March 2019 at 20:06:08 UTC, Ron Tarrant wrote:
 On Thursday, 14 March 2019 at 16:02:01 UTC, Basile B. wrote:

 You must register put the static library file, not the object 
 I thing, anyway, i just made you a video showing exactly what 
 to do since finally the linker error is gone (yay !), also 
 launch one of the demo file as a "runnable module".

 https://www.reddit.com/r/d_language/comments/b120dc/register_gtkd_in_dexed/

 It's good to see that the hard work to make this libman useful 
 works...
I got this to work on Linux following your video. Thanks! But when I went back to Windows to try it there, dexed doesn't open. I check in Task Manager and dexed runs, but it just doesn't open its window. Also, Task Manager says dexed's power usage is "Very high" whatever that means. I waited about 30 seconds, but nothing changed. I killed dexed and dcd-server, then tried running it again. Same result.
Open an issue in dexed bug tracker please. I'll take a look, and fix I hope. I gotta release a point release soon anyway because today a bug causing slow startup and maybe 50% of the docking problems has been fixed. https://github.com/Basile-z/dexed/issues
Mar 14 2019
prev sibling parent Basile B. <b2.temp gmx.com> writes:
On Tuesday, 12 March 2019 at 15:48:14 UTC, Ron Tarrant wrote:
 I managed to get dexed to compile a single-file dub project, 
 but for completeness sake, I'm also trying to configure it to 
 use dmd (non-dub) to compile GtkD projects using Compilation 
 (menu) > Compile File and Run.

 To that end, I have two questions...

 Should I be supplying dexed with the include (read: import) 
 path: /usr/include/dmd/gtkd3/

 Or the runtime: /usr/lib/x86_64-linux-gnu/libgtkd-3.so

 And where in dexed does one set the path so it can find a 
 library such as gtkd?
I just tried and here is the complete guide to register an entry in the library manager. 1. in the repo root run make to get the static libraries generated 2. in dexed add a new library manager entry (icon with a book and a "+") 3. set the alias to "gtkd" (icon with a book and a pen) 4. set the source path to <full path to GtkD repo>/generated/gtkd (icon with a folder and a "+") 5. set the static library file to the "libgtkd-3.a" file that should have been generated in the repo root. (icon with a folder and a brick) This has to be done manually because the json DUB project is cannot be registered automatically since it's more a meta project, or however this is called. Then when you compile a runnable with "Compile file and run" the libman entry will be used to solve the import path automatically, and the static library file will be passed automatically as well. For the dexed projects, as explained yesterday, the "libraryAliases" property must contain "gtkd". Note however that here I got linkers error (multiple definition of...), no idea why.
Mar 14 2019