-
AVIFile linker error
Hello,
I was wondering if anybody could help me out with an error I always get:
Trying to build the simple project below I always get "[Linker error] undefined reference to `AVIFileInit@0'"
I am Using Dev-C++ and added the libraries vfw32.lib and winmm.lib.
Code:
#include <windows.h>
#include <iostream>
#include "vfw.h"
int main(int argc, char *argv[]){
AVIFileInit();
system("PAUSE");
return EXIT_SUCCESS;
}
I would really appreciate if someone could give me a short hint,
best regards,
slapy
-
>>added the libraries vfw32.lib and winmm.lib<<
How exactly did you do this and what library names did you use?
-
I opened project->project options->parameters->"Add libraries or Object" then I looked for the right name from my "Microsoft Platform SDK SP1 2003" in folder "Lib"
did I forget anything? is that wrong?
-
Instead of adding the ms libs, you should add the the ones that come with your compiler. Just type '-lvfw32' in the 'linker' field (you can use the 'add libraries or objects' option, too, but look for libvfw32.a in the lib directory of your dev-cpp/mingw installation directory). For that example you don't need libwinmm.a (winmm.lib).
-
thank you, that is actually working but how do you now that it is -lvfw32.lib instead of -vfw32.lib?
thanks, again!
slapy
-
I read the manual. Here's one example: http://www.cs.utah.edu/dept/old/texi...c_5.html#SEC19
Running ld --help from a command prompt is also handy(ld is the linker). You can do the same with the other tools in the 'bin' directory of your dev-cpp/mingw installation; piping the output to a text file gives you a handy lookup for various switches and arguments, eg ld --help >ld.txt.
Lots of manuals in chm format here, too:
http://htmlhelp.berlios.de/books/chm.php
-
that is, again, very helpful, thank you!
slapy