Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Issue #19

Open
Pyr3x opened this issue Jan 15, 2017 · 3 comments
Open

Compile Issue #19

Pyr3x opened this issue Jan 15, 2017 · 3 comments

Comments

@Pyr3x
Copy link

Pyr3x commented Jan 15, 2017

[ 5%] Building CXX object src/CMakeFiles/LTE_MISC.dir/capbuf.cpp.o
In file included from /root/LTE-Cell-Scanner/src/capbuf.cpp:29:0:
/root/LTE-Cell-Scanner/include/dsp.h: In function ‘itpp::cvec fshift(const cvec&, double, double)’:
/root/LTE-Cell-Scanner/include/dsp.h:47:25: error: lvalue required as left operand of assignment
coeff.real()=cos(kt);
^
/root/LTE-Cell-Scanner/include/dsp.h:48:25: error: lvalue required as left operand of assignment
coeff.imag()=sin(k
t);
^
/root/LTE-Cell-Scanner/include/dsp.h: In function ‘void fshift_inplace(itpp::cvec&, double, double)’:
/root/LTE-Cell-Scanner/include/dsp.h:64:25: error: lvalue required as left operand of assignment
coeff.real()=cos(kt);
^
/root/LTE-Cell-Scanner/include/dsp.h:65:25: error: lvalue required as left operand of assignment
coeff.imag()=sin(k
t);
^
src/CMakeFiles/LTE_MISC.dir/build.make:62: recipe for target 'src/CMakeFiles/LTE_MISC.dir/capbuf.cpp.o' failed
make[2]: *** [src/CMakeFiles/LTE_MISC.dir/capbuf.cpp.o] Error 1
CMakeFiles/Makefile2:121: recipe for target 'src/CMakeFiles/LTE_MISC.dir/all' failed
make[1]: *** [src/CMakeFiles/LTE_MISC.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

@itdaniher
Copy link

Same issue:

Scanning dependencies of target LTE_MISC
[ 16%] Building CXX object src/CMakeFiles/LTE_MISC.dir/itpp_ext.cpp.o
[ 16%] Building CXX object src/CMakeFiles/LTE_MISC.dir/capbuf.cpp.o
[ 16%] Building CXX object src/CMakeFiles/LTE_MISC.dir/constants.cpp.o
[ 22%] Building CXX object src/CMakeFiles/LTE_MISC.dir/macros.cpp.o
[ 27%] Building CXX object src/CMakeFiles/LTE_MISC.dir/searcher.cpp.o
[ 33%] Building CXX object src/CMakeFiles/LTE_MISC.dir/common.cpp.o
In file included from /home/name/kalibrate-rtl/LTE-Cell-Scanner/src/capbuf.cpp:29:0:
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h: In function ‘itpp::cvec fshift(const cvec&, double, double)’:
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:47:25: error: lvalue required as left operand of assignment
     coeff.real()=cos(k*t);
                         ^
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:48:25: error: lvalue required as left operand of assignment
     coeff.imag()=sin(k*t);
                         ^
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h: In function ‘void fshift_inplace(itpp::cvec&, double, double)’:
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:64:25: error: lvalue required as left operand of assignment
     coeff.real()=cos(k*t);
                         ^
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:65:25: error: lvalue required as left operand of assignment
     coeff.imag()=sin(k*t);
                         ^
src/CMakeFiles/LTE_MISC.dir/build.make:62: recipe for target 'src/CMakeFiles/LTE_MISC.dir/capbuf.cpp.o' failed
make[2]: *** [src/CMakeFiles/LTE_MISC.dir/capbuf.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/name/kalibrate-rtl/LTE-Cell-Scanner/src/searcher.cpp:60:0:
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h: In function ‘itpp::cvec fshift(const cvec&, double, double)’:
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:47:25: error: lvalue required as left operand of assignment
     coeff.real()=cos(k*t);
                         ^
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:48:25: error: lvalue required as left operand of assignment
     coeff.imag()=sin(k*t);
                         ^
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h: In function ‘void fshift_inplace(itpp::cvec&, double, double)’:
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:64:25: error: lvalue required as left operand of assignment
     coeff.real()=cos(k*t);
                         ^
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:65:25: error: lvalue required as left operand of assignment
     coeff.imag()=sin(k*t);
                         ^
src/CMakeFiles/LTE_MISC.dir/build.make:158: recipe for target 'src/CMakeFiles/LTE_MISC.dir/searcher.cpp.o' failed
make[2]: *** [src/CMakeFiles/LTE_MISC.dir/searcher.cpp.o] Error 1
In file included from /home/name/kalibrate-rtl/LTE-Cell-Scanner/src/common.cpp:24:0:
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h: In function ‘itpp::cvec fshift(const cvec&, double, double)’:
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:47:25: error: lvalue required as left operand of assignment
     coeff.real()=cos(k*t);
                         ^
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:48:25: error: lvalue required as left operand of assignment
     coeff.imag()=sin(k*t);
                         ^
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h: In function ‘void fshift_inplace(itpp::cvec&, double, double)’:
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:64:25: error: lvalue required as left operand of assignment
     coeff.real()=cos(k*t);
                         ^
/home/name/kalibrate-rtl/LTE-Cell-Scanner/include/dsp.h:65:25: error: lvalue required as left operand of assignment
     coeff.imag()=sin(k*t);
                         ^
src/CMakeFiles/LTE_MISC.dir/build.make:182: recipe for target 'src/CMakeFiles/LTE_MISC.dir/common.cpp.o' failed
make[2]: *** [src/CMakeFiles/LTE_MISC.dir/common.cpp.o] Error 1
CMakeFiles/Makefile2:121: recipe for target 'src/CMakeFiles/LTE_MISC.dir/all' failed
make[1]: *** [src/CMakeFiles/LTE_MISC.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-5' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 6.3.0 20170124 (Debian 6.3.0-5)
ii  libitpp-dev                            4.3.1-7                              armhf        C++ library of signal processing and communication routines: Headers
ii  libitpp8v5:armhf                       4.3.1-7                              armhf        C++ library of signal processing and communication routines
Linux 3.4.113-sun8i #50 SMP PREEMPT Mon Nov 14 08:41:55 CET 2016 armv7l

@itdaniher
Copy link

The fix is pretty simple, just adding '-std=c++03' to CMAKE_CXX_FLAGS

https://ubuntuforums.org/showthread.php?t=2349493

itdaniher added a commit to itdaniher/LTE-Cell-Scanner that referenced this issue Jan 31, 2017
@solsticedhiver
Copy link

solsticedhiver commented Dec 30, 2018

well the correct fix is to use the new syntax:

diff --git a/include/dsp.h b/include/dsp.h
index fcba157..3c68a67 100644
--- a/include/dsp.h
+++ b/include/dsp.h
@@ -44,8 +44,8 @@ inline itpp::cvec fshift(const itpp::cvec &seq,const double f,const double fs) {
   itpp::cvec r(len);
   std::complex<double>coeff;
   for (uint32 t=0;t<len;t++) {
-    coeff.real()=cos(k*t);
-    coeff.imag()=sin(k*t);
+    coeff.real(cos(k*t));
+    coeff.imag(sin(k*t));
     //r(t)=seq(t)*exp(k*((double)t));
     r(t)=seq(t)*coeff;
   }
@@ -61,8 +61,8 @@ inline void fshift_inplace(itpp::cvec &seq,const double f,const double fs) {
   const uint32 len=length(seq);
   std::complex<double>coeff;
   for (uint32 t=0;t<len;t++) {
-    coeff.real()=cos(k*t);
-    coeff.imag()=sin(k*t);
+    coeff.real(cos(k*t));
+    coeff.imag(sin(k*t));
     //r(t)=seq(t)*exp(k*((double)t));
     seq(t)*=coeff;
   }
diff --git a/src/producer_thread.cpp b/src/producer_thread.cpp
index 6c72618..a24ca84 100644
--- a/src/producer_thread.cpp
+++ b/src/producer_thread.cpp
@@ -124,9 +124,9 @@ void producer_thread(
           n_samples=t;
           break;
         }
-        sample_temp.real()=(sampbuf_sync.fifo.front()-127.0)/128.0;
+        sample_temp.real((sampbuf_sync.fifo.front()-127.0)/128.0);
         sampbuf_sync.fifo.pop_front();
-        sample_temp.imag()=(sampbuf_sync.fifo.front()-127.0)/128.0;
+        sample_temp.imag((sampbuf_sync.fifo.front()-127.0)/128.0);
         sampbuf_sync.fifo.pop_front();
         samples(t)=sample_temp;
         sample_time+=(FS_LTE/16)/(fs_programmed*k_factor);
diff --git a/src/tracker_thread.cpp b/src/tracker_thread.cpp
index c903685..d054341 100644
--- a/src/tracker_thread.cpp
+++ b/src/tracker_thread.cpp
@@ -163,10 +163,10 @@ void get_fd(
   const complex <double> bpo_coeff=complex<double>(cos(bulk_phase_offset),sin(bulk_phase_offset));
   for (uint8 t=1;t<=36;t++) {
     phase=-k*t;
-    coeff.real()=cos(phase);
-    coeff.imag()=sin(phase);
+    coeff.real(cos(phase));
+    coeff.imag(sin(phase));
     syms(35+t)*=bpo_coeff*coeff;
-    coeff.imag()=-coeff.imag();
+    coeff.imag(-coeff.imag());
     syms(36-t)*=bpo_coeff*coeff;
   }
   // At this point, we have the frequency domain data for this slot and

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants