Re: vibe.d error

2018-09-29 Thread hridyansh thakur via Digitalmars-d-learn
On Friday, 28 September 2018 at 11:08:57 UTC, Sebastiaan Koppe 
wrote:
On Thursday, 27 September 2018 at 17:37:43 UTC, hridyansh 
thakur wrote:

[snip]


What version of dmd do you use?


i am using ldc and gdc not dmd

LDC - the LLVM D compiler (1.11.0git-054d933):
  based on DMD v2.081.0 and LLVM 6.0.1
  built with LDC - the LLVM D compiler (1.11.0git-054d933)
  Default target: x86_64-pc-windows-msvc
  Host CPU: skylake
  http://dlang.org - http://wiki.dlang.org/LDC



vibe.d error

2018-09-27 Thread hridyansh thakur via Digitalmars-d-learn

i've tried both on linux and windows

whenever i try to start a vibe.d project , it fails while running 
DUB

giving exist status one on both , here is the thing

linux:

hridyansh@dilawar-PC:~/d/web$ dub

vibe-core 1.4.3: building configuration "epoll"...
../../.dub/packages/vibe-core-1.4.3/vibe-core/source/vibe/internal/interfaceproxy.d:194:10:
 error: interface 
vibe.internal.interfaceproxy.InterfaceProxy!(Stream).InterfaceProxy.Proxy 
ambiguous virtual function _destroy
  private interface Proxy : staticMap!(ProxyOf, BaseTypeTuple!I) {
  ^

  ^
../../.dub/packages/vibe-core-1.4.3/vibe-core/source/vibe/internal/interfaceproxy.d:194:10:
 error: interface 
vibe.internal.interfaceproxy.InterfaceProxy!(RandomAccessStream).InterfaceProxy.Proxy
 ambiguous virtual function _typeInfo
  private interface Proxy : staticMap!(ProxyOf, BaseTypeTuple!I) {
  ^
/usr/bin/gdc failed with exit code 1.

windows : unexpected optlink termination at EIP = 0040F60A

is there any trouble with vibe.d or D lang? i just followed the 
intruction


i have made servers in Go , but i dont like Go's syntax so i want 
to do it in D , and leverage my existing C/C++ libraries


Re: linking trouble

2018-09-06 Thread hridyansh thakur via Digitalmars-d-learn
On Thursday, 6 September 2018 at 16:59:43 UTC, rikki cattermole 
wrote:

On 07/09/2018 4:03 AM, hridyansh thakur wrote:

[...]


That definition isn't complete. Missing at the very least 
``();`` to make it a function declaration.



[...]


So what is the errors you're getting?
And what are the commands you're executing?


compiler is failing to rercognise the .o file


file io

2018-09-06 Thread hridyansh thakur via Digitalmars-d-learn

how to read a file line by line in D



linking trouble

2018-09-06 Thread hridyansh thakur via Digitalmars-d-learn

i am on windows i have tried
DMD
LDC

and i am getting same linking error with linking my c++ object

i am doing by the official tutorial (dlang spec book)

here is my app.d code

import std.stdio;

void main()
{
//writeln("Edit source/app.d to start your project.");
int[] m = someFUN(44,55);
ulong k = m.length;

for (int i=0;i
#include 
#include 

FILE *fp;

int*file_io(){

char name[20] ;

std::cout << "please enter the file name " << '\n';
std::cin >> name;

  fp = fopen(name,"r+");
 char  a  = 'a';
  int  n  =  0 ;
  while (!feof(fp)) {
a = fgetc(fp);
if (a=='\n') {
  n++;
}
  }

 int *p  = (int*)calloc(n,sizeof(int));
 for (size_t i = 0; i < n ; i++) {
   fscanf(fp,"%d",(p+i));
 }

return p;

}