Re: object.Exception@generated\gtkd\gtkd\Loader.d(125):Library load failed(libgio-2.0.0.dll)

2017-11-21 Thread Mike Wey via Digitalmars-d

On 21-11-17 11:19, PECman wrote:

On Sunday, 19 November 2017 at 13:39:39 UTC, Mike Wey wrote:

On 19-11-17 08:35, PECman wrote:
I complied the D application with gtkD successfully.However,I cant 
run it successfully.My settings are OK.I dunno why it happened to me:-(

Who can help me?


That line usually includes the error returned from LoadLibrary which 
should give an indication of why it failed.


I assume you installed the GTK runtime for the architecture you are 
building for ( 32 or 64 bit ).


But the error is the messy code.
I have already installed the GTK runtime 32 bit(on Windows 7 32 bit)
What shall I do next?


That's unfortunate, usually there is some info on why it fails after the 
`(libgio-2.0-0.dll)`.


First check if the `bin` directory of the GTK installation is on the 
PATH, and if there are any other GTK installs on the PATH, GtkD should 
try to detect the correct runtime to use but that might have failed.


--
Mike Wey


Re: object.Exception@generated\gtkd\gtkd\Loader.d(125):Library load failed(libgio-2.0.0.dll)

2017-11-19 Thread Mike Wey via Digitalmars-d

On 19-11-17 08:35, PECman wrote:
I complied the D application with gtkD successfully.However,I cant run 
it successfully.My settings are OK.I dunno why it happened to me:-(

Who can help me?


That line usually includes the error returned from LoadLibrary which 
should give an indication of why it failed.


I assume you installed the GTK runtime for the architecture you are 
building for ( 32 or 64 bit ).


--
Mike Wey


Re: Symbols missing, unmangle!

2017-08-31 Thread Mike Wey via Digitalmars-d

On 30-08-17 23:51, Moritz Maxeiner wrote:
2) Try to get demangling of D symbols into upstream of the currently 
common linkers (GNU linker, gold, lld, etc.)


The GNU linker and gold support demangling D symbols, so if you are on 
linux try adding `-L--demangle=dlang` to the dmd commandline.


--
Mike Wey


Re: Named multi-imports

2017-08-16 Thread Mike Wey via Digitalmars-d

On 16-08-17 09:58, Gary Willoughby wrote:

On Tuesday, 15 August 2017 at 03:37:39 UTC, rikki cattermole wrote:

On 15/08/2017 2:59 AM, Johnson wrote:

Not only that, but it requires adding more files to the command line.

I currently have 3 import files to separate the gtk from gdk that and 
the only reason they exist is to combine them in to one named import ;/



Doesn't seem like much but that's 3 extra files that don't really 
need to exist.


Hopefully D already implements a way to do what I'm asking.


Or instead of a new language feature, the gtk-d guys could have 
package files ;)


This! Just create a PR for Gtk-D to add packages.


Wouldn't that just move the problem?

You then get an package that imports gtk.Window and a other package that 
imports gdk.Window, and if you want to use both you still need to add a 
renamed import or a static import in your own file.


--
Mike Wey


Re: NG technical issues: Is it just me?

2017-08-01 Thread Mike Wey via Digitalmars-d


On 21-04-17 19:03, Mike Wey wrote:

On 04/21/2017 10:27 AM, Vladimir Panteleev wrote:

On Thursday, 20 April 2017 at 23:37:25 UTC, Ali Çehreli wrote:
*Looks* like a server/network issue but behaves like a screwy local 
issue.


Started happening more in recent weeks.

I don't select automatic checking for messages. I just click on a 
newsgroup and it fails at differing rates. (Pretty good in the last 
couple of days.) When it fails, for me the cure is to click on 
another D newsgroup to make a successful connection and then come 
back to the failed one; then it always succeeds.


It would be helpful if someone could record a packet capture log (e.g. 
with Wireshark) of the problem. The information therein could be the 
first step towards diagnosing the problem.




Ok, here is an Wireshark export of the error and a few successful 
packets beforehand. Hopefully this gives some insight in whats going on.


