make failure (libi2c is missing) - raspberry-pi

I try to compile the following project: https://github.com/ovrheat/raspberry_rtl_wh1080 on my Raspberry Pi, unfortunately during the make I'm gettiong errors I can't overcome to far:
> /raspberry_rtl_wh1080/build $ make
-- Build type not specified: defaulting to release.
-- Using Git version tag: -128-NOTFOUND on master at 201807090025 (refs/heads/ma ster commit 0201e8745dbdbe4106f4802a8b0213d58d5fdd13)
CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardAr gs.cmake:273 (message):
The package name passed to `find_package_handle_standard_args` (PkgConfig)
does not match the name of the calling package (LibRTLSDR). This can lead
to problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
/usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:59 (find_package_handle_stan dard_args)
cmake/Modules/FindLibRTLSDR.cmake:1 (INCLUDE)
CMakeLists.txt:82 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/raspberry_rtl_wh1080/build
[ 6%] Building C object src/CMakeFiles/data.dir/data.c.o
/home/pi/raspberry_rtl_wh1080/src/data.c:88:35: warning: cast between incompatib le function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘ void * (*)(void *)’ [-Wcast-function-type]
88 | .array_element_release = (array_element_release_fn) data_free,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:89:35: warning: cast between incompatib le function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘ void * (*)(void *)’ [-Wcast-function-type]
89 | .value_release = (value_release_fn) data_free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:96:35: warning: cast between incompatib le function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-functi on-type]
96 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:103:35: warning: cast between incompati ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct ion-type]
103 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:109:35: warning: cast between incompati ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct ion-type]
109 | .array_element_release = (array_element_release_fn) free,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:110:35: warning: cast between incompati ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct ion-type]
110 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:116:35: warning: cast between incompati ble function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_ar ray *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
116 | .array_element_release = (array_element_release_fn) data_array_ free ,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:117:35: warning: cast between incompati ble function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_ar ray *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
117 | .value_release = (value_release_fn) data_array_free },
| ^
[ 13%] Linking C static library libdata.a
[ 13%] Built target data
[ 20%] Building C object src/CMakeFiles/rtl_433.dir/baseband.c.o
[ 26%] Building C object src/CMakeFiles/rtl_433.dir/bitbuffer.c.o
[ 33%] Building C object src/CMakeFiles/rtl_433.dir/data.c.o
/home/pi/raspberry_rtl_wh1080/src/data.c:88:35: warning: cast between incompatib le function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘ void * (*)(void *)’ [-Wcast-function-type]
88 | .array_element_release = (array_element_release_fn) data_free,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:89:35: warning: cast between incompatib le function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘ void * (*)(void *)’ [-Wcast-function-type]
89 | .value_release = (value_release_fn) data_free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:96:35: warning: cast between incompatib le function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-functi on-type]
96 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:103:35: warning: cast between incompati ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct ion-type]
103 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:109:35: warning: cast between incompati ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct ion-type]
109 | .array_element_release = (array_element_release_fn) free,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:110:35: warning: cast between incompati ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct ion-type]
110 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:116:35: warning: cast between incompati ble function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_ar ray *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
116 | .array_element_release = (array_element_release_fn) data_array_ free ,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:117:35: warning: cast between incompati ble function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_ar ray *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
117 | .value_release = (value_release_fn) data_array_free },
| ^
[ 40%] Building C object src/CMakeFiles/rtl_433.dir/pulse_demod.c.o
[ 46%] Building C object src/CMakeFiles/rtl_433.dir/pulse_detect.c.o
[ 53%] Building C object src/CMakeFiles/rtl_433.dir/rtl_433.c.o
[ 60%] Building C object src/CMakeFiles/rtl_433.dir/optparse.c.o
[ 66%] Building C object src/CMakeFiles/rtl_433.dir/util.c.o
[ 73%] Building C object src/CMakeFiles/rtl_433.dir/devices/flex.c.o
[ 80%] Building C object src/CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o
In file included from /usr/include/aarch64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from /home/pi/raspberry_rtl_wh1080/include/data.h:24,
from /home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c:102:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
| ^~~~~~~
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c: In function ‘bmp085_i2c_Read_Int’:
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c:174:14: warning: implicit declaration of function ‘i2c_smbus_read_word_data’ [-Wimplicit-function-declaration]
174 | __s32 res = i2c_smbus_read_word_data(fd, address);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c: In function ‘bmp085_i2c_Write_Byte’:
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c:189:6: warning: implicit declaration of function ‘i2c_smbus_write_byte_data’ [-Wimplicit-function-declaration]
189 | if (i2c_smbus_write_byte_data(fd, address, value) < 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c: In function ‘bmp085_i2c_Read_Block’:
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c:198:5: warning: implicit declaration of function ‘i2c_smbus_read_i2c_block_data’ [-Wimplicit-function-declaration]
198 | if(i2c_smbus_read_i2c_block_data(fd, address,length,values)<0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 86%] Linking C executable rtl_433
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_i2c_Read_Int':
fineoffset_wh1080.c:(.text+0x84): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_i2c_Write_Byte':
fineoffset_wh1080.c:(.text+0xc8): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_i2c_Read_Block':
fineoffset_wh1080.c:(.text+0xfc): undefined reference to `i2c_smbus_read_i2c_block_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_Calibration':
fineoffset_wh1080.c:(.text+0x160): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x188): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x1a8): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x1c8): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x1e8): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o:fineoffset_wh1080.c:(.text+0x208): more undefined references to `i2c_smbus_read_word_data' follow
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_ReadUT':
fineoffset_wh1080.c:(.text+0x330): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x348): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_ReadUP':
fineoffset_wh1080.c:(.text+0x3d0): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x3f0): undefined reference to `i2c_smbus_read_i2c_block_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `read_int_temp':
fineoffset_wh1080.c:(.text+0x598): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x5b0): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `read_press':
fineoffset_wh1080.c:(.text+0x6a4): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x6bc): undefined reference to `i2c_smbus_read_word_data'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/rtl_433.dir/build.make:239: src/rtl_433] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:212: src/CMakeFiles/rtl_433.dir/all] Fehler 2
make: *** [Makefile:149: all] Fehler 2
I would like to know, how I can link the missing -li2c or -li2cdev into the project. Where and how to add?

