dlx icon indicating copy to clipboard operation
dlx copied to clipboard

compilation problem

Open RobinHankin opened this issue 7 years ago • 2 comments

Hi there blynn (I am still a little unsure of github etiquette; apologies if I'm not getting it right).

I followed the instructions in dlx/README.asciidoc but encountered some errors. Following edited slightly for clarity:

rstudio % git clone https://github.com/blynn/blt
Cloning into 'blt'...
[snip]
rstudio % git clone https://github.com/blynn/dlx
Cloning into 'dlx'...
[snip]
rstudio % cd dlx
dlx % make
cc -O3 --std=gnu99 -Wall -o grizzly grizzly.c dlx.c -I ../blt ../blt/blt.c
In file included from grizzly.c:19:
../blt/blt.h:65:21: error: function definition is not allowed here
  int f(BLT_IT *it) { return fun(it), 1; }
                    ^
../blt/blt.h:66:28: error: use of undeclared identifier 'f'
  blt_allprefixed(blt, "", f);
                           ^
[other similar errors here]

I'm on macos 10.13.6. Can you advise?

RobinHankin avatar Dec 05 '18 20:12 RobinHankin

In case you never received any offline responses to this from the author...

The code makes fairly heavy use of nested functions, which is an extension to gcc that does not appear to be available in clang.

I'm not an expert in these, but as I have begun digging through these libraries, nested functions seem to be used to make some of the code more concise. Additionally, from what I have read online (not validated through testing), it may improve performance slightly.

Rather than installing gcc on my drive, I went the "easier" route of using an ubuntu virtual machine to compile and use the code since I am in the prototyping phase of a project that only needs a command line interface.

My apologies if I got any of this wrong -- it's what I've been able to figure out thus far.

fletcher avatar Dec 31 '20 16:12 fletcher

Sorry, yes, I'm a fan of lexical closures so I use this extension of gcc, though these days I don't care that much, so I'd be happy to accept a pull request that replaces them with ordinary functions.

blynn avatar Feb 16 '22 04:02 blynn