https://drive.google.com/open?id=0B6DxRRR3v-n9QzhtZmNEbUQzWmM



The errors seem to be getting more frequent lately. But i nog also get 
these errors on the GtkD newsgroup (vibenews) so it might be a 
Thunderbird issue.


Is anybody getting the errors with a different client?

--
Mike Wey


Re: [your code here] Pure RPN calculator

2017-07-26 Thread Mike Wey via Digitalmars-d

On 26-07-17 16:40, Iakh wrote:

On Wednesday, 26 July 2017 at 09:46:45 UTC, Timon Gehr wrote:

 readln.split.fold!((stack,op){
 switch(op){
 static foreach(c;"+-*/") case [c]:
 return stack[0..$-2]~mixin("stack[$-2] "~c~" 
stack[$-1]");

 default: return stack~op.to!real;
 }
 })((real[]).init).writeln;


What does "case [c]:" mean?



In the static foreach c is a `immutable char` by putting it between [ 
and ] you create an array of immutable characters (string).


--
Mike Wey


Re: Let's paint those bikesheds^Werror messages!

2017-06-28 Thread Mike Wey via Digitalmars-d

On 28-06-17 01:34, Moritz Maxeiner wrote:


All these can even do true colors on Windows:
- 
https://blogs.msdn.microsoft.com/commandline/2016/09/22/24-bit-color-in-the-windows-console/ 



On Windows 10, and in that case you can even use the vt100 escape 
sequences: 
https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032(v=vs.85).aspx



--
Mike Wey


Re: Phobos PR in need of review/merge

2017-06-27 Thread Mike Wey via Digitalmars-d

On 27-06-17 08:49, Walter Bright wrote:

You can also specifically request a review from one of Team Phobos:

https://github.com/orgs/dlang/teams/team-phobos/members

Just click on the [Reviwers] link.


Is that page private? I get an 404 error, and i can't find the page on 
github.


--
Mike Wey


Re: Replacing Make for the DMD build

2017-06-16 Thread Mike Wey via Digitalmars-d

On 06/16/2017 03:16 PM, Joakim wrote:
As for Meson, never dealt with it much, do you have an example for D 
code we can look at?


The meson files for tilix might be a good example:
https://github.com/gnunn1/tilix/tree/master/experimental/meson

--
Mike Wey


Re: DIP 1004 Preliminary Review Round 1

2017-05-03 Thread Mike Wey via Digitalmars-d

On 05/03/2017 05:09 PM, Andrej Mitrovic wrote:

On Wednesday, 3 May 2017 at 12:58:17 UTC, Daniel N wrote:
The trick is that your child class need to have defined at least 1 
constructor before the alias.


This should work:
this() {}
alias __ctor = super.__ctor;

This will give the error message you saw:
alias __ctor = super.__ctor;
this() {}


I see. It does look like an accidental feature (as in, that it could 
break in the future).


You could switch to:

```
this(A...)(auto ref A a)
{
import std.functional;
super(forward!a);
}
```

but that doesn't work with all the parameter storage classes.
lazy is no longer lazy for example.

--
Mike Wey


Re: NG technical issues: Is it just me?

2017-04-21 Thread Mike Wey via Digitalmars-d

On 04/21/2017 10:27 AM, Vladimir Panteleev wrote:

On Thursday, 20 April 2017 at 23:37:25 UTC, Ali Çehreli wrote:
*Looks* like a server/network issue but behaves like a screwy local 
issue.


Started happening more in recent weeks.

I don't select automatic checking for messages. I just click on a 
newsgroup and it fails at differing rates. (Pretty good in the last 
couple of days.) When it fails, for me the cure is to click on another 
D newsgroup to make a successful connection and then come back to the 
failed one; then it always succeeds.


It would be helpful if someone could record a packet capture log (e.g. 
with Wireshark) of the problem. The information therein could be the 
first step towards diagnosing the problem.




Ok, here is an Wireshark export of the error and a few successful 
packets beforehand. Hopefully this gives some insight in whats going on.


https://drive.google.com/open?id=0B6DxRRR3v-n9QzhtZmNEbUQzWmM

--
Mike Wey


Re: Seemingly patternless optlink premature termination

2017-01-09 Thread Mike Wey via Digitalmars-d

On 01/09/2017 08:05 AM, Walter Bright wrote:



There isn't even an Optlink specific bug list.


I found the list I posted by searching bugzilla for "optlink". If there
are any I missed, please let me know.


https://issues.dlang.org/show_bug.cgi?id=15418

Is there anything i should add to mark it as an optlink bug?

--
Mike Wey


Re: Using dlopen/dlsym

2016-12-27 Thread Mike Wey via Digitalmars-d

On 12/27/2016 06:02 AM, Adam D. Ruppe wrote:

On Tuesday, 27 December 2016 at 00:05:39 UTC, Andrei Alexandrescu wrote:

I'm building with no flags using dmd.


Do dmd -v for verbose output and see what linker flags it is doing.
Perhaps you have a configuration difference that is causing it not to
export the symbol (`fun` isn't marked `export`... I don't think that
matters on linux but it might on some versions or with some
configurations).


dmd will need to pass "--export-dynamic" to the linker, so that the 
symbol is actually exported.


--
Mike Wey


Re: GtkD Binaries

2016-08-12 Thread Mike Wey via Digitalmars-d

On 08/12/2016 09:03 AM, Sean Campbell wrote:

Does anyone know where i could find the DLLs not included in the gtk+
runtime installer for GtkD, as I don't have the necessary environment to
build the gtk+ runtime.

I have already located a copy of "libgtksourceview-3.0-1.dll" (Found it
on the pbone rpm archive).

I still need to find "libvte-2.91.dll" and a bunch of others.


The Binaries in the gtk+ installer used by GtkD are coming from MSYS2. 
So if your missing anything you could check there, although they don't 
have binaries for Vte.


GtkSourceview should have been included in the installer.

--
Mike Wey


Re: Gnome Builder IDE

2016-05-04 Thread Mike Wey via Digitalmars-d

On 05/04/2016 03:51 PM, WebFreak001 wrote:

On Monday, 2 May 2016 at 11:17:27 UTC, Karabuta wrote:

On Sunday, 1 May 2016 at 16:21:16 UTC, WebFreak001 wrote:

On Tuesday, 19 April 2016 at 16:29:41 UTC, Karabuta wrote:

Anyone tried this IDE for D coding? Seems to work pretty well. It
deserves some D attention.

https://wiki.gnome.org/Apps/Builder


I would make a plugin but it seems that you can't make external
plugins without recompiling builder from source yet



You should contact Hegert(the lead developer). I think that's what he
wrote in his blog. Try issues in the github repo.


ok I asked in the IRC right now. There is a plugins directory where it
dynamically loads it from. However nobody in there actually knew how to
do it with anything else than Python. Gonna try to get it to work somehow


There are a few plugins written in C in the gnome-builder git[1].

It seems you an static extern(C) function named "peas_register_types" to 
register your plugin. The plugins seem to implement one of the 
interfaces from gnome-builder/libide, but i haven't looked at the 
details of that.


[1]: https://git.gnome.org/browse/gnome-builder/tree/plugins

--
Mike Wey


Re: How can I report what I think a compiler's frontend bug

2016-03-20 Thread Mike Wey via Digitalmars-d

On 03/20/2016 11:37 PM, Vincent R wrote:

On Sunday, 20 March 2016 at 19:06:32 UTC, Johan Engelen wrote:

On Sunday, 20 March 2016 at 17:57:12 UTC, Vincent R wrote:

On Sunday, 20 March 2016 at 16:16:18 UTC, Marco Leise wrote:

Am Sun, 20 Mar 2016 11:28:19 +
schrieb Vincent R :


Hi,

I would like to start a new project (a bonjour/zeroconf wrapper
and a gui browser using it).
For the gui part I would like to use my existing skills using
wxWidgets wrapper (wxD).
So I have started to report a problem a few months ago:
https://forum.dlang.org/post/rtarlodeojnmedgsn...@forum.dlang.org

But so far(DMD32 D Compiler v2.070.2) it's still not fixed.
Do you think it will be fixed one day ?

Thanks


Yes, I think it will be fixed one day, since - as you know
by reading the very thread you linked - it is already reported
and the GDC developers chimed in and considered it critical.
There are also 118 open critical/blocker bugs that were
reported before yours. Most of them by people here on the
forums and you would need to explain to us why your bug
deserves higher attention than the others (154 in total).

Dlang is free open-source software and there is only a hand full of
people who are fixing bugs in the compiler just for the sake of
improving it. Most people contribute occasionally when they are
interested in a solution to a particular problem.

If you really need this fixed now ... you know the drill. I suggest
you analyze the problem and start a discussion about it. Honestly
asking why the compiler emits duplicate symbols in a reduced test
case might have yielded you some good responses from the people who
wrote the code.


Ok first maybe it's already reported to GDC but to me it's not only a
gdc bug since it also happens with dmd. So I don't know how bugs are
fixed in the differents compilers but I suppose they share the same
frontend (maybe I am mistaken) and in this case I prefer not to wait
for gdc developers to fix it but to see if for instance some dmd
developers have some time to fix it.
I just want to use the language and don't have time to dig inside its
inner workings, so I think D is not for me. This project was the
opportunity to learn the language by fixing an unmaintained library
(wxD) but it's not as easy as I thought.


What may speed-up bug fixing a lot is preparing a nice testcase that
is *as small as possible*.
As you can see in the bug report [1], there is already a testcase. It
is a good start, but it is not very minimal: contains a lot of
comments etc. That is a lot of distraction / bother (for me at least).
One way to help here is to minimize it further, and distill it down to
the essential thing that appears to trigger the bug. You can do that
without knowing any compiler internals.
It can be very time consuming to make such a testcase, which may
discourage developers fixing of your bug.

[1] https://issues.dlang.org/show_bug.cgi?id=15324


Ok I think I have found the problem, here is the testcase:

alias TreeItemId wxTreeItemId;
 public class TreeItemId : wxObject
 {
 public this(IntPtr wxobj)
 {
 super(wxobj);
 }

 private this(IntPtr wxobj, bool memOwn)
 {
 super(wxobj);
 this.memOwn = memOwn;
 }

 public this()
 {
 this(wxTreeItemId_ctor(), true);
 }

 public this(void* pItem)
 {
 this(wxTreeItemId_ctor2(pItem), true);
 }

 override protected void dtor() { wxTreeItemId_dtor(wxobj); }
 }

The problem is I think between public this(void* pItem) and public
this(IntPtr wxobj)
because from what I understand they are the same.
If I comment one of the two constructors it seems to remove the warning
about duplicated symbols. Now I need to understand what the original
author wanted to do by declaring these 2 constructors.



AFIAK IntPtr used to be a typedef from void*, this probably changed to 
an alias when typedef was deprecated.


--
Mike Wey


Re: Localization (i18n) Options

2016-01-18 Thread Mike Wey via Digitalmars-d

On 01/18/2016 04:06 PM, Luis wrote:

Were I can find the script to generate ddox for GtkD ?


https://github.com/gtkd-developers/GtkD/blob/master/makeddox.sh

--
Mike Wey


Re: Why doesn't mktspec() use clock_gettime?

2015-01-10 Thread Mike Wey via Digitalmars-d

On 01/10/2015 08:16 AM, ketmar via Digitalmars-d wrote:

On Fri, 09 Jan 2015 19:17:49 -0800
Andrei Alexandrescu via Digitalmars-d 
wrote:


On 1/9/15 6:13 PM, weaselcat wrote:

On Saturday, 10 January 2015 at 02:03:17 UTC, Andrei Alexandrescu wrote:

cc Sean Kelly

https://github.com/D-Programming-Language/druntime/blob/master/src/core/sync/config.d#L28


Looks like that use has been disable with static if (false). What was
the reason?

A coworker spent a few hours debugging a matter that pointed to this
issue. He removed the "false" and replaced CLOCK_REALTIME with
CLOCK_MONOTONIC in our druntime tree.

Any insight into the matter? How should we address it by supporting
multiple clock types portably?


Thanks,

Andrei


https://github.com/D-Programming-Language/druntime/commit/998739c


Thanks. What library would that be? Is it unavailable on some platforms?
If always available, couldn't we just link with it? -- Andrei

on older GNU/Linux systems it requires -lrt. it doesn't with relatively
new glibc (something that is 1.5 year old is ok, AFAIR), and i see no
reasons to be conservative here, but...



And on Linux we already link with librt anyway.

--
Mike Wey


Re: Invalid reference in a wikipedia - D related article

2014-12-09 Thread Mike Wey via Digitalmars-d

On 12/09/2014 04:34 PM, BBaz wrote:

I was writing some things when I suddently realized that the wikipedia page

http://en.wikipedia.org/wiki/Const_%28computer_programming%29

hyperlinks an invalid article:

"Here A Const, There A Const"
http://www.digitalmars.com/d/const.html

I let someone more aware fix it.


Looks like it was removed in this commit:;
https://github.com/D-Programming-Language/dlang.org/commit/995e538cea03d32764326f8cb45143f2dbe28194

--
Mike Wey


Re: GTKD2 GValue Type

2014-11-19 Thread Mike Wey via Digitalmars-d

On 11/19/2014 03:50 AM, Sergey wrote:

 Hello everyone!

I try to use gtkd + d in production, and of course I started with
gtk.TreeView and gtk.ListStore objects. But I encounter a problem with
GValyue type:

GValue[] array_values = cast(GValue[])["str1","str2","str3","str4"];
file_1.d(92): Error: e2ir: cannot cast "str1" of type string to type GValue
...

ListStore1.setValuesv(itr, [0,1,2,3], "str1","str2","str3","str4");
file_1.d(98): Error: function gtk.ListStore.ListStore.setValuesv
(TreeIter iter, int[] columns, GValue[] values) is not callable using
argument types (TreeIter, int[], string, string, string, string)

GValue ggg = cast(GValue)"123";
file_1.d(78): Error: cannot cast from string to GValue

GValue ggg = "123";
file_1.d(79): Error: cannot implicitly convert expression ("123") of
type string to GValue

How to deal with this type?

thanks in advance.


If it's really just strings you can use;
ListStore1.setValues(itr, [0,1,2,3], ["str1","str2","str3","str4"]);

Otherwise you'll need to make multiple calls to ListStore.setValue.

For setValuesv there is an error in the generated code it should except 
an array of gobject.Value, in stead of the the C equivalent.


--
Mike Wey


Re: rpath options to linkers, OSX issue

2014-09-07 Thread Mike Wey via Digitalmars-d

On 09/06/2014 05:51 PM, Russel Winder via Digitalmars-d wrote:

Ariovistus originally reported Issue 2940 against SCons and the D
toolset (http://scons.tigris.org/issues/show_bug.cgi?id=2940). The gdc
tool uses "-Wl,-rpath=." in the gdc command to set the rpath for gdc.
The dmd tool uses "-L-rpath=." in the dmd command to set the rpath for
dmd.

This all works fine on Linux. I haven't managed to find a way to test
this on Windows.

It seems for the first time (which surprised me as I thought I had
checked this), I am running the tests on OSX and "-L-rpath=." generates
"-rpath=." to the ld which is Clang and it rejects this option.

I am assuming the problem is in my OSX set up and not in what dmd is
doing. I get dmd via MacPorts, it is v2.066-devel.

Is there an OSX user out there having no problem with dmd and dynamic
libraries I can prevail upon to give me a hand with this?


Windows doesn't support rpath or something like it, the best alternative 
there would be using "SetDllDirectory" or "AddDllDirectory" in the 
executable.


For OSX this might help: 
http://stackoverflow.com/questions/4513799/how-to-set-the-runtime-path-rpath-of-an-executable-with-gcc-under-mac-osx



--
Mike Wey