www.digitalmars.com         C & C++   DMDScript  

D.gnu - Can't make use of any headers

reply jallersma <janallersma gmail.com> writes:
Perhaps I have a bit of a noob question, but how come I cannot 
use any of the GTKd headers on GCD? On DMD there's no header that 
works. I tried to use dub to install the GTKD libraries, but 
without any luck. Everytime I try to compile the libraries, I get:

$ dub
generated/gtkd/gtkd/Implement.d:24:8: error: module meta is in 
file 'std/meta.d' which cannot be read
  import std.meta;
         ^
import path[0] = /usr/lib/gcc/x86_64-linux-gnu/5/include/d
import path[1] = /home/name/Downloads/src
import path[2] = /home/name/Downloads/generated/gstreamer
import path[3] = /home/name/Downloads/generated/gtkd
import path[4] = /home/name/Downloads/generated/gtkdgl
import path[5] = /home/name/Downloads/generated/peas
import path[6] = /home/name/Downloads/generated/sourceview
import path[7] = /home/name/Downloads/generated/vte
gdc failed with exit code 1.



Using gtk in a random *.d file I get:

$ sudo gdc main.d -o main
main.d:1:8: error: module MainWindow is in file 
'gtk/MainWindow.d' which cannot be read
  import gtk.MainWindow, gtk.Box, gtk.Main;
         ^
import path[0] = /usr/lib/gcc/x86_64-linux-gnu/5/include/d
Jul 06
next sibling parent Mike Parker <aldacron gmail.com> writes:
On Thursday, 6 July 2017 at 14:26:08 UTC, jallersma wrote:
 Perhaps I have a bit of a noob question, but how come I cannot 
 use any of the GTKd headers on GCD? On DMD there's no header 
 that works. I tried to use dub to install the GTKD libraries, 
 but without any luck. Everytime I try to compile the libraries, 
 I get:
dub doesn't "install" anything. It puts packages in a cache in your home directory so that when you build a project using a DUB configuration it can find them. The idea is that you don't even need to download such libraries -- add them as a dependency to your project's dub.json or dub.sdl configuration and running `dub build` or `dub run` will download the dependencies if they aren't already in the cache [1]. If you don't want to use dub to manage your project, then it's best to use `dub fetch --cache=local libfoo` to pull the libfoo package down somewhere outside of the cache. I have instructions on how to do that with the Derelict packages at [2], but they apply to any dub-managed library. You'll just need to specify the import path to the compiler and the library path to the linker when you build (or copy them to your system paths manually). [1] https://code.dlang.org/getting_started [2] http://derelictorg.github.io/building/without-dub/#fetching-packages-with-dub
Jul 06
prev sibling parent reply Johannes Pfau <nospam example.com> writes:
Am Thu, 06 Jul 2017 14:26:08 +0000
schrieb jallersma <janallersma gmail.com>:

 Perhaps I have a bit of a noob question, but how come I cannot 
 use any of the GTKd headers on GCD? On DMD there's no header that 
 works. I tried to use dub to install the GTKD libraries, but 
 without any luck. Everytime I try to compile the libraries, I get:
 
 $ dub
 generated/gtkd/gtkd/Implement.d:24:8: error: module meta is in 
 file 'std/meta.d' which cannot be read
   import std.meta;
          ^
 import path[0] = /usr/lib/gcc/x86_64-linux-gnu/5/include/d
 import path[1] = /home/name/Downloads/src
 import path[2] = /home/name/Downloads/generated/gstreamer
 import path[3] = /home/name/Downloads/generated/gtkd
 import path[4] = /home/name/Downloads/generated/gtkdgl
 import path[5] = /home/name/Downloads/generated/peas
 import path[6] = /home/name/Downloads/generated/sourceview
 import path[7] = /home/name/Downloads/generated/vte
 gdc failed with exit code 1.
