NovaBug icon indicating copy to clipboard operation
NovaBug copied to clipboard

Compile Error in particular situations

Open 4D4850 opened this issue 4 years ago • 1 comments

When doing this (my username replaced with 'user' and hostname replaced with 'host'), the error shown is thrown:

user@host:~/Unstable_Star/NovaBug/build$ cmake -G "Unix Makefiles" ..
-- The CXX compiler identification is GNU 8.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SFML 2.5.1 in /usr/lib/x86_64-linux-gnu/cmake/SFML
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/Unstable_Star/NovaBug/build
user@host:~/Unstable_Star/NovaBug/build$ ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake  Makefile
user@host:~/Unstable_Star/NovaBug/build$ id
uid=1000(user) gid=1000(user) groups=1000(user),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),105(input),109(netdev),112(bluetooth),116(scanner)
user@host:~/Unstable_Star/NovaBug/build$ make
Scanning dependencies of target NovaBug
[ 50%] Building CXX object CMakeFiles/NovaBug.dir/src/main.cpp.o
In file included from /home/user/Unstable_Star/NovaBug/src/main.cpp:8:
/home/user/Unstable_Star/NovaBug/include/engine/common/transition.hpp: In static member function ‘static float trn::Transition<T>::ratio(float)’:
/home/user/Unstable_Star/NovaBug/include/engine/common/transition.hpp:135:30: error: ‘expf’ is not a member of ‘std’
   return 1.0f / (1.0f + std::expf(-(width*(2.0f*t - 1.0f))));
                              ^~~~
/home/user/Unstable_Star/NovaBug/include/engine/common/transition.hpp:135:30: note: suggested alternative: ‘exp2’
   return 1.0f / (1.0f + std::expf(-(width*(2.0f*t - 1.0f))));
                              ^~~~
                              exp2
make[2]: *** [CMakeFiles/NovaBug.dir/build.make:63: CMakeFiles/NovaBug.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/NovaBug.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
user@host:~/Unstable_Star/NovaBug/build$ ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake  Makefile

Could this be fixed?

4D4850 avatar Aug 26 '21 01:08 4D4850

It seems you have the problem mentioned in this post https://stackoverflow.com/questions/56417980/cosf-sinf-etc-are-not-in-std. You can try to replace std::expfwith just expf or exp

johnBuffer avatar Aug 26 '21 08:08 johnBuffer