c++ - Segmentation fault in AVIFileInit() -


i’m using code::blocks gcc compiler on xp. call avifileinit() in following test code causes segmentation fault:

#include <windows.h> #include <stdio.h> #include <vfw.h>  int main() {    printf("%s", "avi init...\n\n");     avifileinit(); /// <-- crashes here!!!     printf("%s", "avi exit...\n\n");     avifileexit();     printf("%s", "return...\n\n");     return 0; } 

i can’t find cause or solution problem. appreciated.

well i’ve solved problem, else having similar issue, thought i’d post answer:

omit “.lib” filename in linker settings. (in case, write “vfw32”, not “vfw32.lib”.)

that way, won’t complain can’t find file, won’t have waste lot of time looking in installation folder before giving , linking version of library didn’t come compiler , isn’t compatible.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -