This question already has answers here:
Mountain Lion rvm install 1.8.7 x11 error
(5 answers)
Closed 8 years ago.
I had a fresh install of Mountain Lion and installed the Xcode Command Line Tools, . I was able to get homebrew running and installed RVM. Unfortunately, I can't get RVM to install ree-1.8.7-head. It fails when compiling. I thought it was related to X11, so I installed XQuartz. Still no joy. Then I went ahead and installed the full Xcode from the app store. Still no joy. Anyone gotten this going on a fresh Mountain Lion install?
From the bottom of the .rvm/log/ree-1.8.7-head/make.log:
Find Tcl/Tk libraries. Make tcltklib.so which is required by Ruby/Tk.
gcc -I. -I../.. -I../../. -I../.././ext/tk -DHAVE_RB_SAFE_LEVEL -DHAVE_RB_HASH_LOOKUP -DHAVE_RB_PROC_NEW -DHAVE_RB_OBJ_TAINT -DHAVE_ST_PTR -DHAVE_ST_LEN -DRUBY_VERSION=\"1.8.7\" -DRUBY_RELEASE_DATE=\"2012-02-08\" -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -DWITH_TCL_ENABLE_THREAD=0 -fno-common -g -O2 -pipe -fno-common -c stubs.c
In file included from stubs.c:10:
/usr/include/tk.h:78:23: error: X11/Xlib.h: No such file or directory
In file included from stubs.c:10:
/usr/include/tk.h:549: error: expected declaration specifiers or ‘...’ before ‘Window’
/usr/include/tk.h:549: error: ‘Window’ declared as function returning a function
.
.
/usr/include/tkDecls.h:1240: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute
__’ before ‘Tk_GetBitmapFromObj’
/usr/include/tkDecls.h:1245: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/tkDecls.h:1356: error: expected ‘)’ before ‘*’ token
/usr/include/tkDecls.h:1362: error: expected ‘)’ before ‘*’ token
/usr/include/tkDecls.h:1387: error: expected declaration specifiers or ‘...’ before ‘GC’
/usr/include/tkDecls.h:1399: error: expected declaration specifiers or ‘...’ before ‘GC’
/usr/include/tkDecls.h:1413: error: expected declaration specifiers or ‘...’ before ‘Pixmap’
/usr/include/tkDecls.h:1420: error: expected declaration specifiers or ‘...’ before ‘XColor’
/usr/include/tkDecls.h:1448: error: expected declaration specifiers or ‘...’ before ‘Pixmap’
/usr/include/tkDecls.h:1524: error: expected ‘)’ before ‘*’ token
/usr/include/tkDecls.h:1621: error: expected declaration specifiers or ‘...’ before ‘Drawable’
/usr/include/tkDecls.h:1656: error: expected ‘)’ before ‘*’ token
/usr/include/tkDecls.h:1661: error: expected ‘)’ before ‘*’ token
/usr/include/tkDecls.h:1692: error: expected specifier-qualifier-list before ‘XColor’
make[1]: *** [stubs.o] Error 1
make: *** [all] Error 1
try
rvm reinstall 1.8.7 --without-tcl --without-tk
but still your problem might to be related to gcc-4.2 -> it's required for MRI ruby, there are some successes with llvm/clang, but still it fails with Fibers
If you don't need tcl or tk and are using rbenv, this should work:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
CC=/usr/local/bin/gcc-4.2 CONFIGURE_OPTS="--without-tcl --without-tk" rbenv install 1.8.7-p358
Related
I removed installed ruby: sudo apt-get purge ruby
and I Download and compile ruby:
wget http://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.gz
tar -xzvf ruby-1.8.7-p374.tar.gz
cd ruby-1.8.7-p374
./configure
AND Build a MakeFile using the specific compiler.
make CC=gcc-4.4
An error occurred when compiling.
Error in compiling openssl
compiling openssl
make[1]: 디렉터리 '/ruby-1.8.7-p374/ext/openssl' 들어감
gcc-4.4 -I. -I../.. -I../../. -I../.././ext/openssl -
DRUBY_EXTCONF_H=\"extconf.h\" -fPIC -g -O2 -c ossl_hmac.c
In file included from ossl.h:57,
from ossl_hmac.c:13:
/usr/include/openssl/asn1_mac.h:10: error: #error "This file is obsolete;
please update your software."
In file included from ossl.h:205,
from ossl_hmac.c:13:
openssl_missing.h:79: error: macro "EVP_MD_CTX_create" passed 1 arguments, but takes just 0
openssl_missing.h:83: error: expected declaration specifiers or ‘...’ before ‘(’ token
openssl_missing.h:83: error: conflicting types for ‘EVP_MD_CTX_reset’
/usr/include/openssl/evp.h:498: note: previous declaration of
‘EVP_MD_CTX_reset’ was here
openssl_missing.h:91: error: expected declaration specifiers or ‘...’ before ‘(’ token
ossl_hmac.c: In function ‘ossl_hmac_alloc’:
ossl_hmac.c:54: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’
ossl_hmac.c:54: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’ `enter code here`
ossl_hmac.c: In function ‘ossl_hmac_initialize’:
ossl_hmac.c:73: warning: ‘HMAC_Init’ is deprecated (declared at /usr/include/openssl/hmac.h:28)
ossl_hmac.c: In function ‘hmac_final’:
ossl_hmac.c:114: error: storage size of ‘final’ isn’t known
ossl_hmac.c: In function ‘ossl_hmac_reset’:
ossl_hmac.c:182: warning: ‘HMAC_Init’ is deprecated (declared at /usr/include/openssl/hmac.h:28)
Makefile:197: recipe for target 'ossl_hmac.o' failed
make[1]: *** [ossl_hmac.o] Error 1
make[1]: DIR '/ruby-1.8.7-p374/ext/openssl' 나감
Makefile:293: recipe for target 'all' failed
make: *** [all] Error 1`
How can i resolve this error..
I ran into a very similar error installing 1.9.3 on Ubuntu 18.04. I did the following to get around it -
sudo apt install libssl1.0-dev
and then rebuilt Ruby.
I updated my program to --std=c++11 and now I get:
g++ --std=c++11 -c eqc.cpp
In file included from eqc.cpp:16:0:
eqc.h:372:80: error: ‘deprecated’ was not declared in this scope
eqc.h:372:92: error: expected ‘)’ before ‘;’ token
eqc.h:372:92: error: expected ‘)’ before ‘;’ token
In file included from eqc.cpp:16:0:
eqc.h:372:74: error: expected unqualified-id before ‘)’ token
equation &operator[](const std::string &label) __attribute__((deprecated));
If I use the new way of specifying attributes, it's the same:
In file included from eqc.cpp:16:0:
eqc.h:371:67: error: ‘deprecated’ was not declared in this scope
eqc.h:371:79: error: expected ‘]’ before ‘;’ token
In file included from eqc.cpp:16:0:
eqc.h:371:61: error: expected unqualified-id before ‘]’ token
equation &operator[](const std::string &label) [[deprecated]];
Since I can't find anything on the web about this error, I must be making some silly mistake. But which?
The system is Ubuntu 16.04 and the compiler:
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
The problem was a library (libginac6 1.7.0) that said
#define deprecated attribute ((deprecated));
After updating the library (to version >= 1.7.1) the error disappeared since the library now says
#define attribute_deprecated attribute ((deprecated));
I've downloaded Stalin Scheme and tried to install it on OSX, but I've got this error:
gcc -O -I./include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DSILENT -DALL_INTERIOR_POINTERS -DLARGE_CONFIG -DUSE_MMAP -DDONT_ADD_BYTE_AT_END -o if_mach ./if_mach.c
In file included from ./if_mach.c:3:
./include/private/gcconfig.h:477: error: expected identifier or ‘(’ before ‘--’ token
./if_mach.c: In function ‘main’:
./if_mach.c:14: error: ‘MACH_TYPE’ undeclared (first use in this function)
./if_mach.c:14: error: (Each undeclared identifier is reported only once
./if_mach.c:14: error: for each function it appears in.)
make: *** [if_mach] Error 1
cp: gc6.8/gc.a: No such file or directory
ranlib: can't open file: include/libgc.a (No such file or directory)
Cannot (yet) run Stalin on this architecture
Is there any workaround for this?
I upgraded rvm to 1.15.8, then went back down to 1.15.7 after having some problems in zsh. After downgrading, my Ruby 1.9+ versions went back in fine, but 1.8.7 won't install again.
There are two errors that are occurring:
Error running 'patch -F 25 -p1 -N -f <"/Users/me/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"', please read /Users/me/.rvm/log/ruby-1.8.7-p352/patch.apply.stdout-rouge-fix.log
The contents of that file are:
[2012-09-11 01:05:59] patch -F 25 -p1 -N -f <"/Users/me/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"
patching file lib/mkmf.rb
Hunk #1 FAILED at 201.
1 out of 1 hunk FAILED -- saving rejects to file lib/mkmf.rb.rej
and:
Error running 'make ', please read /Users/me/.rvm/log/ruby-1.8.7-p352/make.log
There has been an error while running make. Halting the installation.
and the contents of that file are (only the first few lines beginning with the errors):
Fail to find [tclConfig.sh, tkConfig.sh]
Use MacOS X Frameworks.
Find Tcl/Tk libraries. Make tcltklib.so which is required by Ruby/Tk.
gcc-4.2 -I. -I../.. -I../../. -I../.././ext/tk -DHAVE_RB_SAFE_LEVEL -DHAVE_RB_HASH_LOOKUP -DHAVE_RB_PROC_NEW -DHAVE_RB_OBJ_TAINT -DHAVE_ST_PTR -DHAVE_ST_LEN -DRUBY_VERSION=\"1.8.7\" -DRUBY_RELEASE_DATE=\"2011-06-30\" -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -DWITH_TCL_ENABLE_THREAD=0 -fno-common -g -O2 -fno-common -pipe -fno-common -c stubs.c
In file included from stubs.c:10:
/usr/include/tk.h:78:23: error: X11/Xlib.h: No such file or directory
In file included from stubs.c:10:
/usr/include/tk.h:549: error: expected declaration specifiers or ‘...’ before ‘Window’
/usr/include/tk.h:549: error: ‘Window’ declared as function returning a function
/usr/include/tk.h:552: error: expected declaration specifiers or ‘...’ before ‘XEvent’
/usr/include/tk.h:561: error: expected specifier-qualifier-list before ‘Tk_ClassCreateProc’
/usr/include/tk.h:655: error: expected specifier-qualifier-list before ‘Bool’
/usr/include/tk.h:677: error: expected specifier-qualifier-list before ‘Bool’
/usr/include/tk.h:756: error: expected specifier-qualifier-list before ‘Display’
/usr/include/tk.h:902: error: expected declaration specifiers or ‘...’ before ‘XPoint’
/usr/include/tk.h:996: error: expected declaration specifiers or ‘...’ before ‘Display’
One of the applications I support is 1.8.7. I am dead in the water. This looks like it might be a problem with Mountain Lion vs. rvm. Can anyone point me in the right direction?
UPDATE:
I got over the first error by doing "reinstall" instead of just "install". Even though 1.8.7-p352 was not in the list of rubies given by the command "rvm list rubies".
it is problem in detecting tcl/tk by ruby 1.8.7, the solution is to disable it:
rvm reinstall 1.8.7 --without-tcl --without-tk
the other solution when tcl/tk is needed: https://stackoverflow.com/a/11666019/497756
I think I ended up with two similar questions on sf here. My main problem was that the tcl.h include file on Mountain Lion (location: /usr/include/tcl.h symlinked) could not resolve an internal reference it had to "X11/Xlib.h". I thought that installing tcl and tk through homebrew would fix the problem by generating a path to Xlib.h that could be resolved. So I ran:
brew install tcl
and:
brew install tk
and:
rvm remove 1.8.7-p352
rvm install 1.8.7-p352
and it worked. But Michal's answer above would have worked just as well I think. This answer will serve to help people build it that need tcl and tk.
I am trying to compile imapfilter 2.4.1 ( https://github.com/lefcha/imapfilter ) in CentOS 5.6. I believe I've got all the dependencies sorted but when I run make I get:
make[1]: Entering directory `/home/src/imapfilter-2.4.1/src'
cc -Wall -O -DMAKEFILE_SHAREDIR='"/usr/local/share/imapfilter"' -c -o core.o core.c
core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’
core.c: In function ‘ifcore_append’:
core.c:947: warning: implicit declaration of function ‘lua_strlen’
core.c: In function ‘luaopen_ifcore’:
core.c:1162: warning: implicit declaration of function ‘luaL_register’
core.c:1162: error: ‘ifcorelib’ undeclared (first use in this function)
core.c:1162: error: (Each undeclared identifier is reported only once
core.c:1162: error: for each function it appears in.)
make[1]: *** [core.o] Error 1
make[1]: Leaving directory `/home/src/imapfilter-2.4.1/src'
make: *** [all] Error 2
Based on other user comments and file revision dates I am sure this should compile. I am guessing I'm missing a library somewhere. I'll appreciate any help I can get on this.
Starting from first error message:
core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’
Line 41 of core.c is:
static const luaL_reg ifcorelib[] = {
Cryptic message from gcc means that it knows nothing about what is the luaL_reg and it thinks that it is variable name. Then it goes into panic when reads second variable name in the same definition/declaration. luaL_reg should be something like struct.
So, it seems that your problems are located in LUA development headers. May be you have too old or even to modern Lua package.
The imapfilter's github's readme says:
Compile time requirements are Lua (version 5.1)
Are you sure that your lua is 5.1 and the lua-devel (or any other package with lua headers) is 5.1 too?