sudiptab2100 / Wild-Storage

Use YouTube as Infinite Cloud Storage
https://github.com/sudiptab2100/Wild-Storage
Apache License 2.0
58 stars 10 forks source link

Error while compiling #3

Closed mochiron-desu closed 1 year ago

mochiron-desu commented 1 year ago

While compiling it using the

g++ -fPIC -shared DataProccessing/cLibs/helper.cpp -o DataProccessing/cLibs/c_lib.so

I was getting error such as:

DataProccessing/cLibs/helper.cpp: In function 'std::string pixelToBit(const uint8_t*, size_t, size_t)':
DataProccessing/cLibs/helper.cpp:14:48: error: 'round' was not declared in this scope
   14 |             bits += to_string(static_cast<int>(round(pix[i * width + j] / 255.0)) > 0.5 ? 1 : 0);
      |                                                ^~~~~
mochiron-desu commented 1 year ago

I kind of fixed it by adding the header of

#include <cmath>

in the file DataProccessing\cLibs\helper.cpp

and it compiled.