Related

Cygwin install scipy error on compilation

I am trying to install scipy under cygwin with pip, unfortunately I have some compilation errors! I attach log files. I have searched on web but have found nothing.
thanks
2023-02-11T17:48:15,190 [250/1620] Compiling C++ object scipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p/_faddeeva.cxx.o
2023-02-11T17:48:15,191 FAILED: scipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p/_faddeeva.cxx.o
2023-02-11T17:48:15,192 c++ -Iscipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p -Iscipy/special -I../../scipy/special -I/tmp/pip-build-env-m1hcjhav/overlay/lib/python3.9/site-packages/numpy/core/include -I../../scipy/_lib/boost -Iscipy/_lib -I../../scipy/_lib -I../../scipy/_build_utils/src -I/usr/include/python3.9 -fvisibility=hidden -fvisibility-inlines-hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++14 -O2 -Wno-cpp -MD -MQ scipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p/_faddeeva.cxx.o -MF scipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p/_faddeeva.cxx.o.d -o scipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p/_faddeeva.cxx.o -c ../../scipy/special/_faddeeva.cxx
2023-02-11T17:48:15,193 ../../scipy/special/_faddeeva.cxx: In function ‘npy_cdouble faddeeva_ndtr(npy_cdouble)’:
2023-02-11T17:48:15,194 ../../scipy/special/_faddeeva.cxx:79:10: error: ‘M_SQRT1_2’ was not declared in this scope; did you mean ‘NPY_SQRT1_2’?
2023-02-11T17:48:15,196 79 | z *= M_SQRT1_2;
2023-02-11T17:48:15,199 | ^~~~~~~~~
2023-02-11T17:48:15,200 | NPY_SQRT1_2
2023-02-11T17:48:15,201 ../../scipy/special/_faddeeva.cxx: In function ‘double faddeeva_log_ndtr(double)’:
2023-02-11T17:48:15,202 ../../scipy/special/_faddeeva.cxx:108:18: error: ‘M_SQRT1_2’ was not declared in this scope; did you mean ‘NPY_SQRT1_2’?
2023-02-11T17:48:15,203 108 | double t = x*M_SQRT1_2;
2023-02-11T17:48:15,204 | ^~~~~~~~~
2023-02-11T17:48:15,205 | NPY_SQRT1_2
2023-02-11T17:48:15,206 ../../scipy/special/_faddeeva.cxx: In function ‘npy_cdouble faddeeva_log_ndtr_complex(npy_cdouble)’:
2023-02-11T17:48:15,207 ../../scipy/special/_faddeeva.cxx:130:53: error: ‘M_SQRT1_2’ was not declared in this scope; did you mean ‘NPY_SQRT1_2’?
2023-02-11T17:48:15,208 130 | complex<double> w = -0.5 * Faddeeva::erfc(z*M_SQRT1_2);
2023-02-11T17:48:15,209 | ^~~~~~~~~
2023-02-11T17:48:15,210 | NPY_SQRT1_2
2023-02-11T17:48:15,211 ../../scipy/special/_faddeeva.cxx:136:11: error: ‘M_SQRT1_2’ was not declared in this scope; did you mean ‘NPY_SQRT1_2’?
2023-02-11T17:48:15,212 136 | z *= -M_SQRT1_2;
2023-02-11T17:48:15,218 | ^~~~~~~~~
2023-02-11T17:48:15,219 | NPY_SQRT1_2
2023-02-11T17:48:15,220 ../../scipy/special/_faddeeva.cxx:146:34: error: ‘M_PI’ was not declared in this scope
2023-02-11T17:48:15,221 146 | double im = fmod(mIm_z2, 2.0*M_PI);
2023-02-11T17:48:15,223 | ^~~~
2023-02-11T17:48:15,224 ../../scipy/special/_faddeeva.cxx: In function ‘double faddeeva_voigt_profile(double, double, double)’:
2023-02-11T17:48:15,225 ../../scipy/special/_faddeeva.cxx:177:24: error: ‘M_PI’ was not declared in this scope
2023-02-11T17:48:15,226 177 | return gamma / M_PI / (x*x + gamma*gamma);
2023-02-11T17:48:15,227 | ^~~~
I expect to find a solution to this compilation problem! Since I cannot intervene in the code, I don't have much room for action.

Problem compiling emacs 23.4.1 on Ubuntu 20.0.4.2 LTS

I followed the instructions in INSTALL for dependency installation and configuration. Then, after make, I get these errors:
In file included from ./config.h:1074,
from dispnew.c:21:
dispnew.c: In function ‘update_frame_1’:
./s/gnu-linux.h:164:10: error: ‘FILE’ {aka ‘struct _IO_FILE’} has no member named ‘_pptr’
164 | ((FILE)->_pptr - (FILE)->_pbase)
| ^~
dispnew.c:89:30: note: in expansion of macro ‘GNU_LIBRARY_PENDING_OUTPUT_COUNT’
89 | #define PENDING_OUTPUT_COUNT GNU_LIBRARY_PENDING_OUTPUT_COUNT
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dispnew.c:5384:16: note: in expansion of macro ‘PENDING_OUTPUT_COUNT’
5384 | int outq = PENDING_OUTPUT_COUNT (display_output);
| ^~~~~~~~~~~~~~~~~~~~
./s/gnu-linux.h:164:26: error: ‘FILE’ {aka ‘struct _IO_FILE’} has no member named ‘_pbase’
164 | ((FILE)->_pptr - (FILE)->_pbase)
| ^~
dispnew.c:89:30: note: in expansion of macro ‘GNU_LIBRARY_PENDING_OUTPUT_COUNT’
89 | #define PENDING_OUTPUT_COUNT GNU_LIBRARY_PENDING_OUTPUT_COUNT
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dispnew.c:5384:16: note: in expansion of macro ‘PENDING_OUTPUT_COUNT’
5384 | int outq = PENDING_OUTPUT_COUNT (display_output);
How do I get past these errors?

Cant install Net::Pcap with cpan/cpanm on Linux