This means gtkD want to use the std.meta module and GDC can't find the source code for this file. Where did you get GDC from? I guess from debian/ubuntu packages? Then your GDC version is simply to old, versions from gdcproject.org/downloads should provide std.meta: https://docarchives.dlang.io/v2.068.0/phobos/std_meta.html However, I'm can't guarantee gtkD will work with the releases from gdcproject.org as these are actually out of date as well ;-) -- Johannes
Jul 06
next sibling parent jallersma <janallersma gmail.com> writes:
Thanks for the reply Mike.
It clarifies how dub works. I tried to let dub handle the 
dependencies. Unfortunately, with no luck. The package is known 
to dub ('gui' is a package created by me):

$ dub list
Packages present in the system and known to dub:
   gui ~master: /home/name/repo/addr/code/gui/
   gtk-d 3.6.5: /home/name/.dub/packages/gtk-d-3.6.5/
   gtk-d:gtkd 3.6.5: /home/name/.dub/packages/gtk-d-3.6.5/
   gtk-d:gtkdgl 3.6.5: /home/name/.dub/packages/gtk-d-3.6.5/
   gtk-d:sv 3.6.5: /home/name/.dub/packages/gtk-d-3.6.5/
   gtk-d:gstreamer 3.6.5: /home/name/.dub/packages/gtk-d-3.6.5/
   gtk-d:vte 3.6.5: /home/name/.dub/packages/gtk-d-3.6.5/
   gtk-d:peas 3.6.5: /home/name/.dub/packages/gtk-d-3.6.5/

But I get errors though:

$ sudo dub build gui
Building package gui in /home/name/repo/addr/code/gui/
Performing "debug" build using gdc for x86_64.
gui ~master: building configuration "application"...
source/main.d:1:8: error: module MainWindow is in file 
'gtk/MainWindow.d' which cannot be read
  import gtk.MainWindow, gtk.Box, gtk.Main;
         ^
import path[0] = /usr/lib/gcc/x86_64-linux-gnu/5/include/d
import path[1] = /home/name/repo/addr/code/gui/source
gdc failed with exit code 1.


After some trail and error, I thought of a solution: build gtkd 
by myself using it's repo. Running 'sudo make' informed me of 
something odd:

$ sudo make
gdc -O2 -Igenerated/gtkd -c generated/gtkd/gtkd/Implement.d -o 
generated/gtkd/gtkd/Implement.o
generated/gtkd/gtkd/Implement.d:24:8: error: module meta is in 
file 'std/meta.d' which cannot be read
  import std.meta;
         ^
import path[0] = /usr/lib/gcc/x86_64-linux-gnu/5/include/d
import path[1] = /home/name/repo/GtkD/generated/gtkd
GNUmakefile:228: recept voor doel 
'generated/gtkd/gtkd/Implement.o' is mislukt
make: *** [generated/gtkd/gtkd/Implement.o] Fout 1


Going through my dir, meta.d is missing indeed:

$ ls /usr/lib/gcc/x86_64-linux-gnu/5/include/d/std
algorithm      csv.d         math.d         socket.d        uni.d
array.d        datetime.d    mathspecial.d  socketstream.d  uri.d
ascii.d        demangle.d    mmfile.d       stdint.d        utf.d
base64.d       digest        net            stdiobase.d     uuid.d
bigint.d       encoding.d    numeric.d      stdio.d         
variant.d
bitmanip.d     exception.d   outbuffer.d    stream.d        
windows
c              experimental  parallelism.d  string.d        xml.d
compiler.d     file.d        path.d         syserror.d      zip.d
complex.d      format.d      process.d      system.d        zlib.d
concurrency.d  functional.d  random.d       traits.d
container      getopt.d      range          typecons.d
conv.d         internal      regex          typelist.d
cstream.d      json.d        signals.d      typetuple.d

Which makes me come back to Johannes, if I understand your link 
to std.meta right, std.meta is part of std/typetuple.d. Why does 
my compiler not look in std/typetuple.d instead? Maybe someone 
has a meta.d file for me? :p
Jul 07
prev sibling parent jallersma <janallersma gmail.com> writes:
In addition to Johannes' reply,
To be honest, I lost track of the GDC build I used, At least I 
installed the compiler from the site and from apt once.
Jul 07