www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - VisualD Projects

reply Samsinsane <s.surtees lorgames.com> writes:
Hi there,

I'm looking to evaluate D for work purposes but I've hit a 
stumbling block. I'd really like to integrate D into our existing 
code base using the mixed projects that VisualD supports. 
Unfortunately, I can't seem to find any information on how to 
consume D libraries, such as vibe.d. I've "imported" vibe.d, and 
added the 15 import paths until it stopped complaining about 
missing files, and now I'm just getting missing symbol errors.

This all feels much harder than it really should be, so I'm 
guessing I've missed something. Can someone please point me in 
the right direction?

Regards,
Sam
Jul 11 2018
next sibling parent reply Mr.Bingo <Bingo Namo.com> writes:
On Wednesday, 11 July 2018 at 09:10:10 UTC, Samsinsane wrote:
 Hi there,

 I'm looking to evaluate D for work purposes but I've hit a 
 stumbling block. I'd really like to integrate D into our 
 existing code base using the mixed projects that VisualD 
 supports. Unfortunately, I can't seem to find any information 
 on how to consume D libraries, such as vibe.d. I've "imported" 
 vibe.d, and added the 15 import paths until it stopped 
 complaining about missing files, and now I'm just getting 
 missing symbol errors.

 This all feels much harder than it really should be, so I'm 
 guessing I've missed something. Can someone please point me in 
 the right direction?

 Regards,
 Sam
You'll have to work that out on your own. Can you use dmd from the command line just fine? Can you use dub just fine? Does a dub generated visual D project have the same issues? Do you have Visual D's library import paths(both at the configuration page and the options page) set properly to what they are suppose to be? With missing symbols it can be a real pain to find out what is going on. Sometimes the distributions get corrupted somehow and the libraries simply don't work. Look at the symbol names and you can usually get some idea. If it's a vibe.d issue only(create a new hello world project and see if the same symbols are missing) then you probably have not included vibe.d's libraries. you can use dub to create a new visual D project with vibe D in it.
Jul 11 2018
parent reply Samsinsane <s.surtees lorgames.com> writes:
On Wednesday, 11 July 2018 at 16:28:42 UTC, Mr.Bingo wrote:
 You'll have to work that out on your own.
My apologies, I thought this was the place to ask for help using VisualD.
 Can you use dmd from the command line just fine?
VisualD builds the mixed project hello world just fine. I can run 'dmd' from the command line, but I'm not really sure how to use it as I'm new to D.
 Can you use dub just fine? Does a dub generated visual D 
 project have the same issues?
The DUB generated VisualD project is an old format, and only contains vibe.d?
 Do you have Visual D's library import paths(both at the 
 configuration page and the options page) set properly to what 
 they are suppose to be?
I added 15 import paths in my VisualD project for vibe.d. It started off complaining about missing import paths, so I added them until it compiled but failed to link. Then I couldn't figure out what to do.
 With missing symbols it can be a real pain to find out what is 
 going on. Sometimes the distributions get corrupted somehow and 
 the libraries simply don't work.
What do you mean the distributions get corrupted? Is this common in the D ecosystem? Will my projects get corrupted randomly?
 Look at the symbol names and you can usually get some idea. If 
 it's a vibe.d issue only(create a new hello world project and 
 see if the same symbols are missing) then you probably have not 
 included vibe.d's libraries.
Sorry, I tried not to write an excessive amount since I was mostly just wanting to know how to link a D library in VisualD. All of the symbol names are vibe.d related, but when I build the vibe.d solution (two of the 19 projects fail), but I link to 'vibed.lib' and it says that it is corrupted or invalid.
 you can use dub to create a new visual D project with vibe D in 
 it.
DUB doesn't generate mixed projects though? Thanks for taking the time to respond to my query. I'm getting the impression that linking D libraries in VisualD isn't possible. Thanks anyway!
Jul 11 2018
parent Mr.Bingo <Bingo Namo.com> writes:
On Thursday, 12 July 2018 at 02:08:55 UTC, Samsinsane wrote:
 On Wednesday, 11 July 2018 at 16:28:42 UTC, Mr.Bingo wrote:
 You'll have to work that out on your own.
My apologies, I thought this was the place to ask for help using VisualD.
No, I said it is something that you have to figure out! It depends on your specific setup but I have had this problem before I I'm offering general pointers to try. But ultimately you are going to have to dig around your system to find the files and fix the links.
 Can you use dmd from the command line just fine?
VisualD builds the mixed project hello world just fine. I can run 'dmd' from the command line, but I'm not really sure how to use it as I'm new to D.
 Can you use dub just fine? Does a dub generated visual D 
 project have the same issues?
The DUB generated VisualD project is an old format, and only contains vibe.d?
You can use dub to generate a visual D project file that you can then open up in visual studio and it should all be setup to work. You will need to read the dub documentation figure it out... it's there, just look for it. If you are going to invest some time in visual D expect to have to get familiar with finding information. D is a great language but the tooling is lacking in many areas. It all works but if you are not lucky you will have issues.
 Do you have Visual D's library import paths(both at the 
 configuration page and the options page) set properly to what 
 they are suppose to be?
I added 15 import paths in my VisualD project for vibe.d. It started off complaining about missing import paths, so I added them until it compiled but failed to link. Then I couldn't figure out what to do.
Import's are for using D's module import and are not very importing the libraries that contain the symbols that ar missing. .lib files have the "symbols"(usually functions) that are actually called(the binary machine code). You have to link in the vibed.lib and all the others that are necessary. If you create a dub project and add the vibed dependency then use dub to compile the program it should download and compile vibed, you can then use those libs in the visual D settings.
 With missing symbols it can be a real pain to find out what is 
 going on. Sometimes the distributions get corrupted somehow 
 and the libraries simply don't work.
What do you mean the distributions get corrupted? Is this common in the D ecosystem? Will my projects get corrupted randomly?
No, your projects will be fine. Every once in things happen though. You seem to get frightened easily, D might not be the thing for you. You know you can use it online to try things out to see if you like it: https://dpaste.dzfl.pl/new or https://run.dlang.io/
 Look at the symbol names and you can usually get some idea. If 
 it's a vibe.d issue only(create a new hello world project and 
 see if the same symbols are missing) then you probably have 
 not included vibe.d's libraries.
Sorry, I tried not to write an excessive amount since I was mostly just wanting to know how to link a D library in VisualD. All of the symbol names are vibe.d related, but when I build the vibe.d solution (two of the 19 projects fail), but I link to 'vibed.lib' and it says that it is corrupted or invalid.
That would explain it. You might want to ask on the vibe.d forum since this is related to vibe.d more than D.
 you can use dub to create a new visual D project with vibe D 
 in it.
DUB doesn't generate mixed projects though?
I don't think so. That might need to be addressed.
 Thanks for taking the time to respond to my query. I'm getting 
 the impression that linking D libraries in VisualD isn't 
 possible. Thanks anyway!
No, it's very easy with pragma(lib or -l /OUT:"App.exe" /MANIFEST /NXCOMPAT /PDB:"App.pdb" /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /INCREMENTAL /PGD:"App.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"App.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1 This is the linker output, notice how visual D has automatically added the lib's. Yours should be similar but have the vibed libs. If you failed to compile it then the lib doesn't exist so the symbols will be missing.
Jul 11 2018
prev sibling parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 11/07/2018 11:10, Samsinsane wrote:
 Hi there,
 
 I'm looking to evaluate D for work purposes but I've hit a stumbling 
 block. I'd really like to integrate D into our existing code base using 
 the mixed projects that VisualD supports. Unfortunately, I can't seem to 
 find any information on how to consume D libraries, such as vibe.d. I've 
 "imported" vibe.d, and added the 15 import paths until it stopped 
 complaining about missing files, and now I'm just getting missing symbol 
 errors.
 
 This all feels much harder than it really should be, so I'm guessing 
 I've missed something. Can someone please point me in the right direction?
 
 Regards,
 Sam
As Mr.Bingo pointed out, it is probably best to copy the settings from the dub-generated visualdproj projects. Please especially check the versions defined in the separate projects. Linking should be no problem, as this is using the VC++ linking mechanism, i.e. you either specify library inputs on the Linker->Input page or add the library projects as "References".
Jul 12 2018
parent reply Samsinsane <s.surtees lorgames.com> writes:
On Thursday, 12 July 2018 at 07:48:15 UTC, Rainer Schuetze wrote:
 On 11/07/2018 11:10, Samsinsane wrote:
 Hi there,
 
 I'm looking to evaluate D for work purposes but I've hit a 
 stumbling block. I'd really like to integrate D into our 
 existing code base using the mixed projects that VisualD 
 supports. Unfortunately, I can't seem to find any information 
 on how to consume D libraries, such as vibe.d. I've "imported" 
 vibe.d, and added the 15 import paths until it stopped 
 complaining about missing files, and now I'm just getting 
 missing symbol errors.
 
 This all feels much harder than it really should be, so I'm 
 guessing I've missed something. Can someone please point me in 
 the right direction?
 
 Regards,
 Sam