I am trying to install the module Net::Pcap. Here is what I have done:
[nick#void ~]$ cpanm Net::Pcap
--> Working on Net::Pcap
Fetching http://www.cpan.org/authors/id/S/SA/SAPER/Net-Pcap-0.18.tar.gz ... OK
Configuring Net-Pcap-0.18 ... OK
Building and testing Net-Pcap-0.18 ... FAIL
! Installing Net::Pcap failed. See /home/nick/.cpanm/work/1612889779.12603/build.log for details. Retry with --force to force install it.
Here is the build.log file:
[nick#void ~]$ cat /home/nick/.cpanm/work/1612889779.12603/build.log
cpanm (App::cpanminus) 1.7044 on perl 5.032001 built for x86_64-linux
Work directory is /home/nick/.cpanm/work/1612889779.12603
You have make /usr/bin/make
You have /usr/bin/curl
You have /usr/bin/tar: tar (GNU tar) 1.32
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching Net::Pcap () on cpanmetadb ...
--> Working on Net::Pcap
Fetching http://www.cpan.org/authors/id/S/SA/SAPER/Net-Pcap-0.18.tar.gz
-> OK
Unpacking Net-Pcap-0.18.tar.gz
Entering Net-Pcap-0.18
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.44)
Configuring Net-Pcap-0.18
Running Makefile.PL
looking for -lpcap... yes
checking for pcap_lib_version() in -lpcap... yes
detecting available functions... ok
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Net::Pcap
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.44)
Checking if you have Test::More 0.45 ... Yes (1.302175)
Checking if you have Socket 0 ... Yes (2.029)
Checking if you have XSLoader 0 ... Yes (0.30)
Checking if you have Carp 0 ... Yes (1.50)
Checking if you have Sys::Hostname 0 ... Yes (1.23)
Building and testing Net-Pcap-0.18
cp Pcap.pm blib/lib/Net/Pcap.pm
Running Mkbootstrap for Pcap ()
chmod 644 "Pcap.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Pcap.bs blib/arch/auto/Net/Pcap/Pcap.bs 644
"/usr/bin/perl" "/usr/share/perl5/core_perl/ExtUtils/xsubpp" -typemap '/usr/share/perl5/core_perl/ExtUtils/typemap' -typemap '/home/nick/.cpanm/work/1612889779.12603/Net-Pcap-0.18/typemap' Pcap.xs > Pcap.xsc
mv Pcap.xsc Pcap.c
cc -c -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe -g -D_FILE_OFFSET_BITS=64 -DLARGE_FILE_SUPPORT64 -Wall -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe -g -D_FILE_OFFSET_BITS=64 -DLARGE_FILE_SUPPORT64 -DVERSION=\"0.18\" -DXS_VERSION=\"0.18\" -fPIC "-I/usr/lib/perl5/core_perl/CORE" -DHAVE_BLANK -DHAVE_PCAP_LIB_VERSION -DHAVE_PCAP_BREAKLOOP -DHAVE_PCAP_COMPILE_NOPCAP -DHAVE_PCAP_DATALINK_NAME_TO_VAL -DHAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION -DHAVE_PCAP_DATALINK_VAL_TO_NAME -DHAVE_PCAP_DUMP_FILE -DHAVE_PCAP_DUMP_FLUSH -DHAVE_PCAP_FINDALLDEVS -DHAVE_PCAP_GETNONBLOCK -DHAVE_PCAP_GET_SELECTABLE_FD -DHAVE_PCAP_LIB_VERSION -DHAVE_PCAP_NEXT_EX -DHAVE_PCAP_OFFLINE_FILTER -DHAVE_PCAP_OPEN_DEAD -DHAVE_PCAP_SENDPACKET -DHAVE_PCAP_SETNONBLOCK -DHAVE_PCAP_SET_DATALINK Pcap.c
In file included from Pcap.xs:43:
stubs.inc:187:2: warning: #warning "the function pcap_list_datalinks() is not available" [-Wcpp]
187 | #warning "the function pcap_list_datalinks() is not available"
| ^~~~~~~
stubs.inc:322:2: warning: #warning "the function pcap_createsrcstr() is not available" [-Wcpp]
322 | #warning "the function pcap_createsrcstr() is not available"
| ^~~~~~~
stubs.inc:337:2: warning: #warning "the function pcap_parsesrcstr() is not available" [-Wcpp]
337 | #warning "the function pcap_parsesrcstr() is not available"
| ^~~~~~~
stubs.inc:352:2: warning: #warning "the function pcap_open() is not available" [-Wcpp]
352 | #warning "the function pcap_open() is not available"
| ^~~~~~~
stubs.inc:357:8: error: redefinition of 'struct pcap_rmtauth'
357 | struct pcap_rmtauth {
| ^~~~~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1036:8: note: originally defined here
1036 | struct pcap_rmtauth
| ^~~~~~~~~~~~
In file included from Pcap.xs:43:
stubs.inc:363:10: error: conflicting types for 'pcap_open'
363 | pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err);
| ^~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1084:18: note: previous declaration of 'pcap_open' was here
1084 | PCAP_API pcap_t *pcap_open(const char *source, int snaplen, int flags,
| ^~~~~~~~~
In file included from Pcap.xs:43:
stubs.inc:364:10: error: conflicting types for 'pcap_open'
364 | pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err) {
| ^~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1084:18: note: previous declaration of 'pcap_open' was here
1084 | PCAP_API pcap_t *pcap_open(const char *source, int snaplen, int flags,
| ^~~~~~~~~
In file included from Pcap.xs:43:
stubs.inc:373:2: warning: #warning "the function pcap_setbuff() is not available" [-Wcpp]
373 | #warning "the function pcap_setbuff() is not available"
| ^~~~~~~
stubs.inc:388:2: warning: #warning "the function pcap_setuserbuffer() is not available" [-Wcpp]
388 | #warning "the function pcap_setuserbuffer() is not available"
| ^~~~~~~
stubs.inc:403:2: warning: #warning "the function pcap_setmode() is not available" [-Wcpp]
403 | #warning "the function pcap_setmode() is not available"
| ^~~~~~~
stubs.inc:418:2: warning: #warning "the function pcap_setmintocopy() is not available" [-Wcpp]
418 | #warning "the function pcap_setmintocopy() is not available"
| ^~~~~~~
stubs.inc:433:2: warning: #warning "the function pcap_sendqueue_alloc() is not available" [-Wcpp]
433 | #warning "the function pcap_sendqueue_alloc() is not available"
| ^~~~~~~
stubs.inc:455:2: warning: #warning "the function pcap_sendqueue_destroy() is not available" [-Wcpp]
455 | #warning "the function pcap_sendqueue_destroy() is not available"
| ^~~~~~~
stubs.inc:469:2: warning: #warning "the function pcap_sendqueue_queue() is not available" [-Wcpp]
469 | #warning "the function pcap_sendqueue_queue() is not available"
| ^~~~~~~
stubs.inc:484:2: warning: #warning "the function pcap_sendqueue_transmit() is not available" [-Wcpp]
484 | #warning "the function pcap_sendqueue_transmit() is not available"
| ^~~~~~~
stubs.inc:499:2: warning: #warning "the function pcap_event() is not available" [-Wcpp]
499 | #warning "the function pcap_event() is not available"
| ^~~~~~~
stubs.inc:514:2: warning: #warning "the function pcap_setsampling() is not available" [-Wcpp]
514 | #warning "the function pcap_setsampling() is not available"
| ^~~~~~~
stubs.inc:519:8: error: redefinition of 'struct pcap_samp'
519 | struct pcap_samp {
| ^~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1168:8: note: originally defined here
1168 | struct pcap_samp
| ^~~~~~~~~
In file included from Pcap.xs:43:
stubs.inc:524:19: error: conflicting types for 'pcap_setsampling'
524 | struct pcap_samp *pcap_setsampling(pcap_t *p);
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1186:28: note: previous declaration of 'pcap_setsampling' was here
1186 | PCAP_API struct pcap_samp *pcap_setsampling(pcap_t *p);
| ^~~~~~~~~~~~~~~~
In file included from Pcap.xs:43:
stubs.inc:525:19: error: conflicting types for 'pcap_setsampling'
525 | struct pcap_samp *pcap_setsampling(pcap_t *p) {
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1186:28: note: previous declaration of 'pcap_setsampling' was here
1186 | PCAP_API struct pcap_samp *pcap_setsampling(pcap_t *p);
| ^~~~~~~~~~~~~~~~
Pcap.xs: In function 'XS_Net__Pcap_lookupdev':
Pcap.xs:108:4: warning: 'pcap_lookupdev' is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
108 | RETVAL = pcap_lookupdev(errbuf);
| ^~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:394:16: note: declared here
394 | PCAP_API char *pcap_lookupdev(char *)
| ^~~~~~~~~~~~~~
Pcap.xs: In function 'XS_Net__Pcap_findalldevs_xs':
Pcap.xs:222:21: warning: 'pcap_lookupdev' is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
222 | char *dev = pcap_lookupdev(errbuf);
| ^~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:394:16: note: declared here
394 | PCAP_API char *pcap_lookupdev(char *)
| ^~~~~~~~~~~~~~
Pcap.c: In function 'XS_Net__Pcap_strerror':
Pcap.c:1703:9: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
1703 | RETVAL = pcap_strerror(error);
| ^
Pcap.xs: In function 'XS_Net__Pcap_getevent':
Pcap.xs:1038:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1038 | h = (unsigned int) pcap_getevent(p);
| ^
make: *** [Makefile:344: Pcap.o] Error 1
-> FAIL Installing Net::Pcap failed. See /home/nick/.cpanm/work/1612889779.12603/build.log for details. Retry with --force to force install it.
Ok, maybe regular cpan will work.
[nick#void ~]$ cpan Net::Pcap
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/home/nick/.cpan/Metadata'
Database was generated on Tue, 09 Feb 2021 14:56:08 GMT
Running install for module 'Net::Pcap'
Checksum for /home/nick/.cpan/sources/authors/id/S/SA/SAPER/Net-Pcap-0.18.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring S/SA/SAPER/Net-Pcap-0.18.tar.gz with Makefile.PL
looking for -lpcap... yes
checking for pcap_lib_version() in -lpcap... yes
detecting available functions... ok
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Net::Pcap
Writing MYMETA.yml and MYMETA.json
SAPER/Net-Pcap-0.18.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for S/SA/SAPER/Net-Pcap-0.18.tar.gz
cp Pcap.pm blib/lib/Net/Pcap.pm
Running Mkbootstrap for Pcap ()
chmod 644 "Pcap.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Pcap.bs blib/arch/auto/Net/Pcap/Pcap.bs 644
"/usr/bin/perl" "/usr/share/perl5/core_perl/ExtUtils/xsubpp" -typemap '/usr/share/perl5/core_perl/ExtUtils/typemap' -typemap '/home/nick/.cpan/build/Net-Pcap-0.18-7/typemap' Pcap.xs > Pcap.xsc
mv Pcap.xsc Pcap.c
cc -c -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe -g -D_FILE_OFFSET_BITS=64 -DLARGE_FILE_SUPPORT64 -Wall -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe -g -D_FILE_OFFSET_BITS=64 -DLARGE_FILE_SUPPORT64 -DVERSION=\"0.18\" -DXS_VERSION=\"0.18\" -fPIC "-I/usr/lib/perl5/core_perl/CORE" -DHAVE_BLANK -DHAVE_PCAP_LIB_VERSION -DHAVE_PCAP_BREAKLOOP -DHAVE_PCAP_COMPILE_NOPCAP -DHAVE_PCAP_DATALINK_NAME_TO_VAL -DHAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION -DHAVE_PCAP_DATALINK_VAL_TO_NAME -DHAVE_PCAP_DUMP_FILE -DHAVE_PCAP_DUMP_FLUSH -DHAVE_PCAP_FINDALLDEVS -DHAVE_PCAP_GETNONBLOCK -DHAVE_PCAP_GET_SELECTABLE_FD -DHAVE_PCAP_LIB_VERSION -DHAVE_PCAP_NEXT_EX -DHAVE_PCAP_OFFLINE_FILTER -DHAVE_PCAP_OPEN_DEAD -DHAVE_PCAP_SENDPACKET -DHAVE_PCAP_SETNONBLOCK -DHAVE_PCAP_SET_DATALINK Pcap.c
In file included from Pcap.xs:43:
stubs.inc:187:2: warning: #warning "the function pcap_list_datalinks() is not available" [-Wcpp]
187 | #warning "the function pcap_list_datalinks() is not available"
| ^~~~~~~
stubs.inc:322:2: warning: #warning "the function pcap_createsrcstr() is not available" [-Wcpp]
322 | #warning "the function pcap_createsrcstr() is not available"
| ^~~~~~~
stubs.inc:337:2: warning: #warning "the function pcap_parsesrcstr() is not available" [-Wcpp]
337 | #warning "the function pcap_parsesrcstr() is not available"
| ^~~~~~~
stubs.inc:352:2: warning: #warning "the function pcap_open() is not available" [-Wcpp]
352 | #warning "the function pcap_open() is not available"
| ^~~~~~~
stubs.inc:357:8: error: redefinition of 'struct pcap_rmtauth'
357 | struct pcap_rmtauth {
| ^~~~~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1036:8: note: originally defined here
1036 | struct pcap_rmtauth
| ^~~~~~~~~~~~
In file included from Pcap.xs:43:
stubs.inc:363:10: error: conflicting types for 'pcap_open'
363 | pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err);
| ^~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1084:18: note: previous declaration of 'pcap_open' was here
1084 | PCAP_API pcap_t *pcap_open(const char *source, int snaplen, int flags,
| ^~~~~~~~~
In file included from Pcap.xs:43:
stubs.inc:364:10: error: conflicting types for 'pcap_open'
364 | pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err) {
| ^~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1084:18: note: previous declaration of 'pcap_open' was here
1084 | PCAP_API pcap_t *pcap_open(const char *source, int snaplen, int flags,
| ^~~~~~~~~
In file included from Pcap.xs:43:
stubs.inc:373:2: warning: #warning "the function pcap_setbuff() is not available" [-Wcpp]
373 | #warning "the function pcap_setbuff() is not available"
| ^~~~~~~
stubs.inc:388:2: warning: #warning "the function pcap_setuserbuffer() is not available" [-Wcpp]
388 | #warning "the function pcap_setuserbuffer() is not available"
| ^~~~~~~
stubs.inc:403:2: warning: #warning "the function pcap_setmode() is not available" [-Wcpp]
403 | #warning "the function pcap_setmode() is not available"
| ^~~~~~~
stubs.inc:418:2: warning: #warning "the function pcap_setmintocopy() is not available" [-Wcpp]
418 | #warning "the function pcap_setmintocopy() is not available"
| ^~~~~~~
stubs.inc:433:2: warning: #warning "the function pcap_sendqueue_alloc() is not available" [-Wcpp]
433 | #warning "the function pcap_sendqueue_alloc() is not available"
| ^~~~~~~
stubs.inc:455:2: warning: #warning "the function pcap_sendqueue_destroy() is not available" [-Wcpp]
455 | #warning "the function pcap_sendqueue_destroy() is not available"
| ^~~~~~~
stubs.inc:469:2: warning: #warning "the function pcap_sendqueue_queue() is not available" [-Wcpp]
469 | #warning "the function pcap_sendqueue_queue() is not available"
| ^~~~~~~
stubs.inc:484:2: warning: #warning "the function pcap_sendqueue_transmit() is not available" [-Wcpp]
484 | #warning "the function pcap_sendqueue_transmit() is not available"
| ^~~~~~~
stubs.inc:499:2: warning: #warning "the function pcap_event() is not available" [-Wcpp]
499 | #warning "the function pcap_event() is not available"
| ^~~~~~~
stubs.inc:514:2: warning: #warning "the function pcap_setsampling() is not available" [-Wcpp]
514 | #warning "the function pcap_setsampling() is not available"
| ^~~~~~~
stubs.inc:519:8: error: redefinition of 'struct pcap_samp'
519 | struct pcap_samp {
| ^~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1168:8: note: originally defined here
1168 | struct pcap_samp
| ^~~~~~~~~
In file included from Pcap.xs:43:
stubs.inc:524:19: error: conflicting types for 'pcap_setsampling'
524 | struct pcap_samp *pcap_setsampling(pcap_t *p);
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1186:28: note: previous declaration of 'pcap_setsampling' was here
1186 | PCAP_API struct pcap_samp *pcap_setsampling(pcap_t *p);
| ^~~~~~~~~~~~~~~~
In file included from Pcap.xs:43:
stubs.inc:525:19: error: conflicting types for 'pcap_setsampling'
525 | struct pcap_samp *pcap_setsampling(pcap_t *p) {
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:1186:28: note: previous declaration of 'pcap_setsampling' was here
1186 | PCAP_API struct pcap_samp *pcap_setsampling(pcap_t *p);
| ^~~~~~~~~~~~~~~~
Pcap.xs: In function 'XS_Net__Pcap_lookupdev':
Pcap.xs:108:4: warning: 'pcap_lookupdev' is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
108 | RETVAL = pcap_lookupdev(errbuf);
| ^~~~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:394:16: note: declared here
394 | PCAP_API char *pcap_lookupdev(char *)
| ^~~~~~~~~~~~~~
Pcap.xs: In function 'XS_Net__Pcap_findalldevs_xs':
Pcap.xs:222:21: warning: 'pcap_lookupdev' is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
222 | char *dev = pcap_lookupdev(errbuf);
| ^~~~
In file included from /usr/include/pcap.h:43,
from Pcap.xs:32:
/usr/include/pcap/pcap.h:394:16: note: declared here
394 | PCAP_API char *pcap_lookupdev(char *)
| ^~~~~~~~~~~~~~
Pcap.c: In function 'XS_Net__Pcap_strerror':
Pcap.c:1703:9: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
1703 | RETVAL = pcap_strerror(error);
| ^
Pcap.xs: In function 'XS_Net__Pcap_getevent':
Pcap.xs:1038:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1038 | h = (unsigned int) pcap_getevent(p);
| ^
make: *** [Makefile:345: Pcap.o] Error 1
SAPER/Net-Pcap-0.18.tar.gz
/usr/bin/make -- NOT OK
It doesn't.
This is my first time ever installing a cpan module so I tried to install a random module, but it worked just fine.
[nick#void ~]$ cpanm Regexp::Debugger
--> Working on Regexp::Debugger
Fetching http://www.cpan.org/authors/id/D/DC/DCONWAY/Regexp-Debugger-0.002006.tar.gz ... OK
Configuring Regexp-Debugger-0.002006 ... OK
Building and testing Regexp-Debugger-0.002006 ... OK
Successfully installed Regexp-Debugger-0.002006
1 distribution installed
It would make sense that libpcap would be a dependency here, but I have it installed already.
[nick#void ~]$ sudo xbps-install libpcap
Package `libpcap' already installed.
I would appreciate help.
The problem is with my version of libpcap. This package appears to be broken on libpcap 1.10 and 1.9.1. After installing libpcap 1.8 the package built fine.

What does error when compiling drivers for wn722n mean?

I am trying to install drivers for wireless adapter wn722n on kali linux.
Following TP link manual:https://static.tp-link.com/2018/201812/20181207/Installation%20Guide%20for%20Linux.pdf
I get a lot of errors at the make stage that I don't understand:
root#kali:~/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222# make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.5.0-kali2-amd64/build M=/root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222 modules
make[1]: Entering directory '/usr/src/linux-headers-5.5.0-kali2-amd64'
CC [M] /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/core/rtw_cmd.o
In file included from /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/osdep_service.h:46,
from /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/drv_types.h:32,
from /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/core/rtw_cmd.c:22:
/root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/osdep_service_linux.h: In function ‘_init_timer’:
/root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/osdep_service_linux.h:288:8: error: ‘_timer’ {aka ‘struct timer_list’} has no member named ‘data’
288 | ptimer->data = (unsigned long)cntx;
| ^~
/root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/osdep_service_linux.h:289:2: error: implicit declaration of function ‘init_timer’; did you mean ‘_init_timer’? [-Werror=implicit-function-declaration]
289 | init_timer(ptimer);
| ^~~~~~~~~~
| _init_timer
In file included from /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/drv_types.h:35,
from /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/core/rtw_cmd.c:22:
/root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/wifi.h: At top level:
/root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/wifi.h:1012: warning: "IEEE80211_MAX_AMPDU_BUF" redefined
1012 | #define IEEE80211_MAX_AMPDU_BUF 0x40
|
In file included from /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/osdep_service_linux.h:86,
from /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/osdep_service.h:46,
from /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/include/drv_types.h:32,
from /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/core/rtw_cmd.c:22:
/usr/src/linux-headers-5.5.0-kali2-common/include/linux/ieee80211.h:1451: note: this is the location of the previous definition
1451 | #define IEEE80211_MAX_AMPDU_BUF 0x100
|
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-5.5.0-kali2-common/scripts/Makefile.build:271: /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222/core/rtw_cmd.o] Error 1
make[2]: *** [/usr/src/linux-headers-5.5.0-kali2-common/Makefile:1707: /root/Downloads/rtl8188EUS_linux_v5.2.2.4_25483.20171222] Error 2
make[1]: *** [/usr/src/linux-headers-5.5.0-kali2-common/Makefile:179: sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.5.0-kali2-amd64'
make: *** [Makefile:1911: modules] Error 2
Anyone has an idea what those mean?

having errors when compile .cc file to mex in Matlab

I am trying to complie a .cc file to mex, and I am using mex filename command in Matlab. My complier is [1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2012b\sys\lcc .
However, there are some errors:
lcc preprocessor error: learn.cc:5 Could not find include file <sys/time.h>
Error learn.cc: 70 illegal statement termination
Error learn.cc: 70 skipping `int'
Error learn.cc: 70 undeclared identifier `alen'
Error learn.cc: 71 illegal statement termination
Error learn.cc: 71 skipping `int'
Error learn.cc: 71 undeclared identifier `blen'
Error learn.cc: 87 invalid struct field declarations
Error learn.cc: 87 syntax error; found `collapsed' expecting `}'
Error learn.cc: 87 skipping `collapsed' `*' `x'
Error learn.cc: 93 unrecognized declaration
Warning learn.cc: 93 empty declaration
Error learn.cc: 97 undefined size for `incomplete struct timeval defined at learn.cc 97 tp'
Error learn.cc: 99 unknown field `tv_usec' of `incomplete struct timeval defined at learn.cc 97'
Error learn.cc: 102 syntax error; found `double' expecting `;'
Error learn.cc: 103 syntax error; found `double' expecting `;'
Error learn.cc: 106 missing parameter type
Error learn.cc: 106 syntax error; found `X' expecting `)'
Error learn.cc: 106 skipping `X' `,'
Error learn.cc: 106 syntax error; found `double' expecting `{'
Error learn.cc: 106 missing identifier
Error learn.cc: 106 too many errors
I guess the reason for the first error is that there is no time.h file in the sys folder. Instead there is timeb.h file. But I don't know the reason to the following errors.
Here are some relative codes:
line 70 int alen = **((int **)a);
line 71 int blen = **((int **)b);
line 86-93 struct data {
collapsed *x;
int num;
int numblocks;
int *blocksizes;
float *regmult;
float *learnmult;
};
line 96-100 void seed_time() {
struct timeval tp;
check(gettimeofday(&tp, NULL) == 0);
srand48((long)tp.tv_usec);
}
line 102 static inline double min(double x, double y) { return (x <= y ? x : y); }
line 103 static inline double max(double x, double y) { return (x <= y ? y : x); }
Can anyone give me a hint?
As far as i can tell, there is nothing wrong with lines 70,71. Are a,b integer double arrays declared and allocated with something like:
int ** a = malloc(4 * sizeof(int*) );
for (int var = 0; var < 4; ++var) {
a[var] = malloc(3*sizeof(int));
}
?
Are you sure that the sys/time.h file can be replaced by sys/timeb.h file? Have you tried?
sys/time.h looks like a pretty linux/unix specific file. Are you sure that the sys/ folder refers to your matlab sys directory (C:\PROGRA~1\MATLAB\R2012b\sys\lcc)?
In general, it looks like you are trying to compile a linux .mex file on a windows machine. For example gettimeofday is a linux pure call (according to this answer):
Equivalent of gettimeday() for Windows