Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation problem #2

Open
RobinHankin opened this issue Dec 5, 2018 · 2 comments
Open

compilation problem #2

RobinHankin opened this issue Dec 5, 2018 · 2 comments

Comments

@RobinHankin
Copy link

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?

@fletcher
Copy link

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.

@blynn
Copy link
Owner

blynn commented Feb 16, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants