Re: Recommended GUI library?
Thanks for the extra suggestions! I'll check them out.
Re: Initializing D in C to use?
On Friday, 17 October 2014 at 16:35:46 UTC, Jeremy DeHaan wrote: I'm starting a new project, and I plan on creating a C interface in case other languages want to use it. I remember reading something(but my googlefu is weak today) about having to initialize the runtime if you are using D inside another language. Can anyone confirm this is the case? I just wanted to make sure I make that explicit for users if they don't want to use the library with D. Thanks all! Jeremy Sorry if this isn't the most helpful answer but.. Do you have Adam Ruppe's book? On pg96, "Writing part of a C program in D" it sounds like he does what you're asking. I was gonna write more, but being I haven't tried it before, I don't wanna start giving potentially false info ...I mean I could write more but it's probably a bad idea getting help from me xD
Re: Recommended GUI library?
On Friday, 17 October 2014 at 16:41:21 UTC, Jeremy DeHaan wrote: I highly recommend gtkD. It works on Windows, OSX, and Linux and provides a very nice OO interface to Gtk+. http://gtkd.org/ ooo looks pretty good. I'll go try it out; Thanks, Jeremy!
Recommended GUI library?
I'm looking for suggestions for a GUI library, to create a somewhat light GUI that can also be created without too much fuss, and support for Windows & Linux. The GUI I'm looking to make would be one that is just one window, with support for tabs (just like the ones in the properties page for items on Windows), and support for opening up file browsing (just normal system one is good). Then pretty much each of the tabs are just gonna be for setting up info to send to a bunch of smaller programs. Ive used Tcl/Tk with Python before, and I briefly tried out a D version, with choppy results. So what library would anyone suggest for what I'm looking to do, or which library have you taken a liking to? Thanks, for any suggestions!
Re: generate unique variable names?
On Wednesday, 8 October 2014 at 02:06:28 UTC, Brian Schott wrote: I'm 99% sure you actually want an array or associative array. Something like this maybe? ImageType[string] images; images[format("image%03d", i)] = new ImagefromFile(userDefinedLocation); oooh okay I see what you mean. Yeah that will be wy better. It'll help me get rid of all my extra temp variables and string/int conversions, too. Thanks! :)
generate unique variable names?
Is there a way to generate variable names using strings? What I'm trying to do in this particular case is use a for loop, to generate variables (then probably put them in an array in the end) that represent images. So the name is pretty much "image" + the image padding + iterator number. So image001, image002, etc. So visually (though not real syntax): auto "imageName" ~ "imagePadding" ~ i = new Imagefromfile(userDefinedLocation); The problem is I can't figure out how to actually create the unique variable. I was thinking of trying to use 'new' some how, but still not sure. Thanks in advance for any help!
Re: is scid still maintained
On Saturday, 20 September 2014 at 13:40:32 UTC, uri wrote: Hi All, I'm wondering if SciD is still maintained because the last commit to this repo is a while ago now... https://github.com/kyllingstad/scid Is there a fork, or some other repo that is more up to date I should look at? Thanks, uri The author has his email on his github profile page so you could email him. I'm pretty sure he's on here a lot too so you could wait and see if he spots this.
Re: how to create and compile reesources for dmd 64
On Friday, 19 September 2014 at 22:20:59 UTC, Cassio Butrico wrote: Hello everyone, When I create and compile resouces to 32 works perfect, but when I try to compilat of 64 error LNK1136: invalid or corrupt file. I do not know if it has to do with comverter COFF to OMF. can someone give me a light? Thank you for your attention. Somebody correct me if I'm wrong, but I'm pretty sure dmd doesn't actually support or compile 64-bit, despite what it tries to tell you. If you really need 64bit than GDC will probably work.
Re: compile "automation", makefile, or whatever?
On Tuesday, 16 September 2014 at 21:17:19 UTC, Cliff wrote: On Tuesday, 16 September 2014 at 21:05:18 UTC, K.K. wrote: On Tuesday, 16 September 2014 at 20:53:08 UTC, Cliff wrote: Would you be willing to provide some more detail on what about it you didn't like (errors, missing features, etc.)? I ask because build systems are a particular interest of mine and I have projects in this area which can always use more user data. I'll try, but I haven't used it at all since maybe.. April? One of the main things that annoyed me about it was how sensitive it could be. The best comparison I can give is that it reminded me ALOT of Haxe. Both are very flimsy, and very poorly documented. (Nothing beats a good manual as far as I'm concerned!) The other thing, as I briefly mentioned, was it really didn't speed anything up, unless maybe you were working on a larger project. Obviously I'm not a master of any sort, but the main point I'd take from this is it wasn't inviting. Hope that helps a bit :3 Yep, that's useful information to me. Over the years I have found that build systems *generally* tend to be uninviting. My suspicion is that comes down to a few reasons: 1. Builds end up being a LOT more complicated that you would expect as soon as you step out of a single project with a few source files and default options 2. Build tooling is typically built and maintained by people who end up being relatively specialist - either they are part of the small cabal of people who know the tooling intimately, or they have been forced into it and know just enough to get by for their organization. 3. Most build tooling is designed to solve a particular subset of actual build-related problems, with much less though given to how it fits holistically into the entire developer workflow. 4. Build tooling is almost never treated like an actual product - documentation is written for wizards, not lay-people. As a result, the casual user is a bit SOL. (NOTE: This is not a rant specifically aimed at DUB, but my general observation on the state of build tooling.) Yeah I absolutely agree with you on that! Something I see alot in place of actual documentation is the developer repeatedly saying "email me" (aka google searching peoples name's and usernames until you find it), but I'm generally reluctant to do so because it means I'm gonna have to ask them very straight forward streamlined questions (usually meaning I'd have to take my problem out of the context I'm having trouble with) and then pray that they'll answer more than one email, and also hope they'll answer within at least a few days. Some people are really good an answer within a few hours, other times you won't get a reply at all. Also when reading your post i remembered something else about DUB.. I don't remember precisely what I was doing, but I had a quick experiment that was just supposed a window opened and displayed a small image. Using DMD it worked fine, but for some reason when using DUB, the picture wouldn't load at all. It was quite the mystery. So you can probably see why I've happily made text files, folders, and powershell my go to tools :P
Re: compile "automation", makefile, or whatever?
On Tuesday, 16 September 2014 at 20:57:20 UTC, Andrei Amatuni wrote: Have you tried -> http://dlang.org/rdmd.html only a tiny bit... I've haven't quite figured rdmd yet :\ I'm actually trying it out right now.
Re: compile "automation", makefile, or whatever?
On Tuesday, 16 September 2014 at 20:53:08 UTC, Cliff wrote: Would you be willing to provide some more detail on what about it you didn't like (errors, missing features, etc.)? I ask because build systems are a particular interest of mine and I have projects in this area which can always use more user data. I'll try, but I haven't used it at all since maybe.. April? One of the main things that annoyed me about it was how sensitive it could be. The best comparison I can give is that it reminded me ALOT of Haxe. Both are very flimsy, and very poorly documented. (Nothing beats a good manual as far as I'm concerned!) The other thing, as I briefly mentioned, was it really didn't speed anything up, unless maybe you were working on a larger project. Obviously I'm not a master of any sort, but the main point I'd take from this is it wasn't inviting. Hope that helps a bit :3
Re: compile "automation", makefile, or whatever?
On Tuesday, 16 September 2014 at 20:31:33 UTC, Cliff wrote: Out of curiosity, why are you not using dub (on the command-line)? I'm not against using it or anything, but I've found that it didn't help me significantly nor did I have the patience to figure out it's whole set of issues, D by itself is already enough trouble xD Plus with my spastic work style, it kinda slowed me down. However, it is something I may consider when I have an actually organized project with a final goal. A lot of what I'm doing right now is just experiments. Though, if Cmake + D does the trick then I might not use DUB in the end. Hard to say atm.
Re: compile "automation", makefile, or whatever?
On Tuesday, 16 September 2014 at 19:26:29 UTC, Cliff wrote: I want to say somewhere on the forums are some descriptions of using CMake for this. Might try searching for that. Yeah I just looked up the CMake thing. It definitely seems worth playing with, though I'm not really sure how extensive it's D support currently is :S
compile "automation", makefile, or whatever?
Hey I have a quick question: Does D have it's own version of makefiles or anything (preferably simpler)? So instead of typing in PowerShell "dmd file1.d file2.d lib\foo.lib -Isrc\ ." I could just type most of that into a file and then just type "dmd file.X" I've seen some people make really complex .d files that have a lot of interchangeability but at the moment I wouldn't really need something of that scale. Also, I'm not using DUB; I'd prefer to just use the command line. ..Can pragma's help with this, aside from linking just the libs?
Re: DUB help plz
On Thursday, 3 July 2014 at 07:20:52 UTC, ponce wrote: On Thursday, 3 July 2014 at 04:46:02 UTC, K.K. wrote: Is the only thing I'm missing the .dll's? Thanks! Yes, everything went fine, and you find the missing DLL here: https://www.libsdl.org/download-2.0.php On Thursday, 3 July 2014 at 09:38:23 UTC, FreeSlave wrote: Derelict contains bindings to other libraries, not these libraries themselves. dub downloads only these bindings, not original libraries (since they are written in C, not D, and not included in dub repositories). You should manually get necessary libraries and put them in folder where .exe will be placed or in some path from PATH environment variable, so application would be able to find them at runtime. O okay. That really clears things up; thanks for the help guys!
DUB help plz
I've been trying to figure DUB out and have been having a bit of trouble. I'm trying to make a simple program that uses Derelict GL3 and SDL2. I keep getting this error though: derelict.util.exception.SharedLibLoadException@C:\Users\Kyoji\AppData\Roaming\dub\packages\derelict-util-1.0.1\source\derelict\util\exception.d(35): Failed to load one or more shared libraries: SDL2.dll - The specified module could not be found. I'm not sure how to get that .dll, I tried doing 'dub upgrade' but that didn't do much. Here's what some of my files look like: app.d : import std.stdio; import derelict.opengl3.gl3; import derelict.sdl2.sdl; void main() { writeln("Edit source/app.d to start your project."); DerelictGL3.load(); DerelictSDL2.load(); DerelictGL3.reload(); } --- dub.json : --- { "name": "testbuild", "description": "A minimal D application.", "copyright": "Copyright © 2014, Kyoji", "authors": ["Kyoji"], "importPaths": ["lib/"], "dependencies": { "derelict-gl3": ">=1.0.2", "derelict-sdl2": ">=1.2.1", } } -- I setup a lib folder from the project root, and I have the source files for the packages under 'import'. Is the only thing I'm missing the .dll's? Thanks!
Re: Can't link libs?
On Saturday, 7 June 2014 at 16:06:39 UTC, Adam D. Ruppe wrote: Yea, I think a lot of people do: building C++ takes some extra steps out of necessity that you can just ignore in D for the most part :) I still don't think I've fully figured out compiling in C++! For compiling the way you showed me, it almost reminds of running and/or compiling python. :3 Cool, write amazon reviews when you're done too if you feel like it :P I'm nowhere near done with the book, but I happily wrote you an Amazon review already :) (I think it said they have to review my review first or something? Idk, despite all the shopping on amazon that I do, I rarely write reviews) BTW also feel free to ask here or to even email me if you see anything in the book that you want clarification or more info on. Thanks I'll keep it in mind!
Re: Can't link libs?
On Friday, 6 June 2014 at 16:52:24 UTC, Adam D. Ruppe wrote: On Friday, 6 June 2014 at 16:41:24 UTC, K.K. wrote: I have kept all the files in one folder. So if I don't need to explicitly call the .lib in DMD, does that mean the .lib is just a passive object? Should I make libs in place of object files? If you pass all the .d files at once, you don't need the .lib at all and the compiler will also just do one object file. Simplest (and usually fastest!) way to build: dmd yourfile.d otherfile.d lib/file.d lib/otherfile.d otherlib/file.d and so on - then don't worry about object or lib files. Of course if you need a dll or something that's different... Oh okay, I get what you mean. I guess I was really over complicating it then? xD Thanks for the help Adam! -I'm totally digging your book btw! (I'll save the trouble of figuring out dll's for another day!)
Re: Can't link libs?
On Friday, 6 June 2014 at 16:33:27 UTC, Adam D. Ruppe wrote: When you compile the final program, the library .d file needs to be available too, either in the folder based on its name or passed straight to dmd explicitly. Despite the presence of the .lib file, the .d file is still needed so it can get code prototypes and type names, etc., out of it. (If you have the .d though, the lib is rarely needed. Indeed, the way I do most D libraries is to just pass all the .d files to the compiler at once and forget about lib files.) Hey Adam! I have kept all the files in one folder. So if I don't need to explicitly call the .lib in DMD, does that mean the .lib is just a passive object? Should I make libs in place of object files?
Can't link libs?
So being a noob and all I've gotten stuck on something stupid... Whenever I try to compile using DMD, and try to link .lib files I always get errors like: "file4.d(2): Error: module file3 is in file 'file3lib\file3.d' which cannot be read import path[0] = %cd%\file3 import path[1] = C:\dmd2\Windows\bin\..\..\src\phobos import path[2] = C:\dmd2\Windows\bin\..\..\src\druntime\import " For reference on this I've been using Adam's book and this page: http://wiki.dlang.org/Compiling_and_linking_with_DMD_on_Windows I also tried using COFF2OMF and COFFIMPLIB (everytime I used coffimplib it just said "Error: Missing archive signature") Here's the code I was working with (plz excuse my lazy variable/file names, wasn't feeling creative this morning :P): File3.d which I turned into a .lib - module file3lib.file3;;; import std.stdio; class shit { int lead; this(int y){lead += y;} int fuck(int x) { lead += x; return lead; } } /* void main() { auto okay = new shit(10); writeln(okay.fuck(2)); } */ -- file4.d -- module file4; import file3lib.file3; import std.stdio; void main() { auto thing = new shit(2); writeln(thing.fuck(2)); } -- I tried using different names, and making extra directories but that didn't help much ofcourse.. +I know there's that weird thing I did with file3lib & file3, but I swapped that around a bunch of times with no success. Everything's just been getting messier as I go on. I've sortof just been going in circles so if anyone could point out what I'm doing wrong it'd be a huge help! :)
Re: Help plz: Using to libraries in D?
On Tuesday, 29 April 2014 at 21:16:38 UTC, John Colvin wrote: I would recommend using dub for managing dependencies and building libraries etc. http://code.dlang.org/about Oh wow this looks awesome! I'll start messing around with it now - Thanks!
Re: Help plz: Using to libraries in D?
btw, please ignore my completely broken English in the title. Apparently I had a moment.
Help plz: Using to libraries in D?
Hi! I've kinda got a few noob questions... I've been trying to learn D for the last few months, and I've got a pretty good grasp of the syntax, but I've been having trouble figuring out how to use libraries(excluding the standard lib). I've been trying to setup a game engine, so I've tried libraries like Derelict, Allegro(the derelict version and the C version), and GFM. Plus later on when I'm having less trouble I was hoping to get PyD involved. I tried using the makefile that came with Derelict2 (win32.mak through powershell with DMD), and everything worked fine but I still didn't know what to do with the D interface files or the object lib files. Do I only worry about them at compile time? -but I still need to link to the libraries in the files that need them right? and which one, there seems to be multiple locations to go to. But then ofcouse GFM is based off of Derelict3, which doesn't seem to have any makefiles, so idk. I feel like I'm on the right path here, and have all the pieces but am totally lost on how to put it together. I feel like I've gotta ask someone directly at this point because I've just been reading manuals and books for this one step for like 2 weeks now. So if someone could break it down for me, or atleast give me a few links to some guides that'd be greatly appreciated; Thanks! (If you need me to elaborate some more on what I'm trying to do, I'd be happy to oblige)