Skip to content

Error to build OpenCV 4.0.1 in Debug mode from source  #13546

Open
@nikitaverbis

Description

@nikitaverbis
System information (version)
  • OpenCV => 4.0.1
  • Operating System / Platform => Windows 10 64 Bit
  • Compiler => MinGW 7.3.0 x64 (from last Qt 5.12)
  • CMake => 3.13.2
    -Build Type => Source (4.0.1 from https://github.com/opencv/opencv/releases)
Detailed description

Can not to build OpenCV 4.0.1 in Debug mode.
An error is raised during compilation:
Fatal error: can't close CMakeFiles\opencv_perf_core.dir\perf\opencl\perf_arithm.cpp.obj: File too big
Which probably can be solved with flags for gcc: -Wa,-mbig-obj.
123

Steps to reproduce
  1. Install Qt 5.12 with Tools: MinGW 7.3.0
  2. Install CMake 3.13.2
  3. Run CMake and set path to opencv source code and path to build binaries and press Configure button.
  4. In CMAKE group set CMAKE_BUILD_TYPE to Debug.
  5. Press Generate button.
  6. Open CMD and change dir to opencv "build binaries" folder from step 3 and execute mingw32-make.exe -j8 (Example: D:\Qt\Tools\mingw730_64\bin\mingw32-make.exe -j8).
Error
 [ 28%] Built target pch_Generate_opencv_highgui
 [ 28%] Built target opencv_highgui
 [ 28%] Built target opencv_ts_pch_dephelp
 [ 28%] Built target pch_Generate_opencv_ts
 [ 29%] Built target opencv_ts
 [ 29%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/opencl/perf_arithm.cpp.obj
 D:/Qt/Tools/mingw730_64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/as.exe: CMakeFiles\opencv_perf_core.dir\perf\opencl\perf_arithm.cpp.obj: too many sections (37620)
 C:\Users\User\AppData\Local\Temp\ccWlqdOA.s: Assembler messages:
 C:\Users\User\AppData\Local\Temp\ccWlqdOA.s: Fatal error: can't fill 1 byte in section .rdata$_ZStL19piecewise_construct of CMakeFiles\opencv_perf_core.dir\perf\opencl\perf_arithm.cpp.obj: 'File too big'
 D:/Qt/Tools/mingw730_64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/as.exe: CMakeFiles\opencv_perf_core.dir\perf\opencl\perf_arithm.cpp.obj: too many sections (37620)
 C:\Users\User\AppData\Local\Temp\ccWlqdOA.s: Fatal error: can't close CMakeFiles\opencv_perf_core.dir\perf\opencl\perf_arithm.cpp.obj: File too big
 mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_perf_core.dir\build.make:77: modules/core/CMakeFiles/opencv_perf_core.dir/perf/opencl/perf_arithm.cpp.obj] Error 1
 mingw32-make[1]: *** [CMakeFiles\Makefile2:2712: modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
 mingw32-make: *** [Makefile:162: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions