Ask Your Question

conductor's profile - activity

2016-11-28 21:29:29 -0500 commented question printf("\n") statement in client code cause linking error

so mote it be :)

with not linking "libopencv_ts2413.a" it works properly.

2016-11-28 03:31:09 -0500 received badge  Editor (source)
2016-11-27 13:38:50 -0500 asked a question printf("\n") statement in client code cause linking error

this works fine:

#include <stdio.h>
int main()
{
  printf("hello");
  return 0;
}

but when I try do this,

#include <stdio.h>
int main()
{
  printf("\n");
  return 0;
}

I have linking error:

C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_ts2413.a(ts_perf.cpp.obj):ts_perf.cpp:(.text$_ZN12_GLOBAL__N_115PerfEnvironment8TearDownEv+0xb): undefined reference to 'cv::setNumThreads(int)'
C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_ts2413.a(ts_perf.cpp.obj):ts_perf.cpp:(.text$_ZN4perf8TestBase5SetUpEv+0x7): undefined reference to `cv::theRNG()'

I compile main.cpp in this way:

mingw32-g++.exe -Wall -fexceptions -g -IC:\opencv\build\include -IC:\opencv\dep\eigen-eigen-26667be4f70b -c "E:\08projects\C Projects\codeblocks_tests\test5\main.cpp" -o obj\Debug\main.o

And linking by this way:

mingw32-g++.exe  -o bin\Debug\test5.exe obj\Debug\main.o   C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_calib3d2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_contrib2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_core2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_features2d2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_flann2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_gpu2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_highgui2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_imgproc2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_legacy2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_ml2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_nonfree2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_objdetect2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_ocl2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_photo2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_stitching2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_superres2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_ts2413.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_video2413.dll.a C:\opencv\build_dlls_2\install\x86\mingw\lib\libopencv_videostab2413.dll.a

What the matter? My config is Windows 7 x64, openCV 2.4.13, TDM-GCC x32, dll I built by myself.