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

std namespace errors while compiling using cmake #27

Closed
ashishmagar600 opened this issue Jun 10, 2022 · 4 comments
Closed

std namespace errors while compiling using cmake #27

ashishmagar600 opened this issue Jun 10, 2022 · 4 comments

Comments

@ashishmagar600
Copy link

I am building a cross-compilation platform using OpenCV 3.4.4, darknet (and its dependencies) and DarkHelp.

DarkHelp dependencies such as magic, tclap etc have been cross-compiled successfully along with OpenCV and darknet. I have tested it on my RPi, the darknet libs and exe works.

When I try to compile Darkhelp,

cmake -DOpenCV_DIR="${RPI_SYSROOT}/usr/local/lib" -DCMAKE_PREFIX_PATH="${RPI_SYSROOT}/usr/local" ..


-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Building ver: 1.4.18-1
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- 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  
-- Found OpenCV: /home/develop/RPi-sysroot/usr/local (found version "3.4.4") 
-- Configuring done
-- Generating done
-- Build files have been written to: 

make -j4


[ 11%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelpConfig.cpp.o
In file included from /usr/include/c++/7/ext/string_conversions.h:41:0,
                 from /usr/include/c++/7/bits/basic_string.h:6361,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/stl_map.h:63,
                 from /usr/include/c++/7/map:61,
                 from /home/develop/test_darknet/DarkHelp/src-lib/DarkHelp.hpp:9,
                 from /home/develop/test_darknet/DarkHelp/src-lib/DarkHelpConfig.cpp:6:
/usr/include/c++/7/cstdlib:144:11: error: '::calloc' has not been declared
   using ::calloc;
           ^~~~~~
/usr/include/c++/7/cstdlib:147:11: error: '::free' has not been declared
   using ::free;
           ^~~~
/usr/include/c++/7/cstdlib:151:11: error: '::malloc' has not been declared
   using ::malloc;
           ^~~~~~

This is a short part of the error. All the calls to std:: are reported.

While searching for a solution, I found this post

It seems some include<> are done within the namespace{} as I came across multiple forum posts. Let me know if any more information is required to find a solution.

@stephanecharette
Copy link
Owner

Sorry, I have no idea. I do build regularly on my RPI without problem. Let me know if you find the cause.

@ashishmagar600
Copy link
Author

ashishmagar600 commented Jun 10, 2022 via email

@stephanecharette
Copy link
Owner

Yes, I have it documented here: https://github.com/stephanecharette/DarkHelp#building-darknet-linux

All of my RPI devices run Ubuntu for RPI: https://ubuntu.com/download/raspberry-pi

This makes it extremely easy to build anything. You simply follow the normal Linux/Ubuntu instructions.

@ashishmagar600
Copy link
Author

I was looking for a way to cross-compile DarkHelp, but this is also helpful.

Thanks

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

2 participants