-1

I am trying to install aruco on my Windows machine using cmake 3.5.2 as suggested by the aruco developper.

My config:

  • Windows8
  • CMake 3.5.2
  • ArUco 2.0.5

I can configure and generate successfully aruco in cmake.

Then I go to aruco\build -> right click-> open cmd -> type mingw32-make -> get the following error:

C:\aruco-2.0.5\build>mingw32-make
Scanning dependencies of target aruco
[  2%] Building CXX object src/CMakeFiles/aruco.dir/ar_omp.cpp.obj
[  4%] Building CXX object src/CMakeFiles/aruco.dir/cameraparameters.cpp.obj
[  6%] Building CXX object src/CMakeFiles/aruco.dir/cvdrawingutils.cpp.obj
In file included from C:\aruco-2.0.5\src\aruco.h:149:0,
                 from C:\aruco-2.0.5\src\cvdrawingutils.h:31,
                 from C:\aruco-2.0.5\src\cvdrawingutils.cpp:28:
C:\aruco-2.0.5\src\markerdetector.h:160:40: warning: "/*" within comment [-Wcomm
ent]
                      ARUCO_MIP_36h12, //**** recommended
 ^
C:\aruco-2.0.5\src\markerdetector.h:212:60: warning: unused parameter 'r2' [-Wun
used-parameter]
     void setThresholdParamRange(size_t r1 = 0, size_t r2 = 0) {_params. _thresP
aram1_range = r1; }
                                                            ^
C:\aruco-2.0.5\src\markerdetector.h:267:30: warning: unused parameter 'val' [-Wu
nused-parameter]
     void setDesiredSpeed(int val){}
                              ^
In file included from C:\aruco-2.0.5\src\posetracker.h:33:0,
                 from C:\aruco-2.0.5\src\aruco.h:150,
                 from C:\aruco-2.0.5\src\cvdrawingutils.h:31,
                 from C:\aruco-2.0.5\src\cvdrawingutils.cpp:28:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::to
Stream(std::ostream&)':
C:\aruco-2.0.5\src\markermap.h:49:77: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
     void toStream(std::ostream &str){str<<id<<" "<<size()<<" ";for(int i=0;i<si
ze();i++) str<<at(i).x<<" "<<at(i).y<<" "<<at(i).z<<" ";}
                                                                             ^
In file included from C:\aruco-2.0.5\src\posetracker.h:33:0,
                 from C:\aruco-2.0.5\src\aruco.h:150,
                 from C:\aruco-2.0.5\src\cvdrawingutils.h:31,
                 from C:\aruco-2.0.5\src\cvdrawingutils.cpp:28:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::fr
omStream(std::istream&)':
C:\aruco-2.0.5\src\markermap.h:50:80: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
     void fromStream(std::istream &str){int s;str>>id>>s;resize(s);for(int i=0;i
<size();i++) str>>at(i).x>>at(i).y>>at(i).z;}

^
[  9%] Building CXX object src/CMakeFiles/aruco.dir/dictionary.cpp.obj
In file included from C:\aruco-2.0.5\src\dictionary.cpp:9:0:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::to
Stream(std::ostream&)':
C:\aruco-2.0.5\src\markermap.h:49:77: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
     void toStream(std::ostream &str){str<<id<<" "<<size()<<" ";for(int i=0;i<si
ze();i++) str<<at(i).x<<" "<<at(i).y<<" "<<at(i).z<<" ";}
                                                                             ^
In file included from C:\aruco-2.0.5\src\dictionary.cpp:9:0:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::fr
omStream(std::istream&)':
C:\aruco-2.0.5\src\markermap.h:50:80: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
     void fromStream(std::istream &str){int s;str>>id>>s;resize(s);for(int i=0;i
<size();i++) str>>at(i).x>>at(i).y>>at(i).z;}

^
C:\aruco-2.0.5\src\dictionary.cpp: In static member function 'static std::string
 aruco::Dictionary::getTypeString(aruco::Dictionary::DICT_TYPES)':
