My apologies if this is a duplicate question. I have inherited a project that contains ZipRuby as one of the required Gems. My local development environment is Windows 7. My ruby is 1.9.3p194. I have Rails 3.2.6. I have installed the RubyDevKit version 452.
All the other necessary gems either install or natively complile with no errors on Windows 7 but the ZipRuby gem. I have never built a gem from scratch. The gem starts to compile and gets the following errors.
`enter code here` linking shared-object zipruby.so
tmpfile.o: In function `zipruby_tmpnam':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/tmpfile.c:56: undefined reference to `strcpy_s'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/tmpfile.c:62: undefined reference to `_sopen_s'
zipruby_archive.o: In function `zipruby_archive_read':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zipruby_archive.c:1447: undefined reference to `fopen_s'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zipruby_archive.c:1471: undefined reference to `_fclose_nolock'
zip_close.o: In function `add_data':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:293: undefined reference to `ftello'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:312: undefined reference to `ftello'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:314: undefined reference to `fseeko'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:328: undefined reference to `fseeko'
zip_close.o: In function `zip_close':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:188: undefined reference to `ftello'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:153: undefined reference to `fseeko'
zip_crypt.o: In function `zip_crypt':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_crypt.c:293: undefined reference to `ftello'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_crypt.c:265: undefined reference to `fseeko'
zip_dirent.o: In function `zip_cdir_write':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_dirent.c:109: undefined reference to `ftello'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_dirent.c:116: undefined reference to `ftello'
zip_file_get_offset.o: In function `zip_file_get_offset':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_file_get_offset.c:64: undefined reference to `fseeko'
zip_fopen_index.o: In function `zip_file_fillbuf':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_fopen_index.c:155: undefined reference to `fseeko'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_fopen_index.c:155: undefined reference to `fseeko'
zip_open.o: In function `zip_checkcons':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:282: undefined reference to `fseeko'
zip_open.o: In function `zip_open':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:84: undefined reference to `fseeko'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:85: undefined reference to `ftello'
zip_open.o: In function `zip_find_central_dir':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:436: undefined reference to `fseeko'
zip_open.o: In function `zip_readcdir':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:217: undefined reference to `fseeko'
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:220: undefined reference to `ftello'
zip_source_filep.o: In function `read_file':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_source_filep.c:105: undefined reference to `fseeko'
collect2: ld returned 1 exit status make: *** [zipruby.so] Error 1
It is clear that references to one or more library files are not being resolved. I am not sure where to go with this next. Has anyone been successful in using zipruby with a mingw installation of ruby on Windows 7?
Some additional information I missed above. To get this far, I had to install the windows development version of GnuWin32. So the build command for the gem is: Gem install ZipRuby -- --with-opt-dir=Path.to.GnuWin32.folder. This folder must have a lib and bin folder in it with source code. I will update the question more if I learn more and post a solution if I figure out anything before I get an answer from anywhere else.
try gem install zipruby --version "= 0.3.6" --platform=mswin32
It worked for me.
Related
I want to configure ffmpeg with libsrt (Secure Reliable Transport) protocol on linux-Ubuntu OS, I followed the steps from this link
But when run $./configure --enable-libsrt command it gives me an error:
ERROR: srt >= 1.3.0 not found using pkg-config
I modified the configuration file, it executed the above command but when i run $ make command it end up with the following errors:
LD ffmpeg_g
libavformat/libavformat.so: undefined reference to `srt_socket'
libavformat/libavformat.so: undefined reference to `srt_bind'
libavformat/libavformat.so: undefined reference to `srt_getsockopt'
libavformat/libavformat.so: undefined reference to `srt_close'
libavformat/libavformat.so: undefined reference to `srt_epoll_add_usock'
libavformat/libavformat.so: undefined reference to `srt_startup'
libavformat/libavformat.so: undefined reference to `srt_connect'
libavformat/libavformat.so: undefined reference to `srt_epoll_release'
libavformat/libavformat.so: undefined reference to `srt_listen'
libavformat/libavformat.so: undefined reference to `srt_getlasterror'
libavformat/libavformat.so: undefined reference to `srt_getlasterror_str'
libavformat/libavformat.so: undefined reference to `srt_cleanup'
libavformat/libavformat.so: undefined reference to `srt_setsockopt'
libavformat/libavformat.so: undefined reference to `srt_sendmsg'
libavformat/libavformat.so: undefined reference to `srt_clearlasterror'
libavformat/libavformat.so: undefined reference to `srt_epoll_wait'
libavformat/libavformat.so: undefined reference to `srt_epoll_remove_usock'
libavformat/libavformat.so: undefined reference to `srt_epoll_create'
libavformat/libavformat.so: undefined reference to `srt_recvmsg'
libavformat/libavformat.so: undefined reference to `srt_accept'
collect2: error: ld returned 1 exit status
Makefile:108: recipe for target 'ffmpeg_g' failed
make: *** [ffmpeg_g] Error 1
What are exact steps to enable libsrt with ffmpeg ? Am i missing anything ? Is there any patch i have to add to existing ffmpeg source ?
Thanks in advance !!!
The answer you referred to assumes the question asker was following the Ubuntu compile guide on the FFmpeg Wiki (because they claimed to be doing so). The compile guide "installs" external libraries into ~/ffmpeg_build for a variety of reasons. The libsrt instructions in that answer does the same to fit with the wiki article. Therefore, it is expected that you will use the additional compilation options as shown in the wiki to deal with this when compiling ffmpeg.
Undo whatever changes you made to configure.
Follow the linked answer and compile libsrt if you haven't already.
Now compile ffmpeg.
make distclean
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --enable-libsrt --pkg-config-flags="--static"
Alternatively, if you don't want to have to use most of those extra options then omit -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" when compiling libsrt.
I want to install a latest Mono version on my CentOS (i686). As there is no ready to use binary distribution I tried to pull the latest Mono Source 3.2.3 from here. After pulling the source, I extracted it, change directory to it and tried below sequence of commands -
[root#localhost mono-3.2.3]# ./configure
No problems reported
[root#localhost mono-3.2.3]# make
make[3]: Entering directory `/usr/local/src/mono-3.2.3/mono/metadata'
CCLD pedump
./.libs/libmonoruntime.a(libmonoruntime_la-assembly.o): In function `InterlockedDecrement':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:66: undefined reference to `__sync_add_and_fetch_4'
./.libs/libmonoruntime.a(libmonoruntime_la-assembly.o): In function `InterlockedIncrement':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:61: undefined reference to `__sync_add_and_fetch_4'
./.libs/libmonoruntime.a(libmonoruntime_la-cominterop.o): In function `InterlockedDecrement':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:66: undefined reference to `__sync_add_and_fetch_4'
./.libs/libmonoruntime.a(libmonoruntime_la-cominterop.o): In function `InterlockedIncrement':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:61: undefined reference to `__sync_add_and_fetch_4'
./.libs/libmonoruntime.a(libmonoruntime_la-cominterop.o): In function `InterlockedDecrement':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:66: undefined reference to `__sync_add_and_fetch_4'
./.libs/libmonoruntime.a(libmonoruntime_la-image.o):/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:61: more undefined references to `__sync_add_and_fetch_4' follow
./.libs/libmonoruntime.a(libmonoruntime_la-marshal.o): In function `InterlockedCompareExchangePointer':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:56: undefined reference to `__sync_val_compare_and_swap_4'
./.libs/libmonoruntime.a(libmonoruntime_la-marshal.o): In function `InterlockedExchangePointer':
While trying to resolve this I found this,this and this. I tried to implement the solution mentioned there but had no luck.
Has anybody faced this?
Regards,
Omky
I added two compiler switches in make file.
CPPFLAGS = -m32 -march=i686
This worked for me.
I'm currently trying to compile suricata (http://suricata-ids.org/) with luajit support on my arch linux distribution with these commands:
./configure --enable-luajit --with-libpcap-includes=/usr/local/pfring/include \
--with-libpcap-libraries=/usr/local/pfring/lib --with-libnss-libraries=/usr/lib \
--with-libnss-includes=/usr/include/nss/ --with-libnspr-libraries=/usr/lib \
--with-libnspr-includes=/usr/include/nspr \
--with-libluajit-includes=/usr/local/include/luajit-2.0/ \
--with-libluajit-libraries=/usr/lib/
then:
make
but I get the following errors when I make the project:
detect-luajit.o: In function `LuaDumpStack':
detect-luajit.c:(.text+0x46e): undefined reference to `lua_tonumberx'
detect-luajit.o: In function `DetectLuajitMatchBuffer':
detect-luajit.c:(.text+0x5d6): undefined reference to `lua_getglobal'
detect-luajit.c:(.text+0x6b9): undefined reference to `lua_pcallk'
detect-luajit.c:(.text+0x7d5): undefined reference to `lua_tonumberx'
detect-luajit.o: In function `DetectLuajitMatch':
detect-luajit.c:(.text+0xaac): undefined reference to `lua_getglobal'
detect-luajit.c:(.text+0xde4): undefined reference to `lua_pcallk'
detect-luajit.c:(.text+0xf00): undefined reference to `lua_tonumberx'
detect-luajit.o: In function `DetectLuajitThreadInit':
detect-luajit.c:(.text+0x1864): undefined reference to `lua_pcallk'
detect-luajit.o: In function `DetectLuaSetupPrime':
detect-luajit.c:(.text+0x1fe7): undefined reference to `lua_pcallk'
detect-luajit.c:(.text+0x2167): undefined reference to `lua_getglobal'
detect-luajit.c:(.text+0x24bf): undefined reference to `lua_pcallk'
collect2: error: ld returned 1 exit status
make[2]: *** [suricata] Error 1
I first though it was an issue coming from the lua version. So I tried to install both the lua 5.1.5 and 5.2.2, remaking the library and symbolic links as well, and nothing worked.
Thanks for your help
In Debian and Ubuntu, the library files are installed into /usr/lib/x86_64-linux-gnu/. If arch does the same, your configure line should include: --with-libluajit-libraries=/usr/lib/x86_64-linux-gnu/
I am using this tutorial to create a cross-compiler.
I followed the gcc cross-compiler tutorial and went to the porting newlib. Everything worked fine till I tried compiling it by issuing
make all install
when I got the following error:
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
and the compilation stops.
I am using Ubuntu 11.10.
I have tried:
using different gcc, binutils and newlib versions (about 5 different combinations)
installing Texinfo
correcting makeinfo path
My cross-compiler works perfectly without the newlib just that it of course cannot include the libraries.
Even if you have makeinfo installed, it may not recognize newer versions. The following patch works. Copy below and save as "configure.patch", save it where the configure script is, then type "patch -p1 < configure.patch".
--- newlib-1.14.0-bak/configure 2008-06-10 20:49:16.918036351 +0200
+++ newlib-1.14.0/configure 2008-06-10 21:21:35.750035824 +0200
## -3542,7 +3542,7 ##
# For an installed makeinfo, we require it to be from texinfo 4.2 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.([2-9]|[1-9][0-9])|[5-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
I was trying to install 6809 GDB and got this error. I fixed by going into Makefile and changing
MAKEINFO = /opt/binutils-gdb/missing makeinfo
to
MAKEINFO = makeinfo
I also had to do this with
BISON = bison
YACC = bison -y
FLEX = flex
LEX = flex
However make got stuck with some bison function definitions:
macroexp.o: In function `get_character_constant':
/opt/vectrex/binutils-gdb/gdb/macroexp.c:364: undefined reference to `c_parse_escape'
c-lang.o:(.data.rel.ro+0x28): undefined reference to `c_parse'
c-lang.o:(.data.rel.ro+0x30): undefined reference to `c_error'
c-lang.o:(.data.rel.ro+0x148): undefined reference to `c_parse'
c-lang.o:(.data.rel.ro+0x150): undefined reference to `c_error'
c-lang.o:(.data.rel.ro+0x268): undefined reference to `c_parse'
c-lang.o:(.data.rel.ro+0x270): undefined reference to `c_error'
c-lang.o:(.data.rel.ro+0x388): undefined reference to `c_parse'
c-lang.o:(.data.rel.ro+0x390): undefined reference to `c_error'
d-lang.o:(.data.rel.ro+0x28): undefined reference to `c_parse'
d-lang.o:(.data.rel.ro+0x30): undefined reference to `c_error'
f-lang.o:(.data.rel.ro+0x28): undefined reference to `f_parse'
f-lang.o:(.data.rel.ro+0x30): undefined reference to `f_error'
objc-lang.o:(.data.rel.ro+0x28): undefined reference to `c_parse'
objc-lang.o:(.data.rel.ro+0x30): undefined reference to `c_error'
go-lang.o:(.data.rel.ro+0x28): undefined reference to `go_parse'
go-lang.o:(.data.rel.ro+0x30): undefined reference to `go_error'
m2-lang.o:(.data.rel.ro+0x28): undefined reference to `m2_parse'
m2-lang.o:(.data.rel.ro+0x30): undefined reference to `m2_error'
opencl-lang.o:(.data.rel.ro+0x28): undefined reference to `c_parse'
opencl-lang.o:(.data.rel.ro+0x30): undefined reference to `c_error'
p-lang.o:(.data.rel.ro+0x28): undefined reference to `pascal_parse'
p-lang.o:(.data.rel.ro+0x30): undefined reference to `pascal_error'
cp-support.o: In function `mangled_name_to_comp':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:644: undefined reference to `cp_demangled_name_to_comp'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:629: undefined reference to `cp_new_demangle_parse_info'
cp-support.o: In function `cp_canonicalize_string_full':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:534: undefined reference to `cp_demangled_name_to_comp'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:541: undefined reference to `cp_comp_to_string'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:545: undefined reference to `cp_demangled_name_parse_free'
cp-support.o: In function `inspect_type':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:260: undefined reference to `cp_demangled_name_to_comp'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:264: undefined reference to `cp_merge_demangle_parse_infos'
cp-support.o: In function `replace_typedefs':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:441: undefined reference to `cp_comp_to_string'
cp-support.o: In function `replace_typedefs_qualified_name':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:368: undefined reference to `cp_comp_to_string'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:343: undefined reference to `cp_comp_to_string'
cp-support.o: In function `cp_canonicalize_string':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:582: undefined reference to `cp_demangled_name_to_comp'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:587: undefined reference to `cp_comp_to_string'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:588: undefined reference to `cp_demangled_name_parse_free'
cp-support.o: In function `cp_class_name_from_physname':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:743: undefined reference to `cp_demangled_name_parse_free'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:738: undefined reference to `cp_comp_to_string'
cp-support.o: In function `method_name_from_physname':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:826: undefined reference to `cp_comp_to_string'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:830: undefined reference to `cp_demangled_name_parse_free'
cp-support.o: In function `cp_func_name':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:847: undefined reference to `cp_demangled_name_to_comp'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:855: undefined reference to `cp_comp_to_string'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:857: undefined reference to `cp_demangled_name_parse_free'
cp-support.o: In function `cp_remove_params':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:876: undefined reference to `cp_demangled_name_to_comp'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:903: undefined reference to `cp_demangled_name_parse_free'
/opt/vectrex/binutils-gdb/gdb/cp-support.c:901: undefined reference to `cp_comp_to_string'
cp-support.o: In function `do_demangled_name_parse_free_cleanup':
/opt/vectrex/binutils-gdb/gdb/cp-support.c:108: undefined reference to `cp_demangled_name_parse_free'
collect2: error: ld returned 1 exit status
Makefile:1174: recipe for target 'gdb' failed
make[2]: *** [gdb] Error 1
make[2]: Leaving directory '/opt/vectrex/binutils-gdb/gdb'
Makefile:8590: recipe for target 'all-gdb' failed
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory '/opt/vectrex/binutils-gdb'
Makefile:827: recipe for target 'all' failed
make: *** [all] Error 2
After removing the entire directory and redownloading, the makefile was all correct (no missing directory) and make and make install completed fully. So perhaps the modifications to the makefile weren't needed and I just needed to have bison, flex, and makeinfo installed.
gcc link results with errors:
dns.cpp: undefined reference to '__res_querydomain'
dns.cpp: undefined reference to '__dn_skipname'
dns.cpp: undefined reference to '__dn_expand'
dns.cpp: undefined reference to '__res_query'
Is there another library that I need to link to?
Adding -lresolv solved this for me.