libredwg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libredwg] Compiling error


From: gagan
Subject: [libredwg] Compiling error
Date: Mon, 29 Apr 2013 16:10:53 +0530

Though through make and make check all file get compiled. I was trying
to compile only test.c file using g++ and I got this error :-

address@hidden:~/projects/libredwg/examples$ g++ test.c
In file included from test.c:23:0:
suffix.c: In function ‘char* suffix(const char*, const char*)’:
suffix.c:34:25: error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]

-------------------------------- suffix.c file ----------------------
char *
suffix (const char *filename, const char *ext)
{
  char *copy = strdup (filename);
  char *base = basename (copy);
  int len = strlen (base) + 1 + strlen (ext) + 1;
  char *rv = malloc (len);               //error seems to be here
  char *dot;

  if ((dot = strrchr (base, '.'))
      && dot + 4 < base + len
      && !strncmp (1 + dot, "dwg", 3))
    *dot = '\0';
  snprintf (rv, len, "%s.%s", base, ext);
  free (copy);
  return rv;
}
---------------------------------------------------------------------------
Any ideas why this error is coming ? How to solve this error ?

-- 
Thanks
Gaganjyot



reply via email to

[Prev in Thread] Current Thread [Next in Thread]