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

Implicit declaration in C99 error when packing a rails project using Ruby 2.4.10 #150

Open
dennislysenko opened this issue Feb 11, 2021 · 3 comments

Comments

@dennislysenko
Copy link

Hey @pmq20 first of all, I'm really glad you decided to work on a library like this as it's something I've been looking for for a long time.

I'm having an issue compiling a base project made by just installing ruby 2.4.10 via rvm, generating a base rails project (rails new testproject), and packing that project using rubyc -r .. Same issue in ruby 2.5.

Relevant log lines:

squash_dir.c:479:2: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        free(path0);
        ^
1 error generated.
make: *** [squash_dir.o] Error 1
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "CFLAGS"=>" -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe  -I/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/zlib  -I/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/openssl/include  -I/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/gdbm/build/include  -I/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/yaml/build/include  -I/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/libffi/build/lib/libffi-3.2.1/include  -I/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/ncurses/build/include  -I/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/readline/build/include ", "LDFLAGS"=>" -L/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/zlib /var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/zlib/libz.a  -L/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/openssl  -L/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/gdbm/build/lib  -L/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/yaml/build/lib  -L/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/libffi/build/lib  -L/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/ncurses/build/lib  -L/var/folders/ts/g6q5nn2x3sv4xnz3f7wzyd840000gn/T/rubyc/readline/build/lib ", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "make -j4 -j1"]

More logs at https://pastebin.com/VZGqqtst

I'm guessing this is some sort of issue with my system setup but I'm not really sure where to start. Any ideas? Should I be using another ruby version?

@tasdendu
Copy link

Are you able to solve this issue @dennislysenko? I am also having the same issue. Can you please post the answer if you got the solution?

@alexeymorozov
Copy link

With help of @CAMOBAP on macOS this error disappeared with:

env CC="xcrun clang -mmacosx-version-min=10.10 -Wno-implicit-function-declaration" bin/rubyc --clean-tmp bin/rubyc -o rubyc-darwin-x64

@soumyaray
Copy link

I'm getting a similar issue trying to build an executable gem (see issue #170). Would something like this solution help you think?

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

4 participants