compiling rtmpdump for arm - linux

I am trying to compile rtmpdump (http://rtmpdump.mplayerhq.hu/) for Qnap NAS 419p (arm)
I am not very exprenced with linux or compilation but am trying to learn.
make is complaining that it cant find openssl and im not sure where to start?
[/share/Qdownload/src] # ipkg install openssl
Package openssl (0.9.8v-2) installed in root is up to date.
Nothing to be done
Successfully terminated.
confirms that i have installed openssl
[/share/Qdownload/src] #
[/share/Qdownload/src] # ipkg install zlib
Package zlib (1.2.5-1) installed in root is up to date.
Nothing to be done
Successfully terminated.
[/share/Qdownload/src] #
confirms i have zlib the only other depenance i think i need.
[/share/Qdownload/src] # make linux
make[1]: Entering directory `/share/MD0_DATA/Qdownload/src'
g++ -Wall -O2 -c -o rtmp.o rtmp.cpp
In file included from rtmp.h:44,
from rtmp.cpp:42:
dh.h:22:24: error: openssl/bn.h: No such file or directory
dh.h:23:24: error: openssl/dh.h: No such file or directory
dh.h:25:25: error: openssl/sha.h: No such file or directory
dh.h:26:26: error: openssl/hmac.h: No such file or directory
dh.h:27:25: error: openssl/rc4.h: No such file or directory
In file included from rtmp.h:44,
from rtmp.cpp:42:
dh.h:34: error: 'BIGNUM' was not declared in this scope
dh.h:34: error: 'y' was not declared in this scope
dh.h:34: error: 'BIGNUM' was not declared in this scope
dh.h:34: error: 'p' was not declared in this scope
dh.h:34: error: 'BIGNUM' was not declared in this scope
dh.h:34: error: 'q' was not declared in this scope
dh.h:34: error: initializer expression list treated as compound expression
dh.h:35: error: expected constructor, destructor, or type conversion before '*' token
dh.h:36: error: 'DH' was not declared in this scope
dh.h:36: error: 'dh' was not declared in this scope
dh.h:37: error: 'DH' was not declared in this scope
dh.h:37: error: 'dh' was not declared in this scope
dh.h:37: error: expected primary-expression before '*' token
dh.h:37: error: 'pubkey' was not declared in this scope
dh.h:37: error: expected primary-expression before 'nPubkeyLen'
dh.h:37: error: initializer expression list treated as compound expression
dh.h:38: error: 'DH' was not declared in this scope
dh.h:38: error: 'dh' was not declared in this scope
dh.h:38: error: expected primary-expression before '*' token
dh.h:38: error: 'privkey' was not declared in this scope
dh.h:38: error: expected primary-expression before 'nPrivkeyLen'
dh.h:38: error: initializer expression list treated as compound expression
dh.h:39: error: 'DH' was not declared in this scope
dh.h:39: error: 'dh' was not declared in this scope
dh.h:39: error: expected primary-expression before '*' token
dh.h:39: error: 'pubkey' was not declared in this scope
dh.h:39: error: expected primary-expression before 'nPubkeyLen'
dh.h:39: error: expected primary-expression before '*' token
dh.h:39: error: 'secret' was not declared in this scope
dh.h:39: error: initializer expression list treated as compound expression
dh.h:40: error: variable or field 'DHFree' declared void
dh.h:40: error: 'DH' was not declared in this scope
dh.h:40: error: 'dh' was not declared in this scope
In file included from rtmp.cpp:42:
rtmp.h:97: error: ISO C++ forbids declaration of 'DH' with no type
rtmp.h:97: error: expected ';' before '*' token
rtmp.h:98: error: ISO C++ forbids declaration of 'RC4_KEY' with no type
rtmp.h:98: error: expected ';' before '*' token
rtmp.h:99: error: ISO C++ forbids declaration of 'RC4_KEY' with no type
rtmp.h:99: error: expected ';' before '*' token
rtmp.cpp: In member function 'int RTMP_LIB::CRTMP::ReadN(char*, int)':
rtmp.cpp:653: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyIn'
rtmp.cpp:654: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyIn'
rtmp.cpp:654: error: 'RC4' was not declared in this scope
rtmp.cpp: In member function 'bool RTMP_LIB::CRTMP::WriteN(const char*, int)':
rtmp.cpp:672: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyOut'
rtmp.cpp:674: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyOut'
rtmp.cpp:674: error: 'RC4' was not declared in this scope
make[1]: *** [rtmp.o] Error 1
make[1]: Leaving directory `/share/MD0_DATA/Qdownload/src'
make: *** [linux] Error 2
[/share/Qdownload/src] #
Thanks for any advice you can give.

Make sure to install the development versions of the openssl and zlib packages.
Also make sure that openssl directory is somewhere in standard system include directories which should be /usr/include and /usr/local/include and some others depending on your tool chain.
But don't take my word for it and execute cpp -v < /dev/null. It runs the GNU C Preprocessor with input from /dev/null. Should print the directory search paths. Look for "#include <...> search starts here:" followed by a list of standard include search paths. This is also the order of inclusion.

If you are compiling for ARM it is not enough to install libraries for your own distro... you need libraries and a cross-compiler which runs on your development machine (probably x86 or x86_64) but generates code for the target platform (ARM).
If you don't have a cross-compiler for this Qnap NAS, this link should help you generate one with crosstool-ng, which is a great tool which helps you build cross-compilers from scratch. Then you will probably need a root filesystem with libraries made for your target platform too.
Everything involving cross-compiling is non-trivial, but we can try to help. What distro are you running on your machine?

Related

Error compiling DCMTK from source in MinGW-w64 GCC-8.1.0 "Error: 'FlsAlloc' was not declared in this scope"

I am trying to compile DCMTK from the source through MinGW32-w64 and Cmake.
I am getting these errors after mingw32-make command:
In file included from C:/dcmtk/oflog/include/dcmtk/oflog/internal/internal.h:59,
from C:\Users\Rodrigo\Downloads\tmp_dcmtk\dcmtk\oflog\libsrc\oflog.cc:35:
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h: In function 'dcmtk::log4cplus::thread::impl::tls_key_type dcmtk::log4cplus::thread::impl::tls_init(PFLS_CALLBACK_FUNCTION)':
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h:127:12: error: 'FlsAlloc' was not declared in this scope
return FlsAlloc(cleanupfunc);
^~~~~~~~
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h:127:12: note: suggested alternative: 'TlsAlloc'
return FlsAlloc(cleanupfunc);
^~~~~~~~
TlsAlloc
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h: In function 'void* dcmtk::log4cplus::thread::impl::tls_get_value(dcmtk::log4cplus::thread::impl::tls_key_type)':
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h:137:12: error: 'FlsGetValue' was not declared in this scope
return FlsGetValue(k);
^~~~~~~~~~~
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h:137:12: note: suggested alternative: 'TlsGetValue'
return FlsGetValue(k);
^~~~~~~~~~~
TlsGetValue
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h: In function 'void dcmtk::log4cplus::thread::impl::tls_set_value(dcmtk::log4cplus::thread::impl::tls_key_type, dcmtk::log4cplus::thread::impl::tls_value_type)':
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h:148:5: error: 'FlsSetValue' was not declared in this scope
FlsSetValue(k, value);
^~~~~~~~~~~
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h:148:5: note: suggested alternative: 'TlsSetValue'
FlsSetValue(k, value);
^~~~~~~~~~~
TlsSetValue
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h: In function 'void dcmtk::log4cplus::thread::impl::tls_cleanup(dcmtk::log4cplus::thread::impl::tls_key_type)':
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h:159:5: error: 'FlsFree' was not declared in this scope
FlsFree(k);
^~~~~~~
C:/dcmtk/oflog/include/dcmtk/oflog/thread/impl/tls.h:159:5: note: suggested alternative: 'TlsFree'
FlsFree(k);
^~~~~~~
TlsFree
mingw32-make[2]: *** [oflog\libsrc\CMakeFiles\oflog.dir\build.make:80: oflog/libsrc/CMakeFiles/oflog.dir/oflog.cc.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:2533: oflog/libsrc/CMakeFiles/oflog.dir/all] Error 2
mingw32-make: *** [Makefile:157: all] Error 2
I found this link with a similar error, however, no solutions were provided.
Does anyone know how to solve this?
System:
Windows 10 x64
MinGW-W64 GCC-8.1.0
Gcc (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0
The MinGW headers do not make all of the Win32 API functions visible by default. Add a line like add_compile_definitions (_WIN32_WINNT=0x600) to CMakeLists.txt file to make the Vista and later API visible. That should fix your compilation.

Unable to make Mod_mono in Red Hat even after configure has completed without errors

I have successfully run the configure script for mod_mono, but get multiple error messages while making mod_mono in my RHEL 5 server. I ran configure with the following options: ./configure --with-apr-config=/usr/local/bin/apr-1-config --with-apu-config=/usr/local/bin/apu-1-config --with-apxs=/usr/local/bin/apxs --prefix=/usr/local
I have apache 2.4.6 installed along with mono 2.10.2. These are my error messages from make:
mod_mono.c: In function âapache_get_useridâ:
mod_mono.c:389: error: âunixd_configâ undeclared (first use in this function)
mod_mono.c:389: error: (Each undeclared identifier is reported only once
mod_mono.c:389: error: for each function it appears in.)
mod_mono.c: In function âapache_get_groupidâ:
mod_mono.c:399: error: âunixd_configâ undeclared (first use in this function)
mod_mono.c: In function âapache_get_usernameâ:
mod_mono.c:409: error: âunixd_configâ undeclared (first use in this function)
mod_mono.c: In function âensure_dashboard_initializedâ:
mod_mono.c:488: warning: implicit declaration of function âunixd_set_global_mutex_permsâ
mod_mono.c: In function âconnection_get_remote_portâ:
mod_mono.c:854: warning: implicit declaration of function âapr_sockaddr_port_getâ
mod_mono.c:854: error: âconn_recâ has no member named âremote_addrâ
make[1]: *** [mod_mono_la-mod_mono.lo] Error 1
I am totally stuck at this point and have been searching for a solution for days, but to no avail. Any help in this regard would be much appreciated.
I have resolved my issue. The easiest way is to install monodevelop using yum by following the steps mentioned in the below url :
http://mostlylinux.com/tmp/?p=91

Can't Cross Compile GDBServer for MIPS n32

I'm having trouble cross compiling GDBServer for MIPS n32. I'm using GCC-4.7.2, binutils-2.22, glibc-2.11.1, glibc-ports-2.11, and linux-2.6.32.61. My host is x86_64-cross-linux-gnu. My target is mips64-elf-linux. The specific ABI for MIPS is n32.
When I go to make GDBserver, I get an error while compiling regcache.c. regcache.c is in the gdb/gdbserver/. There is a struct called 'reg' that gcc is trying to compile. I have included all of the mips include files. I can compile GDBServer for x86 however. I greped all of the include files in /usr/include/ to try to find "struct reg" and was unsuccessful on finding anything. I found this article and I changed the names hoping that it would correct the issue but that won't work because the reg struct in regcache.c has attributes like offset and value. I have also tried messing with pt_regs in ptrace.h. However I don't think I should have to mess with the files that come with GDBServer.
My configure command is:
CC=mips64-elf-linux-gcc configure --host=x86_64-cross-linux-gnu --target=mips64-elf-linux
Does anyone know why I can't comiple GDBServer for Mips n32?
Thanks,
UPDATE:
../gdb-7.6/gdb/gdbserver/regcache.c:207:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:207:7: error: dereferencing pointer to incomplete type
../gdb-7.6/gdb/gdbserver/regcache.c:208:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:208:7: error: dereferencing pointer to incomplete type
../gdb-7.6/gdb/gdbserver/regcache.c: In function 'find+_register_by_name'
../gdb-7.6/gdb/gdbserver/regcache.c:295:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:295:7: error: dereferencing pointer to incomplete type
../gdb-7.6/gdb/gdbserver/regcache.c: In function 'find_regno'
../gdb-7.6/gdb/gdbserver/regcache.c:315:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:315:7: error: dereferencing pointer to incomplete type

module_main.c:43: error: invalid use of undefined type ‘struct nf_hook_ops’

I am creating a Manet using the protocol ARAN. To install the protocol I'm using this manual, but the first step, the creation of trace_route, I received errors such as:
module_main.c:43: error: invalid use of undefined type ‘struct nf_hook_ops’
module_main.c:45:'KERNEL_INFO' undeclared (first use in this function)
I searched the web and found out that the problem is in the netfilter, but I do not find the solution ...
P.S. I am using Ubuntu 10.04 LTS Kernel 2.6.33 recompiled

building android-ndk?

I want to build an off-line speech recognition application for android.For that i tried building android NDK.But when i give ndk-build command i get the following error.I have no idea what that means as i am very new to Linux environment..Anyone please help me.
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/home/cenuser/android/android-ndk-r7b/build/core/build-local.mk:130: *** Android NDK: Aborting . Stop.
and when i changed the location to i got this
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:760:26: error: pocketsphinx.h: No such file or directory
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:761:28: error: sphinxbase/err.h: No such file or directory
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Hypothesis':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:780: warning: initialization makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:782: warning: assignment makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:784: warning: assignment makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Config__SWIG_0':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:795: error: 'FALSE' undeclared (first use in this function)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:795: error: (Each undeclared identifier is reported only once
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:795: error: for each function it appears in.)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Config__SWIG_1':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:799: error: 'FALSE' undeclared (first use in this function)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Config_getString':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:830: warning: return makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Decoder__SWIG_0':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:839: error: 'FALSE' undeclared (first use in this function)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Decoder__SWIG_1':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:843: warning: initialization makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getConfig':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:847: warning: return makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getUttid':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:856: warning: return makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getHyp':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:869: error: 'int32' undeclared (first use in this function)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:869: error: expected ';' before 'best_score'
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:870: error: 'best_score' undeclared (first use in this function)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Java_edu_cmu_pocketsphinx_pocketsphinxJNI_Decoder_1processRaw_1_1SWIG_10':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:1441: warning: assignment discards qualifiers from pointer target type
make: *** [/home/cenuser/android/sphinx/PocketSphinxDemo/obj/local/armeabi/objs-debug/pocketsphinx_jni/pocketsphinx_wrap.o] Error 1
Go to the ndk root folder from terminal
Type the command with your project path
ndk-build -C your_project_path
This will solve the problem. If you want more information on "ndk-build" command just type the command
ndk-build --help
This usually happens when you invoke ndk-build from incorrect diretory. You must be in folder which contains jni subdirectory.
Or alternatively do what error message tells you - specify NDK_PROJECT_PATH to correct folder.
you need to declare the path to the location while running the ndk-build command
1. cd
2. ndk-build NDK_PROJECT_PATH=
Go to /build/core
Change the NDK_PROJECT_PATH to app project path
Open terminal
Go to Project folder
Run the NDK_BUILD
This could be solves as follows:
I have faced the same problem. I was working on an text recognition application.
1- You should go the directory of your folder (which is inside the AndroidStudioProjects - "YOUR PROJECT",
2- There should be a jni (Java Native interface) folder. Search for this folder. whenever, this is found.
3- cd in cmd to that folder (The Parent folder of jni).
4- run **ndk-build**

Resources