I am trying to install ruby2.2 in in freebsd 7 i386, but it is throwing below error.
Can someone help how to resolve it
I
# make
CC = /usr/local/bin/gcc48
LD = ld
LDSHARED = /usr/local/bin/gcc48 -shared
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra
-Wno-unused-parameter -Wno-parentheses
-Wno-long-long -Wno-missing-field-initializers
-Wunused-variable -Wpointer-arith
-Wwrite-strings -Wdeclaration-after-statement
-Wimplicit-function-declaration
-ansi -std=iso9899:199409
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector
-fno-strict-overflow -fvisibility=hidden
-DRUBY_EXPORT -fPIE
CPPFLAGS = -I. -I.ext/include/i386-freebsd7.1 -I./include -I.
DLDFLAGS = -Wl,-soname,showflags -fstack-protector -pie
SOLIBS =
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gcc48
COLLECT_LTO_WRAPPER=
/usr/local/libexec/gcc48/gcc/i386-portbld- freebsd7.1/4.8.3/lto-wrapper
Target: i386-portbld-freebsd7.1
Configured with: ./../gcc-4.8.3/configure
--disable-bootstrap --disable-nls
--enable-gnu-indirect-function
--libdir=/usr/local/lib/gcc48
--libexecdir=/usr/local/libexec/gcc48
--program-suffix=48
--with- as=/usr/local/bin/as
--with-gmp=/usr/local
--with-gxx-include-dir=/usr/local/lib/gcc48/include/c++/
--with-ld=/usr/local/bin/ld
--with-pkgversion='FreeBSD Ports Collection'
--with-system-zlib --disable-libgcj
--enable-languages=c,c++,objc,fortran
--prefix=/usr/local --mandir=/usr/local/man
--infodir=/usr/local/info/gcc48
--build=i386-portbld-freebsd7.1
Thread model: posix
gcc version 4.8.3 (FreeBSD Ports Collection)
compiling math.c
**math.c: In function 'math_log':
**math.c:466:9: internal compiler error: Segmentation fault: 11
d += numbits * log(2); /* log(2**numbits) */****
^
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
Related
While compiling a Ruby gem's native extension, I get this error according to logs:
LD_LIBRARY_PATH=.:/home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/lib "gcc-12 -M -o conftest -I/home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/include/ruby-3.1.0/x86_64-linux -I/home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/include/ruby-3.1.0/ruby/backward -I/home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/include/ruby-3.1.0 -I. -I/opt/local/include -I/usr/local/include -I/opt/homebrew/include -I/usr/include -I/home/linuxbrew/.linuxbrew/opt/libyaml/include -I/home/linuxbrew/.linuxbrew/opt/openssl#3/include -I/home/linuxbrew/.linuxbrew/opt/readline/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wold-style-definition -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wundef -fPIC conftest.c -L. -L/home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/lib -Wl,-rpath,/home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/lib -L/opt/local/lib -Wl,-rpath,/opt/local/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib -L/opt/homebrew/lib -Wl,-rpath,/opt/homebrew/lib -L/usr/lib -Wl,-rpath,/usr/lib -L/home/linuxbrew/.linuxbrew/opt/libyaml/lib -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/libyaml/lib -L/home/linuxbrew/.linuxbrew/opt/openssl#3/lib -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/openssl#3/lib -L/home/linuxbrew/.linuxbrew/opt/readline/lib -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/readline/lib -L. -fstack-protector-strong -L/home/linuxbrew/.linuxbrew/opt/libyaml/lib -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/libyaml/lib -L/home/linuxbrew/.linuxbrew/opt/openssl#3/lib -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/openssl#3/lib -L/home/linuxbrew/.linuxbrew/opt/readline/lib -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/readline/lib -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -Wl,-rpath,/home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/lib -L/home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/lib -lruby -lm -lc"
In file included from /home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/include/ruby-3.1.0/ruby/defines.h:16,
from /home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/include/ruby-3.1.0/ruby/ruby.h:25,
from /home/linuxbrew/.linuxbrew/Cellar/ruby#3.1/3.1.3_1/include/ruby-3.1.0/ruby.h:38,
from conftest.c:1:
/usr/include/stdio.h:781:10: fatal error: bits/sys_errlist.h: No such file or directory
781 | #include <bits/sys_errlist.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
The problem is that in the -I arguments you can see -I/opt/homebrew/include -I/usr/include, and the first of these directories has /opt/homebrew/include/stdio.h which doesn't contain #include <bits/sys_errlist.h>. As far as I understand https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html, it should be used instead of /usr/include/stdio.h. What am I missing and how can I fix the problem?
Versions:
WSL 1.0.3.0
Ubuntu 20.04
Homebrew GCC 12.2.0
Homebrew Ruby 3.1.3
The awful (but working for me) workaround:
Rename /usr/include;
Compile;
Rename it back.
Fetching ruby-filemagic 0.7.2
Installing ruby-filemagic 0.7.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/quantum/.rvm/gems/ruby-2.4.2/gems/ruby-filemagic-0.7.2/ext/filemagic
/Users/quantum/.rvm/rubies/ruby-2.4.2/bin/ruby -r ./siteconf20180207-53723-1uirx0.rb extconf.rb
checking for -lgnurx... no
checking for magic_open() in -lmagic... no
*** ERROR: missing required library to compile this module
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
have_library: checking for -lgnurx... -------------------- no
"gcc -o conftest -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0/x86_64-darwin17 -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0/ruby/backward -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0 -I. -I/opt/local/include -I/usr/local/include -I/usr/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/quantum/.rvm/rubies/ruby-2.4.2/lib -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.2.4.2 -lpthread -lgmp -ldl -lobjc "
ld: warning: directory not found for option '-L/opt/local/lib'
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
"gcc -o conftest -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0/x86_64-darwin17 -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0/ruby/backward -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0 -I. -I/opt/local/include -I/usr/local/include -I/usr/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/quantum/.rvm/rubies/ruby-2.4.2/lib -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.2.4.2 -lgnurx -lpthread -lgmp -ldl -lobjc "
ld: warning: directory not found for option '-L/opt/local/lib'
ld: library not found for -lgnurx
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
13:
14: int t(void) { ; return 0; }
/* end */
--------------------
have_library: checking for magic_open() in -lmagic... -------------------- no
"gcc -o conftest -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0/x86_64-darwin17 -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0/ruby/backward -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0 -I. -I/opt/local/include -I/usr/local/include -I/usr/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/quantum/.rvm/rubies/ruby-2.4.2/lib -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.2.4.2 -lmagic -lpthread -lgmp -ldl -lobjc "
conftest.c:13:57: error: use of undeclared identifier 'magic_open'
int t(void) { void ((*volatile p)()); p = (void ((*)()))magic_open; return !p; }
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
13: int t(void) { void ((*volatile p)()); p = (void ((*)()))magic_open; return !p; }
/* end */
"gcc -o conftest -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0/x86_64-darwin17 -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0/ruby/backward -I/Users/quantum/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0 -I. -I/opt/local/include -I/usr/local/include -I/usr/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/quantum/.rvm/rubies/ruby-2.4.2/lib -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.2.4.2 -lmagic -lpthread -lgmp -ldl -lobjc "
ld: warning: directory not found for option '-L/opt/local/lib'
ld: library not found for -lmagic
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
13: extern void magic_open();
14: int t(void) { magic_open(); return 0; }
/* end */
--------------------
It looks like the magic_open is failing? How can I fix this?
AAA,
found the solution which helped me, spent like almost two days on it, so if it would save someones time posting here.
brew install libmagic
and then
env ARCHFLAGS="-arch x86_64" gem install -v 0.7.1 ruby-filemagic -- --with-magic-include=/usr/local/include --with-magic-lib=/usr/local/lib/
make sure though that you are installing required version in gem install -v 0.7.1 ruby-filemagic
sudo brew install libmagic fixed that for me
While trying to build the mysql2 gem with ruby 1.9.2-p320 on Fedora 16, I ran into this error,
reproducible like so:
gremlin:mysql2 $ cat conftest.c
#include "ruby.h"
/*top*/
int main() {return 0;}
int t() {
void ((*volatile p)());
p = (void ((*)()))rb_thread_blocking_region;
return 0;
}
gremlin:mysql2 $ gcc -o conftest -I/usr/local/include/ruby-1.9.1/i686-linux \
-I/usr/local/include/ruby-1.9.1/ruby/backward
-I/usr/local/include/ruby-1.9.1 -I.
-I/usr/local/include/ruby-1.9.1/
-D_FILE_OFFSET_BITS=64 -O3 -ggdb -Wextra -Wno-unused-parameter
-Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers
-Wno-long-long conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L.
-rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib
-lruby-static -lpthread -lrt -ldl -lnss3 -lcrypt -lm -lc
/usr/lib/gcc/i686-redhat-linux/4.6.3/../../../libcrypt.a(md5-crypt.o):
In function `__md5_crypt_r':
(.text+0x96): undefined reference to `NSSLOW_Init'
/usr/lib/gcc/i686-redhat-linux/4.6.3/../../../libcrypt.a(md5-crypt.o):
In function `__md5_crypt_r':
(.text+0xb1): undefined reference to `NSSLOWHASH_NewContext'
... and many more messages for other global functions in the nsslowhash library,
which it looks like /usr/lib/libcrypt.a expects to have available, but I don't have
it installed, and can't find the source for.
Actually, that's not totally true. I found nsslowhash as part of
the Mozilla-Central build for Firefox, but when I run nm on the compiled
.a and .so files, none of them define anything that matches NSSLOW.
So where do these names come from?
Any help appreciated.
Problem solved by adding -lfreebl3 to the LIBS CONFIG setting.
After upgrading to Ruby 1.9.3 (from 1.9.2 using system RVM) on Ubuntu 10.04.3, I removed all of my gems, and attempted to reinstall pg (ala bundle install pg).
It then threw an error and informed me that I should look at mkmf.log, both of which are included in this gist: https://gist.github.com/d05a81701d968895c730
libpq-dev, libpq5, and postgresql-client are all installed and working correctly.
Pointing gem at pg_config, and the include and bin directories directly does not appear to change anything.
I've seen several questions about similar error messages around stackoverflow, and the rest of the web, but they all appear to be simple missing dependency issues (most of them are solved by installing libpq-dev), so I'm at a bit of a loss.
Various other properties that might be useful / relevant:
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
rvm 1.10.1 (system)
gem 1.8.15
psql (PostgreSQL) 8.4.9
Thanks in advance.
gem_make.out:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
ldd.stdout:
$ldd /usr/lib/libpq.so
linux-gate.so.1 => (0xf57fe000)
libssl.so.0.9.8 => /lib/i686/cmov/libssl.so.0.9.8 (0xb77f4000)
libcrypto.so.0.9.8 => /lib/i686/cmov/libcrypto.so.0.9.8 (0xb76a2000)
libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xb75f1000)
libcom_err.so.2 => /lib/libcom_err.so.2 (0xb75ec000)
libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0xb75bd000)
libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1 (0xb758b000)
libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0xb7544000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb752b000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb73d0000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb73cc000)
libz.so.1 => /lib/libz.so.1 (0xb73b7000)
libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xb7393000)
libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0xb738b000)
libkeyutils.so.1 => /lib/libkeyutils.so.1 (0xb7386000)
libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb7372000)
/lib/ld-linux.so.2 (0xb786a000)
liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0xb7365000)
libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb734d000)
libgnutls.so.26 => /usr/lib/libgnutls.so.26 (0xb72b2000)
libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0xb72a0000)
libgcrypt.so.11 => /lib/libgcrypt.so.11 (0xb722d000)
libgpg-error.so.0 => /lib/libgpg-error.so.0 (0xb7228000)
pgconfig.stdout:
$pg_config --ldflags --libs
-Wl,-Bsymbolic-functions -Wl,--as-needed -Wl,--as-needed
-lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lkrb5 -lcom_err -lgssapi_krb5 -lz -lreadline -lcrypt -ldl -lm
mkmf.log:
find_executable: checking for pg_config... -------------------- yes
--------------------
find_header: checking for libpq-fe.h... -------------------- yes
"gcc -o conftest -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/rvm/usr/include -D_FILE_OFFSET_BITS=64 -I/usr/include/postgresql -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/usr/lib -Wl,-R/usr/local/rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/usr/lib -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -lruby -lpthread -lrt -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
"gcc -E -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/rvm/usr/include -D_FILE_OFFSET_BITS=64 -I/usr/include/postgresql -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
/* end */
--------------------
find_header: checking for libpq/libpq-fs.h... -------------------- yes
"gcc -E -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/rvm/usr/include -D_FILE_OFFSET_BITS=64 -I/usr/include/postgresql -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq/libpq-fs.h>
/* end */
--------------------
have_library: checking for PQconnectdb() in -lpq... -------------------- no
"gcc -o conftest -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/rvm/usr/include -D_FILE_OFFSET_BITS=64 -I/usr/include/postgresql -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/usr/lib -Wl,-R/usr/local/rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/usr/lib -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -lruby -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
/usr/lib/libpq.so: undefined reference to `X509_STORE_set_flags#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `CRYPTO_set_locking_callback#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ENGINE_init#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ENGINE_free#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ENGINE_load_private_key#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ENGINE_finish#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `X509_check_private_key#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `X509_free#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_CTX_new#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_pending#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `TLSv1_method#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `X509_STORE_load_locations#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_CTX_set_verify#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ERR_pop_to_mark#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_new#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_get_error#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ERR_get_error#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ENGINE_by_id#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_write#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_load_error_strings#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_CTX_load_verify_locations#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `BIO_ctrl#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `PEM_read_bio_PrivateKey#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `CRYPTO_set_id_callback#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_free#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `BIO_free#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_CTX_get_cert_store#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `X509_get_subject_name#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_shutdown#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_CTX_set_client_cert_cb#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `PEM_read_bio_X509#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ERR_set_mark#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `OPENSSL_config#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `X509_NAME_get_text_by_NID#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_read#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_CTX_ctrl#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ERR_reason_error_string#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_get_peer_certificate#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `X509_NAME_oneline#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_set_ex_data#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_set_fd#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_library_init#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `CRYPTO_num_locks#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_get_ex_data#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `SSL_connect#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `BIO_new_file#OPENSSL_0.9.8'
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: int main() {return 0;}
7: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
/* end */
"gcc -o conftest -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/rvm/usr/include -D_FILE_OFFSET_BITS=64 -I/usr/include/postgresql -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/usr/lib -Wl,-R/usr/local/rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/usr/lib -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -lruby -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function 't':
conftest.c:7: error: too few arguments to function 'PQconnectdb'
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: int main() {return 0;}
7: int t() { PQconnectdb(); return 0; }
/* end */
--------------------
have_library: checking for PQconnectdb() in -llibpq... -------------------- no
"gcc -o conftest -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/rvm/usr/include -D_FILE_OFFSET_BITS=64 -I/usr/include/postgresql -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/usr/lib -Wl,-R/usr/local/rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/usr/lib -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -lruby -llibpq -lpthread -lrt -ldl -lcrypt -lm -lc"
/usr/bin/ld: cannot find -llibpq
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: int main() {return 0;}
7: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
/* end */
"gcc -o conftest -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/rvm/usr/include -D_FILE_OFFSET_BITS=64 -I/usr/include/postgresql -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/usr/lib -Wl,-R/usr/local/rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/usr/lib -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -lruby -llibpq -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function 't':
conftest.c:7: error: too few arguments to function 'PQconnectdb'
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: int main() {return 0;}
7: int t() { PQconnectdb(); return 0; }
/* end */
--------------------
have_library: checking for PQconnectdb() in -lms/libpq... -------------------- no
"gcc -o conftest -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/rvm/usr/include -D_FILE_OFFSET_BITS=64 -I/usr/include/postgresql -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/usr/lib -Wl,-R/usr/local/rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/usr/lib -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -lruby -lms/libpq -lpthread -lrt -ldl -lcrypt -lm -lc"
/usr/bin/ld: cannot find -lms/libpq
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: int main() {return 0;}
7: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
/* end */
"gcc -o conftest -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/rvm/usr/include -D_FILE_OFFSET_BITS=64 -I/usr/include/postgresql -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/usr/lib -Wl,-R/usr/local/rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/usr/lib -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -lruby -lms/libpq -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function 't':
conftest.c:7: error: too few arguments to function 'PQconnectdb'
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: int main() {return 0;}
7: int t() { PQconnectdb(); return 0; }
/* end */
--------------------
I've got the same problem in my case was lib's inside .rvm/usr/lib which was taken to this compilation instead of lib's from system. I'm not sure why that happens and why it doesn't work (in my case on Ubuntu 10.04 x86_64) but to solve it just :
mv ~/.rvm/usr/lib ~/.rvm/usr/lib_rvm
for a while or forever ;)
If someone will investigate why that happen I will be appreciate.
Regards.
Look at the mkmf.log around line 39:
"gcc -o conftest -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/rvm/usr/include -D_FILE_OFFSET_BITS=64 -I/usr/include/postgresql -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/usr/lib -Wl,-R/usr/local/rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/usr/lib -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/rvm/rubies/ruby-1.9.3-p0/lib -lruby -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
/usr/lib/libpq.so: undefined reference to `X509_STORE_set_flags#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `CRYPTO_set_locking_callback#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ENGINE_init#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ENGINE_free#OPENSSL_0.9.8'
/usr/lib/libpq.so: undefined reference to `ENGINE_load_private_key#OPENSSL_0.9.8'
...
Smells like a missing OpenSSL. I also don't see a -lssl in the library list but the missing symbols suggest that it should be there.
So try installing the OpenSSL libraries (version 0.9.8 by the look of things). Then see if pg_config --libs contains -lssl or similar and try again. If all of this works then you might want to send a bug report to the Ubuntu people so that they can fix the libpq-dev dependencies.
Sorry, I don't have an Ubuntu set up anywhere accessible at the moment so there is some guesswork going on here.
Don't be fooled by the SSL lib being installed - have a look at your Ruby build and check the ssl build log there. I've been bitten by that one before. Other libraries that sometimes don't get loaded are the GZip ones. This may not be the problem but have a look.
UPDATE:
You need the -dev libraries.
These days I use rbenv or one of the other ruby build tools and follow whatever messages they spit out.
I have been developing a bit of code for the last few weeks. The Code is wrapped within a MEX file in MATLAB. Until yesterday my usual test took about 1 second. Suddenly after recompiling the code without changing anything, the same code takes more than 4 seconds.
The only changes happened in a function totally unrelated to the function I am calling. It seems as all compiler optimization has vanished from one second to the other.
Maybe one of you experienced similar happenings in the past and knows how to deal with that?
Thank you for your suggestions.
Edit 1:
As I assume it is something compiler dependent, here the output of the compilation command (using verbose mode)
----------------------------------------------------------------
-> MATLAB = /Applications/MATLAB_R2010b.app
-> CC = gcc-4.0
-> CC flags:
CFLAGS = -fno-common -no-cpp-precomp -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -fexceptions
CDEBUGFLAGS = -g
COPTIMFLAGS = -O2 -DNDEBUG
CLIBS = -L/Applications/MATLAB_R2010b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
arguments = -DMX_COMPAT_32
-> CXX = g++-4.0
-> CXX flags:
CXXFLAGS = -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5
CXXDEBUGFLAGS = -g
CXXOPTIMFLAGS = -O2 -DNDEBUG
CXXLIBS = -L/Applications/MATLAB_R2010b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
arguments = -DMX_COMPAT_32
-> FC = gfortran
-> FC flags:
FFLAGS = -fexceptions -m64 -fbackslash
FDEBUGFLAGS = -g
FOPTIMFLAGS = -O
FLIBS = -L/Applications/MATLAB_R2010b.app/bin/maci64 -lmx -lmex -lmat -L -lgfortran -L -lgfortranbegin
arguments = -DMX_COMPAT_32
-> LD = gcc-4.0
-> Link flags:
LDFLAGS = -Wl,-twolevel_namespace -undefined error -arch x86_64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2010b.app/extern/lib/maci64/mexFunction.map
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexmaci64
arguments = /usr/lib/libarmadillo.dylib /usr/lib/liblapack.dylib /usr/lib/libblas.dylib
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments = /usr/lib/libarmadillo.dylib /usr/lib/liblapack.dylib /usr/lib/libblas.dylib
----------------------------------------------------------------
-> g++-4.0 -c -I/usr/include -I/Applications/MATLAB_R2010b.app/extern/include -I/Applications/MATLAB_R2010b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -DMX_COMPAT_32 -O2 -DNDEBUG "file1.cpp"
-> g++-4.0 -c -I/usr/include -I/Applications/MATLAB_R2010b.app/extern/include -I/Applications/MATLAB_R2010b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -DMX_COMPAT_32 -O2 -DNDEBUG "file2.cpp"
-> g++-4.0 -c -I/usr/include -I/Applications/MATLAB_R2010b.app/extern/include -I/Applications/MATLAB_R2010b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -DMX_COMPAT_32 -O2 -DNDEBUG "file3.cpp"
-> gcc-4.0 -O -Wl,-twolevel_namespace -undefined error -arch x86_64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2010b.app/extern/lib/maci64/mexFunction.map -o "distanceSplinePoint.mexmaci64" file1.o file2.o file3.o /usr/lib/libarmadillo.dylib /usr/lib/liblapack.dylib /usr/lib/libblas.dylib -L/Applications/MATLAB_R2010b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
As it sometimes is with asking questions: You can spend hours searching for the answer, but once you decided to ask somebody for help you miraculously get the answer in your head.
Clearing the MATLAB-Workspace solved all my problems...
Still, thanks for reading ;)