C:\aruco-2.0.5\src\dictionary.cpp:236:11: warning: enumeration value 'ARTAG' not
 handled in switch [-Wswitch]
     switch(t){
           ^
C:\aruco-2.0.5\src\dictionary.cpp: In member function 'aruco::MarkerMap aruco::D
ictionary::createMarkerMap(cv::Size, int, int, const std::vector<int>&, bool)':
C:\aruco-2.0.5\src\dictionary.cpp:275:39: warning: comparison between signed and
 unsigned integer expressions [-Wsign-compare]
     if (gridSize.height*gridSize.width!=ids.size())throw cv::Exception(9001, "g
ridSize != ids.size()Invalid ", "Dictionary::createMarkerMap", __FILE__, __LINE_
_);
                                       ^
C:\aruco-2.0.5\src\dictionary.cpp:284:23: warning: comparison between signed and
 unsigned integer expressions [-Wsign-compare]
         for (int i=0;i<ids.size();i++) TInfo[i].id=ids[i];
                       ^
C:\aruco-2.0.5\src\dictionary.cpp:285:13: warning: unused variable 'sizeY' [-Wun
used-variable]
         int sizeY=gridSize.height*MarkerSize+(gridSize.height-1)*MarkerDistance
;
             ^
C:\aruco-2.0.5\src\dictionary.cpp:286:13: warning: unused variable 'sizeX' [-Wun
used-variable]
         int sizeX=gridSize.width*MarkerSize+(gridSize.width-1)*MarkerDistance;
             ^
C:\aruco-2.0.5\src\dictionary.cpp:312:37: warning: comparison between signed and
 unsigned integer expressions [-Wsign-compare]
                     if (CurMarkerIdx>=ids.size()) throw cv::Exception(999," Fid
ucidalMarkers::createMarkerMapImage_ChessMarkerMap","INTERNAL ERROR. REWRITE THI
S!!",__FILE__,__LINE__);
                                     ^
C:\aruco-2.0.5\src\dictionary.cpp:300:13: warning: unused variable 'centerX' [-W
unused-variable]
         int centerX=sizeX/2;
             ^
C:\aruco-2.0.5\src\dictionary.cpp:301:13: warning: unused variable 'centerY' [-W
unused-variable]
         int centerY=sizeY/2;
             ^
C:\aruco-2.0.5\src\dictionary.cpp:303:14: warning: unused variable 'centerData'
[-Wunused-variable]
         bool centerData=true;
              ^
[ 11%] Building CXX object src/CMakeFiles/aruco.dir/ippe.cpp.obj
C:\aruco-2.0.5\src\ippe.cpp: In function 'void IPPE::IPPComputeRotations(double,
 double, double, double, double, double, cv::OutputArray, cv::OutputArray)':
C:\aruco-2.0.5\src\ippe.cpp:307:45: warning: variable 'ata10' set but not used [
-Wunused-but-set-variable]
     double a00, a01, a10,a11, ata00, ata01, ata10,ata11,b00, b01, b10,b11,binv0
0, binv01, binv10,binv11;
                                             ^
C:\aruco-2.0.5\src\ippe.cpp:311:19: warning: variable 'a' set but not used [-Wun
used-but-set-variable]
     double b0, b1,a,gamma,dtinv;
                   ^
[ 13%] Building CXX object src/CMakeFiles/aruco.dir/marker.cpp.obj
C:\aruco-2.0.5\src\marker.cpp: In member function 'void aruco::Marker::rotateXAx
is(cv::Mat&)':
C:\aruco-2.0.5\src\marker.cpp:299:22: error: 'M_PI' was not declared in this sco
pe
     float angleRad = M_PI / 2;
                      ^
src\CMakeFiles\aruco.dir\build.make:187: recipe for target 'src/CMakeFiles/aruco
.dir/marker.cpp.obj' failed
mingw32-make[2]: *** [src/CMakeFiles/aruco.dir/marker.cpp.obj] Error 1
CMakeFiles\Makefile2:116: recipe for target 'src/CMakeFiles/aruco.dir/all' faile
d
mingw32-make[1]: *** [src/CMakeFiles/aruco.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

C:\aruco-2.0.5\build>mingw32-make
Scanning dependencies of target aruco
[  2%] Building CXX object src/CMakeFiles/aruco.dir/marker.cpp.obj
C:\aruco-2.0.5\src\marker.cpp: In member function 'void aruco::Marker::rotateXAx
is(cv::Mat&)':
C:\aruco-2.0.5\src\marker.cpp:299:22: error: 'M_PI' was not declared in this sco
pe
     float angleRad = M_PI / 2;
                      ^
src\CMakeFiles\aruco.dir\build.make:187: recipe for target 'src/CMakeFiles/aruco
.dir/marker.cpp.obj' failed
mingw32-make[2]: *** [src/CMakeFiles/aruco.dir/marker.cpp.obj] Error 1
CMakeFiles\Makefile2:116: recipe for target 'src/CMakeFiles/aruco.dir/all' faile
d
mingw32-make[1]: *** [src/CMakeFiles/aruco.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

I have also tried to do it with codeblocks but I get the exact same error.

Acorn
  • 24,970
  • 5
  • 40
  • 69
guiiigz
  • 5
  • 7
  • Windows still does not provide `M_PI`?! Ask the developers for a workaround. Or use MinGW or Cygwin to compile the code. – usr1234567 Jun 14 '16 at 14:58
  • M_PI is in the math.h cpp lib so no reason for windows to don't know it! i do think that the mingw32-make commande uses MinGW to compile ;) – guiiigz Jun 14 '16 at 15:05
  • Well, kind of. http://stackoverflow.com/questions/806145/how-do-i-access-math-constants-eg-m-pi-in-visual-c-2008 – usr1234567 Jun 14 '16 at 15:15
  • probably but i dont think i should have to re-write the library so if someone have a workaround for this issue i would be very happy to hear them! (i have already tried to define M_PI to avoid the error but it brings other errors while compiling other files so it is NOT a workable solution to me) – guiiigz Jun 14 '16 at 15:30
  • 1
    Instead of linked image, save error message **as text** and paste it into the **question post itself**. Without that your question is not *searchable*, and has a little sence for Stack Overflow. – Tsyvarev Jun 14 '16 at 15:30
  • 1
    Maybe you have to ask the developers to include a fix for this case? – usr1234567 Jun 14 '16 at 20:44

1 Answers1

0

The developer has released a new version 2.0.7 fixing this issue.

What I have done to have aruco:

  • download the .zip on sourceforge
  • unzip it
  • create a build folder in aruco-2.0.7
  • open cmake-gui configure and generate
  • go into your build folder
  • open a cmd window from there
  • type mingw32-make

The library should have compiled properly.

If omp.h is missing from your compiler, find the source code on the internet and add it to mingw in MinGW\include. You should be ready to go. Don't forget to add aruco to your path & reboot.

If you are using an ide, you will have to add this library since it is an external library but it is another issue.

Finally, you might have some issues regarding c++11. I am working on it. If someone knows how to allow it on mingw (I haven't find any understandable explanation so far)

Elydasian
  • 2,016
  • 5
  • 23
  • 41
guiiigz
  • 5
  • 7