dstep icon indicating copy to clipboard operation
dstep copied to clipboard

Generated content is only "extern(C):".

Open repeatedly opened this issue 11 years ago • 9 comments

I tried dstep for header conversion, but dstep doesn't work.

/path/to/dev/dstep$ bin/dstep test_files/arrays.h
extern (C):

I built dstep with 2.059(tried many 'git co') or 2.060, but results are same... My env is Mac OS X 10.7.5 without dvm.

Lastly, I noticed README is now incorrect.

LLVM and Clang

'git submodule add -f http://llvm.org/git/clang.git tools/clang' instead of 'git submodule add http://llvm.org/git/clang.git'. Currenlty, above command failed.

llvm/tools$ git submodule add http://llvm.org/git/clang.git
You need to run this command from the toplevel of the working tree.

And remove clang from .gitignore.

Tango-D2

Tango-D2 doesn't include osx32 directory. So we should do make.

$ make -f build/Makefile static-lib -j4
$ cp libtango-dmd.a <path/to/dstep>/libtango.a

repeatedly avatar Sep 30 '12 16:09 repeatedly

I've update the readme file. What exactly is the problem when you run dstep, no output?

jacob-carlborg avatar Sep 30 '12 17:09 jacob-carlborg

I assume you've compiled this from source. Does the pre-compiled binary work?

jacob-carlborg avatar Sep 30 '12 17:09 jacob-carlborg

@jacob-carlborg Yes, the problem is no output. The content of generated .d file is only 'extern(C):'.

I didn't know the pre-compiled binary. I tried the pre-compiled binary for Mac, it works fine! This is a big help :)

repeatedly avatar Oct 01 '12 01:10 repeatedly

That's good to hear. But I'm still interested in figuring out way it didn't work when you compiled from source. Did you try any of the other test files?

jacob-carlborg avatar Oct 01 '12 08:10 jacob-carlborg

Yes, other test_files and C header too.

I will try updated README process later.

repeatedly avatar Oct 02 '12 04:10 repeatedly

I'm stuck with the same problem, although I swear I had dstep working successfully on the same codebase just a couple of years ago (many thanks for that!)

I'm using Linux and have tried all sorts of clang/dstep version combinations to no avail. To reproduce, clone https://github.com/lomereiter/htslib, install libclang, and run

cd htslib/
CLANG_VERSION=3.8
DSTEP_BIN=../../dstep/bin/dstep # tweak dstep/clang paths as needed
export LD_LIBRARY_PATH=/usr/lib/llvm-${CLANG_VERSION}/lib
${DSTEP_BIN} --comments=false -I. -Icram/ -Ihtslib/ \
  -I/usr/include/clang/${CLANG_VERSION}/include/ cram/cram.h -o htslib.d; ls -l htslib.d

I would hope for some kind of an error message at least, but all I get is extern(C): as the output.

lomereiter avatar Apr 09 '17 09:04 lomereiter

Yeah, I reproduced the issue, so it isn't only your setup.

ciechowoj avatar Apr 09 '17 12:04 ciechowoj

Ok, so the problem is "cram/cram.h" contains only include files, and no declarations and dstep translates only the content of the exact input file and nothing else. In your case you need to fuse those files into single file of execute dstep for every file separately (I think there is option to execute dstep at the whole directory at once, or maybe not)...

ciechowoj avatar Apr 09 '17 13:04 ciechowoj

Ok, so the problem is "cram/cram.h" contains only include files, and no declarations and dstep translates only the content of the exact input file and nothing else

Yes, that makes sense.

In your case you need to fuse those files into single file of execute dstep for every file separately (I think there is option to execute dstep at the whole directory at once, or maybe not)...

It's possible to run DStep on a whole directory (with master). I would recommend doing that instead of merging the header files. Then manually create a single file with public imports, if necessary.

jacob-carlborg avatar Apr 09 '17 19:04 jacob-carlborg