Can't install PHPREDIS on PHP7 with Ubuntu 14.04 - ubuntu-14.04

I'm using PHP7 on ubuntu 14.04. Here is my PHP version information from terminal(using command PHP -v).
PHP 7.0.11-1+deb.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.11-1+deb.sury.org~trusty+1, Copyright (c) 1999-2016, by Zend Technologies
I downloaded phpredis from php7 branch(https://github.com/phpredis/phpredis/tree/php7) & followed the following commands to install as it has mentioned in readme.
phpize
./configure
make && make install
But, I'm getting following error just after executing the command make && make install
/bin/bash /home/justdial/Downloads/phpredis-php7/libtool --mode=compile cc -I. -I/home/justdial/Downloads/phpredis-php7 -DPHP_ATOM_INC -I/home/justdial/Downloads/phpredis-php7/include -I/home/justdial/Downloads/phpredis-php7/main -I/home/justdial/Downloads/phpredis-php7 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/justdial/Downloads/phpredis-php7/redis.c -o redis.lo
libtool: compile: cc -I. -I/home/justdial/Downloads/phpredis-php7 -DPHP_ATOM_INC -I/home/justdial/Downloads/phpredis-php7/include -I/home/justdial/Downloads/phpredis-php7/main -I/home/justdial/Downloads/phpredis-php7 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/justdial/Downloads/phpredis-php7/redis.c -fPIC -DPIC -o .libs/redis.o
In file included from /home/justdial/Downloads/phpredis-php7/redis.c:32:0:
/home/justdial/Downloads/phpredis-php7/redis_array.h:11:35: error: unknown type name 'zend_resource'
void redis_destructor_redis_array(zend_resource *rsrc TSRMLS_DC);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'redis_get_exception_base':
/home/justdial/Downloads/phpredis-php7/redis.c:380:13: warning: assignment makes pointer from integer without a cast [enabled by default]
if ((pce = zend_hash_str_find_ptr(CG(class_table), "runtimeexception", sizeof("RuntimeException") - 1))) {
^
/home/justdial/Downloads/phpredis-php7/redis.c:389:9: error: 'zend_ce_exception' undeclared (first use in this function)
return zend_ce_exception;
^
/home/justdial/Downloads/phpredis-php7/redis.c:389:9: note: each undeclared identifier is reported only once for each function it appears in
/home/justdial/Downloads/phpredis-php7/redis.c: At top level:
/home/justdial/Downloads/phpredis-php7/redis.c:423:41: error: unknown type name 'zend_resource'
static void redis_destructor_redis_sock(zend_resource * rsrc TSRMLS_DC)
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'redis_sock_get':
/home/justdial/Downloads/phpredis-php7/redis.c:439:46: warning: assignment makes pointer from integer without a cast [enabled by default]
if (Z_TYPE_P(id) != IS_OBJECT || (socket = zend_hash_str_find(Z_OBJPROP_P(id), "socket",
^
/home/justdial/Downloads/phpredis-php7/redis.c:440:71: warning: comparison between pointer and integer [enabled by default]
sizeof("socket") - 1)) == NULL || Z_RES_P(socket) == NULL) {
^
/home/justdial/Downloads/phpredis-php7/redis.c:449:47: error: invalid type argument of '->' (have 'int')
*redis_sock = (RedisSock *)Z_RES_P(socket)->ptr;
^
/home/justdial/Downloads/phpredis-php7/redis.c:451:40: error: invalid type argument of '->' (have 'int')
if (!*redis_sock || Z_RES_P(socket)->type != le_redis_sock) {
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zm_startup_redis':
/home/justdial/Downloads/phpredis-php7/redis.c:575:37: warning: assignment from incompatible pointer type [enabled by default]
redis_cluster_ce->create_object = create_cluster_context;
^
/home/justdial/Downloads/phpredis-php7/redis.c:578:9: error: 'redis_destructor_redis_array' undeclared (first use in this function)
redis_destructor_redis_array,
^
/home/justdial/Downloads/phpredis-php7/redis.c:588:5: error: too few arguments to function 'zend_register_internal_class_ex'
);
^
In file included from /usr/include/php5/main/php.h:39:0,
from /home/justdial/Downloads/phpredis-php7/common.h:1,
from /home/justdial/Downloads/phpredis-php7/redis.c:27:
/usr/include/php5/Zend/zend_API.h:277:28: note: declared here
ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC);
^
/home/justdial/Downloads/phpredis-php7/redis.c:596:5: error: too few arguments to function 'zend_register_internal_class_ex'
);
^
In file included from /usr/include/php5/main/php.h:39:0,
from /home/justdial/Downloads/phpredis-php7/common.h:1,
from /home/justdial/Downloads/phpredis-php7/redis.c:27:
/usr/include/php5/Zend/zend_API.h:277:28: note: declared here
ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC);
^
/home/justdial/Downloads/phpredis-php7/redis.c:599:9: error: 'redis_destructor_redis_sock' undeclared (first use in this function)
redis_destructor_redis_sock,
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'redis_connect':
/home/justdial/Downloads/phpredis-php7/redis.c:719:5: error: unknown type name 'zend_long'
zend_long port = -1, retry_interval = 0;
^
/home/justdial/Downloads/phpredis-php7/redis.c:764:21: warning: assignment makes pointer from integer without a cast [enabled by default]
if ((socket = zend_hash_str_find(Z_OBJPROP_P(object), "socket", sizeof("socket") -1)) == NULL)
^
/home/justdial/Downloads/phpredis-php7/redis.c:781:8: warning: assignment makes pointer from integer without a cast [enabled by default]
id = zend_list_insert(redis_sock, le_redis_sock TSRMLS_CC);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_getMultiple':
/home/justdial/Downloads/phpredis-php7/redis.c:984:9: error: unknown type name 'zend_string'
zend_string *key_zstr;
^
/home/justdial/Downloads/phpredis-php7/redis.c:987:18: warning: assignment makes pointer from integer without a cast [enabled by default]
key_zstr = zval_get_string(z_ele);
^
/home/justdial/Downloads/phpredis-php7/redis.c:988:13: warning: assignment makes pointer from integer without a cast [enabled by default]
key = ZSTR_VAL(key_zstr);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'generic_sort_cmd':
/home/justdial/Downloads/phpredis-php7/redis.c:1398:5: error: unknown type name 'zend_long'
zend_long sort_start = -1, sort_count = -1;
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_select':
/home/justdial/Downloads/phpredis-php7/redis.c:1757:5: error: unknown type name 'zend_long'
zend_long dbNumber;
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'generic_mset':
/home/justdial/Downloads/phpredis-php7/redis.c:1832:13: error: unknown type name 'zend_string'
zend_string *key_zstr;
^
/home/justdial/Downloads/phpredis-php7/redis.c:1841:71: error: macro "zend_hash_get_current_key" requires 4 arguments, but only 3 given
type = zend_hash_get_current_key(keytable, &key_zstr, &idx);
^
/home/justdial/Downloads/phpredis-php7/redis.c:1841:20: error: 'zend_hash_get_current_key' undeclared (first use in this function)
type = zend_hash_get_current_key(keytable, &key_zstr, &idx);
^
/home/justdial/Downloads/phpredis-php7/redis.c:1842:64: error: macro "zend_hash_get_current_data" requires 2 arguments, but only 1 given
if((z_value_p = zend_hash_get_current_data(keytable)) == NULL)
^
/home/justdial/Downloads/phpredis-php7/redis.c:1842:29: error: 'zend_hash_get_current_data' undeclared (first use in this function)
if((z_value_p = zend_hash_get_current_data(keytable)) == NULL)
^
/home/justdial/Downloads/phpredis-php7/redis.c:1856:35: error: request for member 'len' in something not a structure or union
key_len = key_zstr->len;
^
/home/justdial/Downloads/phpredis-php7/redis.c:1857:31: error: request for member 'val' in something not a structure or union
key = key_zstr->val;
^
/home/justdial/Downloads/phpredis-php7/redis.c:1873:17: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]
p += sprintf(p, "$%d" _NL, key_len); /* key len */
^
/home/justdial/Downloads/phpredis-php7/redis.c:1877:17: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]
p += sprintf(p, "$%d" _NL, val_len); /* val len */
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_multi':
/home/justdial/Downloads/phpredis-php7/redis.c:2196:5: error: unknown type name 'zend_long'
zend_long multi_value = MULTI;
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'generic_unsubscribe_cmd':
/home/justdial/Downloads/phpredis-php7/redis.c:2567:13: error: too few arguments to function 'zend_hash_index_find'
if ((z_channel = zend_hash_index_find(Z_ARRVAL(z_tab), 1)) == NULL)
^
In file included from /usr/include/php5/Zend/zend.h:286:0,
from /usr/include/php5/main/php.h:35,
from /home/justdial/Downloads/phpredis-php7/common.h:1,
from /home/justdial/Downloads/phpredis-php7/redis.c:27:
/usr/include/php5/Zend/zend_hash.h:166:14: note: declared here
ZEND_API int zend_hash_index_find(const HashTable *ht, ulong h, void **pData);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_slaveof':
/home/justdial/Downloads/phpredis-php7/redis.c:2610:5: error: unknown type name 'zend_long'
zend_long port = 6379;
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_slowlog':
/home/justdial/Downloads/phpredis-php7/redis.c:2764:5: error: unknown type name 'zend_long'
zend_long option;
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_wait':
/home/justdial/Downloads/phpredis-php7/redis.c:2818:5: error: unknown type name 'zend_long'
zend_long num_slaves, timeout;
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'redis_build_pubsub_cmd':
/home/justdial/Downloads/phpredis-php7/redis.c:2901:13: error: unknown type name 'zend_string'
zend_string *key_zstr;
^
/home/justdial/Downloads/phpredis-php7/redis.c:2902:22: warning: assignment makes pointer from integer without a cast [enabled by default]
key_zstr = zval_get_string(z_ele);
^
/home/justdial/Downloads/phpredis-php7/redis.c:2903:17: warning: assignment makes pointer from integer without a cast [enabled by default]
key = ZSTR_VAL(key_zstr);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'redis_build_eval_cmd':
/home/justdial/Downloads/phpredis-php7/redis.c:3041:17: error: unknown type name 'zend_string'
zend_string *key_zstr;
^
/home/justdial/Downloads/phpredis-php7/redis.c:3042:26: warning: assignment makes pointer from integer without a cast [enabled by default]
key_zstr = zval_get_string(elem);
^
/home/justdial/Downloads/phpredis-php7/redis.c:3043:21: warning: assignment makes pointer from integer without a cast [enabled by default]
key = ZSTR_VAL(key_zstr);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_evalsha':
/home/justdial/Downloads/phpredis-php7/redis.c:3086:5: error: unknown type name 'zend_long'
zend_long keys_count = 0;
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_eval':
/home/justdial/Downloads/phpredis-php7/redis.c:3124:5: error: unknown type name 'zend_long'
zend_long keys_count = 0;
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'redis_build_script_exists_cmd':
/home/justdial/Downloads/phpredis-php7/redis.c:3167:9: error: unknown type name 'zend_string'
zend_string *arg_zstr = zval_get_string(&argv[i]);
^
/home/justdial/Downloads/phpredis-php7/redis.c:3167:33: warning: initialization makes pointer from integer without a cast [enabled by default]
zend_string *arg_zstr = zval_get_string(&argv[i]);
^
/home/justdial/Downloads/phpredis-php7/redis.c:3171:13: warning: passing argument 3 of 'redis_cmd_append_str' makes pointer from integer without a cast [enabled by default]
ZSTR_LEN(arg_zstr));
^
In file included from /home/justdial/Downloads/phpredis-php7/redis_commands.h:17:0,
from /home/justdial/Downloads/phpredis-php7/redis.c:31:
/home/justdial/Downloads/phpredis-php7/library.h:15:5: note: expected 'char *' but argument is of type 'int'
int redis_cmd_append_str(char **cmd, int cmd_len, char *append, int append_len);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_script':
/home/justdial/Downloads/phpredis-php7/redis.c:3203:5: warning: passing argument 3 of '_zend_get_parameters_array' from incompatible pointer type [enabled by default]
if(zend_get_parameters_array(ht, argc, z_args) == FAILURE ||
^
In file included from /usr/include/php5/main/php.h:39:0,
from /home/justdial/Downloads/phpredis-php7/common.h:1,
from /home/justdial/Downloads/phpredis-php7/redis.c:27:
/usr/include/php5/Zend/zend_API.h:237:14: note: expected 'struct zval **' but argument is of type 'struct zval *'
ZEND_API int _zend_get_parameters_array(int ht, int param_count, zval **argument_array TSRMLS_DC);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_migrate':
/home/justdial/Downloads/phpredis-php7/redis.c:3285:5: error: unknown type name 'zend_long'
zend_long port, dest_db, timeout;
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_getLastError':
/home/justdial/Downloads/phpredis-php7/redis.c:3394:60: error: macro "RETURN_STRINGL" requires 3 arguments, but only 2 given
RETURN_STRINGL(redis_sock->err, redis_sock->err_len);
^
/home/justdial/Downloads/phpredis-php7/redis.c:3394:9: error: 'RETURN_STRINGL' undeclared (first use in this function)
RETURN_STRINGL(redis_sock->err, redis_sock->err_len);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_getHost':
/home/justdial/Downloads/phpredis-php7/redis.c:3475:39: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(redis_sock->host);
^
/home/justdial/Downloads/phpredis-php7/redis.c:3475:9: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(redis_sock->host);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_getPersistentID':
/home/justdial/Downloads/phpredis-php7/redis.c:3533:52: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(redis_sock->persistent_id);
^
/home/justdial/Downloads/phpredis-php7/redis.c:3533:13: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(redis_sock->persistent_id);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_getAuth':
/home/justdial/Downloads/phpredis-php7/redis.c:3548:43: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(redis_sock->auth);
^
/home/justdial/Downloads/phpredis-php7/redis.c:3548:13: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(redis_sock->auth);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'zim_Redis_rawcommand':
/home/justdial/Downloads/phpredis-php7/redis.c:3625:5: warning: passing argument 3 of '_zend_get_parameters_array' from incompatible pointer type [enabled by default]
if (zend_get_parameters_array(ht, argc, z_args) == FAILURE) {
^
In file included from /usr/include/php5/main/php.h:39:0,
from /home/justdial/Downloads/phpredis-php7/common.h:1,
from /home/justdial/Downloads/phpredis-php7/redis.c:27:
/usr/include/php5/Zend/zend_API.h:237:14: note: expected 'struct zval **' but argument is of type 'struct zval *'
ZEND_API int _zend_get_parameters_array(int ht, int param_count, zval **argument_array TSRMLS_DC);
^
/home/justdial/Downloads/phpredis-php7/redis.c: In function 'generic_scan_cmd':
/home/justdial/Downloads/phpredis-php7/redis.c:3725:5: error: unknown type name 'zend_long'
zend_long count=0;
^
make: *** [redis.lo] Error 1
I've also created one issue about this at PHPREDIS github repository (https://github.com/phpredis/phpredis/issues/958).
Don't know what's going wrong at here.

please try this way.
1.Delete the existing PHP-Redis extension and clean
2.Install required package (skip if you already installed php7)
apt-get install php7.0-dev
3.Download PhpRedis
cd /tmp
wget https://github.com/phpredis/phpredis/archive/php7.zip -O phpredis.zip
4.Unpack, compile and install PhpRedis
unzip -o /tmp/phpredis.zip && mv /tmp/phpredis-* /tmp/phpredis && cd /tmp/phpredis && phpize && ./configure && make && sudo make install
Now it is necessary to add compiled extension to PHP config
5.Add PhpRedis extension to PHP 7
sudo touch /etc/php/mods-available/redis.ini && echo extension=redis.so > /etc/php/mods-available/redis.ini
sudo ln -s /etc/php/mods-available/redis.ini /etc/php/7.0/apache2/conf.d/redis.ini
sudo ln -s /etc/php/mods-available/redis.ini /etc/php/7.0/fpm/conf.d/redis.ini
sudo ln -s /etc/php/mods-available/redis.ini /etc/php/7.0/cli/conf.d/redis.ini
6.Restart PHP-FPM
sudo service php7.0-fpm restart
7.Restart Apache
sudo service apache2 restart
Note: if you are using Nginx there is no need to restart it because in most cases it works wit PHP-FPM.
You can check successfully installed PhpRedis with command below
php -r "if (new Redis() == true){ echo \"OK \r\n\"; }"

Huh.. Finally, I've solved the issue. I think, I'd some problem in my php7.0-dev configuration. So reinstall it by using apt-get install php7.0-dev. After that use following commands -
sudo make
sudo make install
Then in php.ini file I added the path of redis.so extension link. Ex -
extension=/usr/lib/php/20151012/redis.so (path is system dependent)
That's it. It fixed the thing.
#Renjith VR : Thanks for the reply. It really helped me fig out the issue.

Related

Kerberos and Nodejs on mac

I have to install a project which has krb5(npm package) as a dependency but when "npm install", I'm getting this error,
./src/krb5_bind.cc:635:13: error: no matching function for call to 'krb5_get_init_creds_password'
err = krb5_get_init_creds_password(krb_context,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/krb5/krb5.h:2302:1: note: candidate function not viable: 4th
argument ('const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::value_type *'
(aka 'const char *')) would lose const qualifier
krb5_get_init_creds_password
^
../src/krb5_bind.cc:699:13: warning: 'krb5_init_context' is deprecated: use GSS.framework [-Wdeprecated-declarations]
err = krb5_init_context(&context);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/krb5/krb5.h:1434:19: note: 'krb5_init_context' has been
explicitly marked deprecated here
(krb5_context *) KERBEROS_APPLE_DEPRECATED("use GSS.framework") __API_DEPRECATED("Use GSS.framework", macos(10.0...
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/krb5/krb5.h:73:53: note: expanded from macro
'KERBEROS_APPLE_DEPRECATED'
#define KERBEROS_APPLE_DEPRECATED(x) __attribute__((deprecated(x)))
^
../src/krb5_bind.cc:750:13: warning: 'krb5_kt_resolve' is deprecated: use GSS.framework [-Wdeprecated-declarations]
err = krb5_kt_resolve(krb_context, kt_name.c_str(), &ktid);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/krb5/krb5.h:1682:19: note: 'krb5_kt_resolve' has been explicitly
marked deprecated here
krb5_keytab * ) KERBEROS_APPLE_DEPRECATED("use GSS.framework") __API_DEPRECATED("Use GSS.framework", maco...
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/krb5/krb5.h:73:53: note: expanded from macro
'KERBEROS_APPLE_DEPRECATED'
#define KERBEROS_APPLE_DEPRECATED(x) __attribute__((deprecated(x)))
^
../src/krb5_bind.cc:815:13: error: no matching function for call to 'krb5_get_init_creds_keytab'
err = krb5_get_init_creds_keytab(krb_context,
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/krb5/krb5.h:2314:1: note: candidate function not viable: 6th
argument ('const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::value_type *'
(aka 'const char *')) would lose const qualifier
krb5_get_init_creds_keytab
^
17 warnings and 2 errors generated.
I am running on mac os and I doubt that it is using the Kerberos from the Mac OS rather than taking it from the krb5 dependency.
You need to compile MIT Kerberos manual,
wget https://kerberos.org/dist/krb5/1.19/krb5-1.19.1.tar.gz
tar -xzf krb5-1.19.1.tar.gz
cd krb5-1.19.1.tar.gz/src
./configure
make
sudo make install
See: https://github.com/adaltas/node-krb5/issues/10#issuecomment-426997642

Cygwin new user *how to generate an executable?

I just installed Cygwin -I’m new user. I’m following instructions, but I’m stuck.
I need to generate an executable of the software I want to use, which was made in c++. When I type”make” in the right directory I have a list of errors and I don’t know what they mean. It may be something with my makefile?
Here are the instructions:
“The enclosed makefile should allow Match to be built on any GNU-based compiler platform as well as many others. You may need to modify the makefile if your compiler is not named "c++" or requires different command line options. ”
Here the errors:
$ make
c++ -O4 -c match.cc -o match.o -Wall -g
In file included from match.cc:37:0:
series.hh: In member function ‘void core::insert(const point&, int)’:
series.hh:161:5: error: ‘memmove’ was not declared in this scope
memmove(&data[i+1], &data[i], sizeof(point)*(size-i-1));
^~~~~~~
series.hh:161:5: note: suggested alternative: ‘wmemmove’
memmove(&data[i+1], &data[i], sizeof(point)*(size-i-1));
^~~~~~~
wmemmove
series.hh: In member function ‘void core::erase(int)’:
series.hh:166:5: error: ‘memmove’ was not declared in this scope
memmove(&data[i], &data[i+1], sizeof(point)*(size-i-1));
^~~~~~~
series.hh:166:5: note: suggested alternative: ‘wmemmove’
memmove(&data[i], &data[i+1], sizeof(point)*(size-i-1));
^~~~~~~
wmemmove
series.hh: In member function ‘int core::averageduplicates()’:
series.hh:214:2: error: ‘memmove’ was not declared in this scope
memmove(&data[i+1],&data[j],sizeof(point)*(size-j));
^~~~~~~
series.hh:214:2: note: suggested alternative: ‘wmemmove’
memmove(&data[i+1],&data[j],sizeof(point)*(size-j));
^~~~~~~
wmemmove
series.hh: At global scope:
series.hh:239:25: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
void build_labelmap() throw(format_error) {
^~~~~
series.hh:253:44: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
int lookup_label(int label, float depth) throw(format_error) {
^~~~~
series.hh:410:50: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
void addtiept(vector<tiept> &tiemap, tiept &t) throw(format_error) {
^~~~~
series.hh:433:42: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
void buildmaps(series &s1, series &s2) throw(format_error) {
^~~~~
series.hh:474:48: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
tiepts read_tiefile(string name, ostream &log) throw(format_error);
^~~~~
series.hh:488:30: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
void apply_gaps(series &s) throw(format_error) {
^~~~~
series.hh:539:32: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
gaps read_gapfile(string name) throw(format_error);
^~~~~
make: *** [Makefile:10: match.o] Error 1
Here the makefile:
VERSION=2.3
all: match
%: %.o
c++ $^ -o $# $(LDFLAGS)
.cc.o:
# c++ -c $< -o $# -Wall -g $(CFLAGS)
c++ -O4 -c $< -o $# -Wall -g $(CFLAGS)
match: match.o series.o config.o normalize.o floatnan.o
match.o: match.cc config.hh series.hh normalize.hh floatnan.hh
series.o: series.cc series.hh floatnan.hh
config.o: config.cc config.hh floatnan.hh
normalize.o: normalize.cc normalize.hh series.hh floatnan.hh
floatnan.o: floatnan.cc floatnan.hh
clean:
rm -f *.o match *~ match.exe match.log *.new xmatch score_matrix
tar:
sed '/\S/ ! d;s/^/Match-${VERSION}\//' ../manifest > ../manifest.tmp
tar -cz -C ../.. -f ../match-${VERSION}.tgz -T ../manifest.tmp
check-manifest:
cd .. && find . -type f | sed 's/^.\///' | grep -v ,v | sort > manifest.tmp
sort ../manifest > ../manifest.tmp1
diff ../manifest.tmp1 ../manifest.tmp; true
pwd | grep 'Match-${VERSION}/' > /dev/null || (echo version mismatch; false)
Following an advice as per comment below, in the file "series.hh", I replaced "memmove" by "std::memmove".
I type "make" again, and now I get this:
$ make
c++ -O4 -c match.cc -o match.o -Wall -g
In file included from match.cc:37:0:
series.hh:9:1: error: expected unqualified-id before string constant
"//This program is distributed in the hope that it will be useful,"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/fstream:42:0,
from series.hh:36,
from match.cc:37:
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:57:7: error: ‘__c_file’ does not name a type; did you mean ‘__basic_file’?
__c_file* _M_cfile;
^~~~~~~~
__basic_file
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:63:28: error: expected ‘)’ before ‘*’ token
__basic_file(__c_lock* __lock = 0) throw ();
^
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:66:41: error: ‘__c_lock’ has not been declared
__basic_file(__basic_file&& __rv, __c_lock* __lock = 0) noexcept
^~~~~~~~
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:88:7: error: expected ‘;’ at end of member declaration
sys_open(__c_file* __file, ios_base::openmode);
^~~~~~~~
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:88:24: error: expected ‘)’ before ‘*’ token
sys_open(__c_file* __file, ios_base::openmode);
^
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:91:60: error: ‘std::__basic_file<char>* std::__basic_file<char>::sys_open(int, std::ios_base::openmode)’ conflicts with a previous declaration
sys_open(int __fd, ios_base::openmode __mode) throw ();
^
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:88:16: note: previous declaration ‘std::__basic_file<char>* std::__basic_file<char>::sys_open’
sys_open(__c_file* __file, ios_base::openmode);
^~~~~~~~
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:102:21: error: ‘__c_file’ does not name a type; did you mean ‘__basic_file’?
_GLIBCXX_PURE __c_file*
^~~~~~~~
__basic_file
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h: In constructor ‘std::__basic_file<char>::__basic_file(std::__basic_file<char>&&, int*)’:
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:67:9: error: class ‘std::__basic_file<char>’ does not have any field named ‘_M_cfile’
: _M_cfile(__rv._M_cfile), _M_cfile_created(__rv._M_cfile_created)
^~~~~~~~
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:67:23: error: ‘class std::__basic_file<char>’ has no member named ‘_M_cfile’; did you mean ‘__basic_file’?
: _M_cfile(__rv._M_cfile), _M_cfile_created(__rv._M_cfile_created)
^~~~~~~~
__basic_file
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:69:7: error: ‘class std::__basic_file<char>’ has no member named ‘_M_cfile’; did you mean ‘__basic_file’?
__rv._M_cfile = nullptr;
^~~~~~~~
__basic_file
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h: In member function ‘void std::__basic_file<char>::swap(std::__basic_file<char>&)’:
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:79:12: error: ‘_M_cfile’ was not declared in this scope
std::swap(_M_cfile, __f._M_cfile);
^~~~~~~~
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:79:12: note: suggested alternative: ‘_Setfill’
std::swap(_M_cfile, __f._M_cfile);
^~~~~~~~
_Setfill
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/x86_64-pc-cygwin/bits/basic_file.h:79:26: error: ‘class std::__basic_file<char>’ has no member named ‘_M_cfile’; did you mean ‘__basic_file’?
std::swap(_M_cfile, __f._M_cfile);
^~~~~~~~
__basic_file
In file included from series.hh:36:0,
from match.cc:37:
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/fstream: At global scope:
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/fstream:107:7: error: ‘__c_lock’ does not name a type; did you mean ‘__c_locale’?
__c_lock _M_lock;
^~~~~~~~
__c_locale
In file included from /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/fstream:1081:0,
from series.hh:36,
from match.cc:37:
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/bits/fstream.tcc: In constructor ‘std::basic_filebuf<_CharT, _Traits>::basic_filebuf()’:
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/bits/fstream.tcc:80:43: error: class ‘std::basic_filebuf<_CharT, _Traits>’ does not have any field named ‘_M_lock’
basic_filebuf() : __streambuf_type(), _M_lock(), _M_file(&_M_lock),
^~~~~~~
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/bits/fstream.tcc:80:63: error: ‘_M_lock’ was not declared in this scope
basic_filebuf() : __streambuf_type(), _M_lock(), _M_file(&_M_lock),
^~~~~~~
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/bits/fstream.tcc:80:63: note: suggested alternative: ‘_M_seek’
basic_filebuf() : __streambuf_type(), _M_lock(), _M_file(&_M_lock),
^~~~~~~
_M_seek
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/bits/fstream.tcc: In constructor ‘std::basic_filebuf<_CharT, _Traits>::basic_filebuf(std::basic_filebuf<_CharT, _Traits>&&)’:
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/bits/fstream.tcc:97:5: error: class ‘std::basic_filebuf<_CharT, _Traits>’ does not have any field named ‘_M_lock’
_M_lock(), _M_file(std::move(__rhs._M_file), &_M_lock),
^~~~~~~
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/bits/fstream.tcc:97:51: error: ‘_M_lock’ was not declared in this scope
_M_lock(), _M_file(std::move(__rhs._M_file), &_M_lock),
^~~~~~~
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/bits/fstream.tcc:97:51: note: suggested alternative: ‘_M_seek’
_M_lock(), _M_file(std::move(__rhs._M_file), &_M_lock),
^~~~~~~
_M_seek
In file included from match.cc:37:0:
series.hh: At global scope:
series.hh:43:1: error: expected unqualified-id before string constant
"#include ""assert.h"""
^~~~~~~~~~~
series.hh:62:1: error: expected unqualified-id before string constant
" float x, y;"
^~~~~~~~~~~~~~~
series.hh:67:1: error: expected unqualified-id before string constant
"static float intervalmap(float i1b, float i1e, float i2b, "
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
series.hh:70:1: error: expected declaration before ‘}’ token
}
^
make: *** [Makefile:10: match.o] Error 1
What should I do?
Alp

I get build error while building OpenCV and OpenCV_Contrib from the source on Linux

I'm building OpenCV on Linux with OpenCV_contrib and I can't make it work.
OpenCV alone can build with no errors.
While compliling OpenCV alone It works find .
cmake -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4/modules
..
$ make j5
During make process , it fails at 100% ,😔😔😔😔😔😔😔😔
Scanning dependencies of target opencv_python2
[100%] Building CXX object modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o
[100%] Linking CXX executable ../../bin/opencv_perf_stitching
[100%] Built target opencv_perf_stitching
In file included from /home/habib/Documents/Projects/Packages/opencv-3.4.3/build/modules/python_bindings_generator/pyopencv_custom_headers.h:8:0,
from /home/habib/Documents/Projects/Packages/opencv-3.4.3/modules/python/src2/cv2.cpp:1816:
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:4:40: error: ‘linemod’ was not declared in this scope
template<> struct pyopencvVecConverter<linemod::Match>
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:4:54: error: template argument 1 is invalid
template<> struct pyopencvVecConverter<linemod::Match>
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:17:40: error: ‘linemod’ was not declared in this scope
template<> struct pyopencvVecConverter<linemod::Template>
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:17:57: error: template argument 1 is invalid
template<> struct pyopencvVecConverter<linemod::Template>
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:30:40: error: ‘linemod’ was not declared in this scope
template<> struct pyopencvVecConverter<linemod::Feature>
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:30:56: error: template argument 1 is invalid
template<> struct pyopencvVecConverter<linemod::Feature>
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:43:44: error: ‘linemod’ was not declared in this scope
template<> struct pyopencvVecConverter<Ptr<linemod::Modality> >
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:43:61: error: template argument 1 is invalid
template<> struct pyopencvVecConverter<Ptr<linemod::Modality> >
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:43:63: error: template argument 1 is invalid
template<> struct pyopencvVecConverter<Ptr<linemod::Modality> >
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:56:21: error: ‘linemod’ was not declared in this scope
typedef std::vector<linemod::Match> vector_Match;
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:56:35: error: template argument 1 is invalid
typedef std::vector<linemod::Match> vector_Match;
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:56:35: error: template argument 2 is invalid
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:57:21: error: ‘linemod’ was not declared in this scope
typedef std::vector<linemod::Template> vector_Template;
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:57:38: error: template argument 1 is invalid
typedef std::vector<linemod::Template> vector_Template;
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:57:38: error: template argument 2 is invalid
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:58:21: error: ‘linemod’ was not declared in this scope
typedef std::vector<linemod::Feature> vector_Feature;
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:58:37: error: template argument 1 is invalid
typedef std::vector<linemod::Feature> vector_Feature;
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:58:37: error: template argument 2 is invalid
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:25: error: ‘linemod’ was not declared in this scope
typedef std::vector<Ptr<linemod::Modality> > vector_Ptr_Modality;
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:42: error: template argument 1 is invalid
typedef std::vector<Ptr<linemod::Modality> > vector_Ptr_Modality;
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:44: error: template argument 1 is invalid
typedef std::vector<Ptr<linemod::Modality> > vector_Ptr_Modality;
^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:44: error: template argument 2 is invalid
[100%] Linking CXX executable ../../bin/opencv_perf_tracking
[100%] Built target opencv_perf_tracking
modules/python2/CMakeFiles/opencv_python2.dir/build.make:62: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o' failed
make[2]: *** [modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o] Error 1
CMakeFiles/Makefile2:15272: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/all' failed
make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
I downloaded the opencv Source code from the official website and cloned the opencv_contrib from Github. And this was not a good idea and I ran into problems.
I cloned the exact same version for both opencv and opencv_contrib from Github and this time it worked perfectly.
git clone -b 3.4 https://github.com/opencv/opencv
git clone -b 3.4 https://github.com/opencv/opencv_contrib
Run make clean before cmake and make, should solve the problem.

How to add libc to android application?

I am writing a C code which I wish to run in android using ndk. I have glibc library in the code which as I understood is difficult to port directly. Hence I tried to use libc instead from the bionic repository in github. I am facing numerous errors while building it.
Could anyone explain how to include libc in a step by step procedure(or guide me to some source). I have searched a lot and was unable to find a tutorial anywhere.
These are the errors I get:
In file included from jni/libc/private/ScopedPthreadMutexLocker.h:22:0,
from jni/libc/bionic/malloc_debug_common.cpp:47:
jni/libc/private/bionic_macros.h:27:31: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 [enabled by default]
TypeName(const TypeName&) = delete; \
^
jni/libc/private/ScopedPthreadMutexLocker.h:37:3: note: in expansion of macro 'DISALLOW_COPY_AND_ASSIGN'
DISALLOW_COPY_AND_ASSIGN(ScopedPthreadMutexLocker);
^
jni/libc/private/bionic_macros.h:28:37: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 [enabled by default]
void operator=(const TypeName&) = delete
^
jni/libc/private/ScopedPthreadMutexLocker.h:37:3: note: in expansion of macro 'DISALLOW_COPY_AND_ASSIGN'
DISALLOW_COPY_AND_ASSIGN(ScopedPthreadMutexLocker);
^
In file included from jni/libc/bionic/jemalloc.h:20:0,
from jni/libc/bionic/malloc_debug_common.cpp:50:
jni/libc/jemalloc/jemalloc.h:108:36: error: declaration of C function 'size_t malloc_usable_size(void*)' conflicts with
# define JEMALLOC_CXX_THROW throw()
^
jni/libc/jemalloc/jemalloc.h:231:43: note: in expansion of macro 'JEMALLOC_CXX_THROW'
JEMALLOC_USABLE_SIZE_CONST void *ptr) JEMALLOC_CXX_THROW;
^
In file included from /home/yogi/android-ndk/platforms/android-21/arch-arm/usr/include/string.h:33:0,
from /home/yogi/android-ndk/platforms/android-21/arch-arm/usr/include/signal.h:35,
from /home/yogi/android-ndk/platforms/android-21/arch-arm/usr/include/pthread.h:33,
from jni/libc/bionic/malloc_debug_common.h:36,
from jni/libc/bionic/malloc_debug_common.cpp:40:
/home/yogi/android-ndk/platforms/android-21/arch-arm/usr/include/malloc.h:36:15: error: previous declaration 'size_t malloc_usable_size(const void*)' here
extern size_t malloc_usable_size(const void* p);
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_calloc' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:67:3: note: in expansion of macro 'Malloc'
Malloc(calloc),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_free' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:68:3: note: in expansion of macro 'Malloc'
Malloc(free),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_malloc' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:70:3: note: in expansion of macro 'Malloc'
Malloc(malloc),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_malloc_usable_size' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:71:3: note: in expansion of macro 'Malloc'
Malloc(malloc_usable_size),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_posix_memalign' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:73:3: note: in expansion of macro 'Malloc'
Malloc(posix_memalign),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_realloc' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:77:3: note: in expansion of macro 'Malloc'
Malloc(realloc),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_valloc' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:79:3: note: in expansion of macro 'Malloc'
Malloc(valloc),
^
jni/libc/bionic/malloc_debug_common.cpp: In function 'void get_malloc_leak_info(uint8_t**, size_t*, size_t*, size_t*, size_t*)':
jni/libc/bionic/malloc_debug_common.cpp:191:96: error: 'je_malloc' was not declared in this scope
HashEntry** list = static_cast<HashEntry**>(Malloc(malloc)(sizeof(void*) * g_hash_table.count));
^
jni/libc/bionic/malloc_debug_common.cpp:214:22: error: 'je_free' was not declared in this scope
Malloc(free)(list);
^
jni/libc/bionic/malloc_debug_common.cpp:236:20: error: 'je_free' was not declared in this scope
Malloc(free)(list);
^
jni/libc/bionic/malloc_debug_common.cpp: In function 'void free_malloc_leak_info(uint8_t*)':
jni/libc/bionic/malloc_debug_common.cpp:240:20: error: 'je_free' was not declared in this scope
Malloc(free)(info);
^
jni/libc/bionic/malloc_debug_common.cpp: In function 'size_t malloc_usable_size(const void*)':
jni/libc/bionic/malloc_debug_common.cpp:262:53: error: declaration of C function 'size_t malloc_usable_size(const void*)' conflicts with
extern "C" size_t malloc_usable_size(const void* mem) {
^
In file included from jni/libc/bionic/jemalloc.h:20:0,
from jni/libc/bionic/malloc_debug_common.cpp:50:
jni/libc/jemalloc/jemalloc.h:70:33: error: previous declaration 'size_t malloc_usable_size(void*)' here
# define je_malloc_usable_size malloc_usable_size
^
jni/libc/jemalloc/jemalloc.h:230:41: note: in expansion of macro 'je_malloc_usable_size'
JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_malloc_usable_size(
^
make: *** [obj/local/armeabi-v7a/objs/c/bionic/malloc_debug_common.o] Error 1
How to fix it?
Thanks!
I tried to use libc instead from the bionic repository in github.
It appears that you've copied Bionic libc into your project, and are trying to build it.
Don't. A prebuilt copy is already provided to you as part of the ndk, and you don't need to do anything special to use it: the ndk-provided compiler will do that automatically.
You should concentrate on building your application, not copying random libc variants and trying to build them.

error: implicit declaration of function ‘create_proc_entry’

Kernel version : 3.13.0-32-generic
When i am building the module getting the error
make -C /lib/modules/3.13.0-32-generic/build
M=/home/wipro/Downloads/proc modules make[1]: Entering directory
/usr/src/linux-headers-3.13.0-32-generic' CC [M]
/home/wipro/Downloads/proc/proc.o /home/wipro/Downloads/proc/proc.c:
In function ‘proc_win_init’: /home/wipro/Downloads/proc/proc.c:21:5:
error: implicit declaration of function ‘create_proc_entry’
[-Werror=implicit-function-declaration]
if ((file = create_proc_entry("rel_time", 0666, parent)) == NULL) {
^ /home/wipro/Downloads/proc/proc.c:21:15: warning: assignment makes pointer from integer without a cast [enabled by default]
if ((file = create_proc_entry("rel_time", 0666, parent)) == NULL) {
^ /home/wipro/Downloads/proc/proc.c:25:9: error: dereferencing pointer to incomplete type
file->read_proc = time_read;
^ /home/wipro/Downloads/proc/proc.c:26:9: error: dereferencing pointer to incomplete type
file->write_proc = time_write;
^ /home/wipro/Downloads/proc/proc.c:32:9: error: dereferencing pointer to incomplete type
link->uid = 0;
^ /home/wipro/Downloads/proc/proc.c:33:9: error: dereferencing pointer to incomplete type
link->gid = 100;
^ cc1: some warnings being treated as errors make[2]: *** [/home/wipro/Downloads/proc/proc.o] Error 1 make[1]: ***
[_module_/home/wipro/Downloads/proc] Error 2 make[1]: Leaving
directory/usr/src/linux-headers-3.13.0-32-generic' make: ***
[default] Error 2
How to remove the error
create_proc_entry has been removed since 3.10 kernel version. Alternative is to use proc_create. See that question for more info.

Resources