Ullaakut / cameradar

Cameradar hacks its way into RTSP videosurveillance cameras
MIT License
4.06k stars 513 forks source link

CMake Error at mysql-connector #74

Closed aliabusaad closed 7 years ago

aliabusaad commented 7 years ago

CMake Error at /home/lionsec/cameradar/deps/mysql-connector/src/deps.mysql_connector-stamp/deps.mysql_connector-configure.cmake:16 (message): Command failed: 1

'/usr/bin/cmake' '-DBOOST_ROOT=/home/lionsec/cameradar/deps/boost/src/deps.boost' '-DCMAKE_INSTALL_PREFIX=/home/lionsec/cameradar/deps/mysql-connector' '-DBUILD_TYPE=Release' '-DMYSQL_CXXFLAGS=-fexceptions' '/home/lionsec/cameradar/deps/mysql-connector/src/deps.mysql_connector'

See also

/home/lionsec/cameradar/deps/mysql-connector/src/deps.mysql_connector-stamp/deps.mysql_connector-configure-*.log

deps/CMakeFiles/deps.mysql_connector.dir/build.make:103: recipe for target '../deps/mysql-connector/src/deps.mysql_connector-stamp/deps.mysql_connector-configure' failed make[2]: [../deps/mysql-connector/src/deps.mysql_connector-stamp/deps.mysql_connector-configure] Error 1 CMakeFiles/Makefile2:112: recipe for target 'deps/CMakeFiles/deps.mysql_connector.dir/all' failed make[1]: [deps/CMakeFiles/deps.mysql_connector.dir/all] Error 2 Makefile:136: recipe for target 'all' failed make: *** [all] Error 2 KO!

any idea how to fix this

Ullaakut commented 7 years ago

Do you really need to manually build Cameradar? You should not need to except if you want to make changes to the code.

As the logs state, there is more information in the files that match /home/lionsec/cameradar/deps/mysql-connector/src/deps.mysql_connector-stamp/deps.mysql_connector-configure-*.log.

Please comment the output of the command cat /home/lionsec/cameradar/deps/mysql-connector/src/deps.mysql_connector-stamp/deps.mysql_connector-configure-*.log in here.

aliabusaad commented 7 years ago

lionsec@ubuntu:~/cameradar/deployment$ cat /home/lionsec/cameradar/deps/mysql-connector/src/deps.mysql_connector-stamp/deps.mysql_connector-configure-.log CMake Error at FindMySQL.cmake:556 (message): Could not find "mysql.h" from searching "/usr/include/mysql /usr/local/include/mysql /opt/mysql/mysql/include /opt/mysql/mysql/include/mysql /usr/local/mysql/include /usr/local/mysql/include/mysql /MySQL//include /MySQL/*/include" Call Stack (most recent call first): CMakeLists.txt:217 (INCLUDE)

-- Environment compile flags: -fexceptions -- Environment link flags: -- Boost version: 1.58.0 -- BOOST_INCLUDE_DIRS=/usr/include -- You will link dynamically to the MySQL client library (set with -DMYSQLCLIENT_STATIC_LINKING=) -- Searching for dynamic libraries with the base name(s) "mysqlclient_r mysqlclient" -- Configuring incomplete, errors occurred! See also "/home/lionsec/cameradar/deps/mysql-connector/src/deps.mysql_connector/CMakeFiles/CMakeOutput.log".

Ullaakut commented 7 years ago

You need to install the mysql libraries on your machine in order to manually build cameradar.

Here is everything the Dockerfile uses:

Can you tell me why you need to build Cameradar manually instead of using the Docker image?

aliabusaad commented 7 years ago

so do i use docker better ?

Ullaakut commented 7 years ago

Docker allows you to always use the latest version, avoid installing useless dependencies on your computer, and it avoids the pain to build the software. If you need help on how to use docker, feel free to ask :)

aliabusaad commented 7 years ago

its ok now but i got this when i make a scan Cameradar version 1.1.4 Build 20170701164735 [2017-07-01 20:17:36.515] [cameradar] [info] (main::main:95): No log level set, using log level 1 [2017-07-01 20:17:36.515] [cameradar] [warning] (main::load:193): No custom path set, trying to use default path: conf/cameradar.conf.json [2017-07-01 20:17:36.516] [cameradar] [debug] (configuration::load_url:95): Trying to open url file from /cameradar/conf/url.json [2017-07-01 20:17:36.516] [cameradar] [error] (configuration::load_url:124): Could not load ids file. Make sure you provided a valid path in your configuration file. [2017-07-01 20:17:36.516] [cameradar] [debug] (configuration::load_ids:50): Trying to open ids file from /cameradar/conf/ids.json [2017-07-01 20:17:36.516] [cameradar] [error] (configuration::load_ids:85): Could not load ids file. Make sure you provided a valid path in your configuration file.

Ullaakut commented 7 years ago

As the logs say, the configuration file contains the paths to the dictionaries. The default path (used in the docker image) is /cameradar/conf which probably does not exist on your machine. You should edit the configuration file to suit your needs.

Once again, if you're not sure how all of this works, the docker image is way easier to use.

aliabusaad commented 7 years ago

i will try with docker

aliabusaad commented 7 years ago

[100%] Built target mysql_cache_manager Run CPack packaging tool... CPack: Create package using TGZ CPack: Install projects CPack: - Run preinstall target for: cameradar CPack: - Install project: cameradar CPack: Create package CPack: - package: /home/lionsec/cameradar/build/cameradar_1.1.4_Release_Linux.tar.gz generated. OK! lionsec@ubuntu:~/cameradar/deployment$ docker-compose build cameradar Unsupported config option for services service: 'cameradar'

Ullaakut commented 7 years ago

Your version of docker-composer is probably not right. However, when I said that you could use docker I didnt mean that you needed to build the Docker image yourself: as the first part of the readme says...

screen shot 2017-07-01 at 21 19 11

This will automatically download an already built image of Cameradar on the internet and run it on your machine.

Please tell me if you need more information!

Ullaakut commented 7 years ago

I guess that since you didn't add any questions, using the DH image worked out for you. I'm closing this ticket but feel free to reopen it if your problem isn't solved.