As Mr.Bingo pointed out, it is probably best to copy the settings from the dub-generated visualdproj projects. Please especially check the versions defined in the separate projects. Linking should be no problem, as this is using the VC++ linking mechanism, i.e. you either specify library inputs on the Linker->Input page or add the library projects as "References".
Thanks for the help, I really appreciate it! Regarding the "References" system, when I click "Add Reference" I don't see any of the 'visualdproj' projects - should I? After a few hours of fiddling around I finally have it working. There's a number of configuration issues with consuming vibe.d with VisualD. Five of the projects just fail to build if the compile and link stage is separate, and the format of the lib file is incorrect by default (OMF instead of COFF). vibe.d appears to have a prebuilt dependency (OpenSSL) and that it's in OMF format too, but there's a configuration option for using the COFF version instead. As for the issue with vibe.d not building, DMD v2.081.0 had a regression that was fixed in v2.081.1 - I was just unlucky enough to grab v2.081.0 the day before the fix was released.
Jul 15 2018
parent Mr.Bingo <Bingo Namo.com> writes:
On Monday, 16 July 2018 at 05:54:46 UTC, Samsinsane wrote:
 On Thursday, 12 July 2018 at 07:48:15 UTC, Rainer Schuetze 
 wrote:
 On 11/07/2018 11:10, Samsinsane wrote:
 Hi there,
 
 I'm looking to evaluate D for work purposes but I've hit a 
 stumbling block. I'd really like to integrate D into our 
 existing code base using the mixed projects that VisualD 
 supports. Unfortunately, I can't seem to find any information 
 on how to consume D libraries, such as vibe.d. I've 
 "imported" vibe.d, and added the 15 import paths until it 
 stopped complaining about missing files, and now I'm just 
 getting missing symbol errors.
 
 This all feels much harder than it really should be, so I'm 
 guessing I've missed something. Can someone please point me 
 in the right direction?
 
 Regards,
 Sam
As Mr.Bingo pointed out, it is probably best to copy the settings from the dub-generated visualdproj projects. Please especially check the versions defined in the separate projects. Linking should be no problem, as this is using the VC++ linking mechanism, i.e. you either specify library inputs on the Linker->Input page or add the library projects as "References".
Thanks for the help, I really appreciate it! Regarding the "References" system, when I click "Add Reference" I don't see any of the 'visualdproj' projects - should I? After a few hours of fiddling around I finally have it working. There's a number of configuration issues with consuming vibe.d with VisualD. Five of the projects just fail to build if the compile and link stage is separate, and the format of the lib file is incorrect by default (OMF instead of COFF). vibe.d appears to have a prebuilt dependency (OpenSSL) and that it's in OMF format too, but there's a configuration option for using the COFF version instead. As for the issue with vibe.d not building, DMD v2.081.0 had a regression that was fixed in v2.081.1 - I was just unlucky enough to grab v2.081.0 the day before the fix was released.
Yes, these are "types" of problems you will experience with D. It is actually a very poorly(very is probably too strong but) designed tooling. It's typical 80's command line crap that gets a nice gui around it. There is just a lot of problems with the D ecosystem but generally you can fix them with a little elbow grease and possibly some help on the forums(the forums tend to be helpful). Really, the only thing that makes D shine is the language itself. All the tools are pretty much sub-par compared to what is offered in the world today. The good news is that once you get things setup generally they will work until you hit some bug where you have to upgrade. Upgrading can require one to remember all the hacks that were required to get it up in the first place, which can be a pain. My strategy is this; I have a directory where all D things go. Even stuff like MS linker and mscoff files are copied to this dir in various locations. Everything sorted out properly. This master directory then can be archived so that snapshots in time can be taken. Any time I upgrade D I always back up the directory and go about it. Things in D slowly get better but it can actually take decades for some things to get fixed. Note that D on windows is less used and hence generally has more problems. The point what I'm saying is that D does have problems but it also does work and the language is amazing(well, you can do some amazing things with it that you simply won't get anywhere else). If your "lucky" the problems you experienced here will be it, but chances are you will have similar "bumps" along the way. The problems will shift around from tooling to language issues(there are still plenty of compiler bugs that usually creep in once you get advanced enough to expose them(start using parts of the language which are not used as much)).
Jul 16 2018