c++ - Simple OpenCV program won't run; given no errors. What now? -
i'm working on term project school , plan use opencv. i've spent past day or battling include/link errors (mostly because of dumb mistakes) , have working. or thought.
i have simple program, looks this:
#include <highgui.h> int main() { cvnamedwindow("window", cv_window_autosize); cvwaitkey(0); return 0; }
no errors appear in eclipse, , bold-faced / looking should library functions (can't remember proper formatting name called). when compile it, succeeds. no errors. when run this, nothing happens. , it's @ point i'm stuck.
i'm using opencv @ work , modeled setup @ home accordingly (nearly identically actually). include paths, library paths, , libraries added in project eclipse (at least, w.r.t work setup). dll's in same folder executable.
any ideas why doesn't run? (the window doesn't display, instantly terminates)
i should mention i'm using eclipse (helios), mingw, windows 7, , opencv 2.3.
cheers.
try compiling command prompt, run executable command prompt, see happens. how compile
g++ -o main.exe main.cpp -i"c:\opencv2.1\include\opencv" -l"c:\opencv2.1\lib" -lcxcore210 -lcv210 -lhighgui210 -lcvaux210 -lml210
note: have used opencv 2.1. set 1 accordingly. , have added opencv bin folder path
, makes easier find dll files executable file.
Comments
Post a Comment