• DepthAI-v2
  • nop/serializer.h: No such file or directory

Hello,

I tried installing depthai-core from the main github branch and now when I compile I get this error: /usr/local/include/depthai-shared/utility/Serialization.hpp:9:10: fatal error: nop/serializer.h: No such file or directory

9 | #include <nop/serializer.h>

  |          ^\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

compilation terminated.

Is this normal ? should I install depthai-core from another branch ?

Hi,

This happens because the nop library is missing — it's a submodule in the depthai-core repo. To fix it, try running this:

git submodule update --init --recursive

I deleted my old depthai-core build :
sudo rm -rf /usr/local/include/depthai*
sudo rm -rf /usr/local/lib/libdepthai*
sudo rm -rf /usr/local/lib/cmake/depthai*
sudo rm -rf /usr/local/lib/cmake/depthai-core*
rm -rf ~/.hunter
cd ~/depthai-core
rm -rf build

And then reinstalled depthai-core with :

git submodule update --init --recursive
mkdir -p build && cd build
cmake .. \
-D BUILD_SHARED_LIBS=ON \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OpenCV_DIR=/usr/lib/x86_64-linux-gnu/cmake/opencv4

make -j4
sudo make install

I recompiled my test program and still got the same error :
/usr/local/include/depthai-shared/utility/Serialization.hpp:9:10: fatal error: nop/serializer.h: No such file or directory

9 | #include <nop/serializer.h>

  |          ^\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

compilation terminated.
bash: -I/home/me/tl_optional/include: No such file or directory

Was there any change made to depthai-core that could cause this issue ?

    S777
    Check the shared directory. It should have repos inside. Then, instead of sudo make install, do cmake --build build -j4.
    Also, try without -DBUILD_SHARED_LIBS first.

    Thanks,
    Jaka

    I uninstalled depthai-core, deleted ./hunter and reinstalled with :
    git clone --recurse-submodules luxonis/depthai-core.git
    cd depthai-core
    mkdir build && cd build
    cmake ..
    cmake --build . -j4

    The installation completes then I compile my program with g++ :
    g++ -std=c++17 -g slam_test.cpp \
    -I/usr/include/eigen3 \
    -I/usr/include/opencv4 \
    -I/usr/include/pcl-1.14 \
    -I$HOME/faiss_install/include \
    -I$HOME/depthai-core/include \
    -I$HOME/depthai-core/shared/include \
    -I$HOME/depthai-core/shared/depthai-shared/include \
    -I$HOME/depthai-core/shared/depthai-shared/third_party/libnop/include \
    -I$HOME/tl_optional/include \
    -L$HOME/depthai-core/build/lib \
    -L/usr/local/lib \
    -L/usr/lib/x86_64-linux-gnu \
    -L$HOME/faiss_install/lib \
    -ldepthai-core -ldepthai-opencv -lxlink \
    -lgtsam -lgtsam_unstable -ltbb \
    -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_features2d -lopencv_videoio -lopencv_ximgproc \
    -lpcl_common -lpcl_io -lpcl_filters -lpcl_search -lpcl_features \
    -lpcl_kdtree -lpcl_registration -lteaser_registration -lfaiss \
    -lcurl -lpthread -lrt -ldl -lzmq -fopenmp -lyaml-cpp \
    -o slam_test

    And I still got this error :
    In file included from /home/me/depthai-core/shared/depthai-shared/include/depthai-shared/common/Point3f.hpp:7,

                 from /home/me/depthai-core/shared/depthai-shared/include/depthai-shared/common/Extrinsics.hpp:6,
    
                 from /home/me/depthai-core/shared/depthai-shared/include/depthai-shared/common/CameraInfo.hpp:4,
    
                 from /home/me/depthai-core/shared/depthai-shared/include/depthai-shared/common/EepromData.hpp:7,
    
                 from /home/me/depthai-core/include/depthai/device/CalibrationHandler.hpp:6,
    
                 from /home/me/depthai-core/include/depthai/depthai.hpp:9,
    
                 from Camera5.cpp:8,
    
                 from Slam4.cpp:29,
    
                 from slam_test.cpp:7:

    /home/me/depthai-core/shared/depthai-shared/include/depthai-shared/utility/Serialization.hpp:9:10: fatal error: nop/serializer.h: No such file or directory

    9 | #include <nop/serializer.h>
    
      |          ^\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

    compilation terminated.

    I checked with : find ~/depthai-core -name "serializer.h"
    but got no result.

    Hunter is saving dependencies outside the scope you are searching at, iirc by default that would be somewhere in the $HOME/.hunter/... (for example: /home/danilo/.hunter/_Base/16cc954/21498a3/132317e/Install/include). Easiest solution for finding libnop is to just add that path to your includes, but probably best way to build would be to checkout how depthai deals with hunter and make similar cmake file for your project.