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/
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'm trying to install cube library,required for installing SCALASCA.I've installed already PAPI,OPARI and Qt.I also installed zlib both from source and by apt-get.But during cube linking(make command) an error occurs refering to some classes of zlib.
This is the configuration command i use:
./configure --prefix=/opt/cube-4.2.2 --with-qt=/opt/Qt --with-frontend-zlib=/usr/include/i386-linux-gnu --with-compression=full
this is the output from configuration: cube lib configuration output
and this is the make output: cube lib make command output
The error:
./.libs/libcube4.so: undefined reference to `gzofstream::gzofstream()'
./.libs/libcube4.so: undefined reference to `gzifstream::gzifstream(int, std::_Ios_Openmode)'
./.libs/libcube4.so: undefined reference to `gzifstream::gzifstream()'
./.libs/libcube4.so: undefined reference to `gzfilebuf::~gzfilebuf()'
./.libs/libcube4.so: undefined reference to `gzifstream::open(char const*, std::_Ios_Openmode)'
./.libs/libcube4.so: undefined reference to `gzofstream::close()'
./.libs/libcube4.so: undefined reference to `gzofstream::open(char const*, std::_Ios_Openmode)'
./.libs/libcube4.so: undefined reference to `gzifstream::close()'
collect2: error: ld returned 1 exit status
I'm using xubuntu 14.04 on vmware
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.
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.
I've spent quite a bit of time trying to get an expat based sample program to compile.
I was receiving the following error message when I tried to compile
gcc -Wall -lexpat line.c -o blah
line.c: In function ‘main’:
line.c:99:8: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘XML_Size’ [-Wformat]
/tmp/ccUa3vfD.o: In function `printcurrent':
line.c:(.text+0x42): undefined reference to `XML_SetDefaultHandler'
line.c:(.text+0x4d): undefined reference to `XML_DefaultCurrent'
line.c:(.text+0x60): undefined reference to `XML_SetDefaultHandler'
/tmp/ccUa3vfD.o: In function `main':
line.c:(.text+0x162): undefined reference to `XML_ParserCreate'
line.c:(.text+0x1ad): undefined reference to `XML_UseParserAsHandlerArg'
line.c:(.text+0x1c9): undefined reference to `XML_SetElementHandler'
line.c:(.text+0x1dd): undefined reference to `XML_SetCharacterDataHandler'
line.c:(.text+0x1f1): undefined reference to `XML_SetProcessingInstructionHandler'
line.c:(.text+0x2b2): undefined reference to `XML_Parse'
line.c:(.text+0x2c2): undefined reference to `XML_GetErrorCode'
line.c:(.text+0x2ca): undefined reference to `XML_ErrorString'
line.c:(.text+0x2d8): undefined reference to `XML_GetCurrentLineNumber'
collect2: ld returned 1 exit status
I had already run the following commands:
sudo apt-get install expat libexpat1 libexpat1-dev libxmltok1-dev
So I messed around for ages, trying to get the error message to go away so I could compile this (simple) little program, but to no avail.
Eventually, out of sheer randomness, I decided to switch to a Virtual Terminal.
I ran exactly the same command, this time it worked without a problem.
Can anyone tell me why this is? Is there something I need to run in order to refresh the library paths?
The linker line (i.e. the flags you give with -l and your input file names) are order-dependent. Libraries are only used to define functions used on their left side, but not on their right. Use:
gcc -Wall line.c -lexpat -o blah
See the question library is linked but reference is undefined for more information.