Link problem (using avifile)
-
Again some newbie-problems ;P I want to use the AVIFile API in my c++ project. Including the "Vfw.h" header file is not a problem, the various datatypes such as PAVIFILE can be used. But when the project tries to link to the windows dll (mswfv32.dll), the linker says:
Linking...
AviKaka.obj : error LNK2001: unresolved external symbol _AVIFileInit@0
AviKaka.obj : error LNK2001: unresolved external symbol _AVIFileExit@0
Debug/MultiKaka.exe : fatal error LNK1120: 2 unresolved externalsI've already tried to add the dll manualy in project->settings->debug->additional_dlls So, I guess this is probably a how-to-call-a-dll-topic :confused: Inluding the headerfile is not enough :confused:
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
-
Again some newbie-problems ;P I want to use the AVIFile API in my c++ project. Including the "Vfw.h" header file is not a problem, the various datatypes such as PAVIFILE can be used. But when the project tries to link to the windows dll (mswfv32.dll), the linker says:
Linking...
AviKaka.obj : error LNK2001: unresolved external symbol _AVIFileInit@0
AviKaka.obj : error LNK2001: unresolved external symbol _AVIFileExit@0
Debug/MultiKaka.exe : fatal error LNK1120: 2 unresolved externalsI've already tried to add the dll manualy in project->settings->debug->additional_dlls So, I guess this is probably a how-to-call-a-dll-topic :confused: Inluding the headerfile is not enough :confused:
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
-
Again some newbie-problems ;P I want to use the AVIFile API in my c++ project. Including the "Vfw.h" header file is not a problem, the various datatypes such as PAVIFILE can be used. But when the project tries to link to the windows dll (mswfv32.dll), the linker says:
Linking...
AviKaka.obj : error LNK2001: unresolved external symbol _AVIFileInit@0
AviKaka.obj : error LNK2001: unresolved external symbol _AVIFileExit@0
Debug/MultiKaka.exe : fatal error LNK1120: 2 unresolved externalsI've already tried to add the dll manualy in project->settings->debug->additional_dlls So, I guess this is probably a how-to-call-a-dll-topic :confused: Inluding the headerfile is not enough :confused:
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
There are two ways to use a DLL: 1) static use You need a header-file and a lib-file added to your project. Than you can directly call the functions declared in the header file. (Due to the linker errors it seems the lib-file is missing in your project, adding only the dll won`t work) 2) dynamic use You only need the dll-file. From your source you load the dll by calling LoadLibrary() and get the function pointers by calling GetProcAdress(). So far ... RockNix/// ------------------------------------ www.klangwerker.de Need some articles about Threading, Subclassing, Double Buffering ? Go for it ... Look out for free Win32 Serial Communication Module for VC++ or Borland C++ Builder Visit us on www.klangwerker.de ------------------------------------
-
Yep, source found on msdn library.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
-
There are two ways to use a DLL: 1) static use You need a header-file and a lib-file added to your project. Than you can directly call the functions declared in the header file. (Due to the linker errors it seems the lib-file is missing in your project, adding only the dll won`t work) 2) dynamic use You only need the dll-file. From your source you load the dll by calling LoadLibrary() and get the function pointers by calling GetProcAdress(). So far ... RockNix/// ------------------------------------ www.klangwerker.de Need some articles about Threading, Subclassing, Double Buffering ? Go for it ... Look out for free Win32 Serial Communication Module for VC++ or Borland C++ Builder Visit us on www.klangwerker.de ------------------------------------
the lib-file is not missing. checked it. Is there a way to view the dll member functions, (not the headerfile)? maybe they've changed. If I use it dynamicaly, can I use the dll-functions more or less in the same manner?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
-
the lib-file is not missing. checked it. Is there a way to view the dll member functions, (not the headerfile)? maybe they've changed. If I use it dynamicaly, can I use the dll-functions more or less in the same manner?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
frisco wrote: Is there a way to view the dll member functions Use the depends.exe tool comes with your VC++. Maxwell Chen No code is good code.
-
the lib-file is not missing. checked it. Is there a way to view the dll member functions, (not the headerfile)? maybe they've changed. If I use it dynamicaly, can I use the dll-functions more or less in the same manner?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
Within Visual Studio 6.0 there is a tool called "DUMPBIN". Copy this to your DLL Path and type the following line from a console: dumpbin /exports yours.dll A list of the exported functions should be shown. So far ... RockNix/// ------------------------------------ www.klangwerker.de Need some articles about Threading, Subclassing, Double Buffering ? Go for it ... Look out for free Win32 Serial Communication Module for VC++ or Borland C++ Builder Visit us on www.klangwerker.de ------------------------------------
-
There are two ways to use a DLL: 1) static use You need a header-file and a lib-file added to your project. Than you can directly call the functions declared in the header file. (Due to the linker errors it seems the lib-file is missing in your project, adding only the dll won`t work) 2) dynamic use You only need the dll-file. From your source you load the dll by calling LoadLibrary() and get the function pointers by calling GetProcAdress(). So far ... RockNix/// ------------------------------------ www.klangwerker.de Need some articles about Threading, Subclassing, Double Buffering ? Go for it ... Look out for free Win32 Serial Communication Module for VC++ or Borland C++ Builder Visit us on www.klangwerker.de ------------------------------------
I've included the Vfw.h header file, but the lib-file is called vfw32.lib and its in Microsoft Visual Studio\VC98\LIB Does the added 32 cause any harm here? The lib dir is good?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
-
Again some newbie-problems ;P I want to use the AVIFile API in my c++ project. Including the "Vfw.h" header file is not a problem, the various datatypes such as PAVIFILE can be used. But when the project tries to link to the windows dll (mswfv32.dll), the linker says:
Linking...
AviKaka.obj : error LNK2001: unresolved external symbol _AVIFileInit@0
AviKaka.obj : error LNK2001: unresolved external symbol _AVIFileExit@0
Debug/MultiKaka.exe : fatal error LNK1120: 2 unresolved externalsI've already tried to add the dll manualy in project->settings->debug->additional_dlls So, I guess this is probably a how-to-call-a-dll-topic :confused: Inluding the headerfile is not enough :confused:
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
You need to make sure the Vfw32.lib is included in the ProjectSettings->Link->Input->Object/library modules properties. Michael :-) Communication is the first step towards enlightenment.
-
There are two ways to use a DLL: 1) static use You need a header-file and a lib-file added to your project. Than you can directly call the functions declared in the header file. (Due to the linker errors it seems the lib-file is missing in your project, adding only the dll won`t work) 2) dynamic use You only need the dll-file. From your source you load the dll by calling LoadLibrary() and get the function pointers by calling GetProcAdress(). So far ... RockNix/// ------------------------------------ www.klangwerker.de Need some articles about Threading, Subclassing, Double Buffering ? Go for it ... Look out for free Win32 Serial Communication Module for VC++ or Borland C++ Builder Visit us on www.klangwerker.de ------------------------------------
And I've checked the lib for _AVIFileInit@0 and it's in it, allright. I'm missing something here. :(
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
-
You need to make sure the Vfw32.lib is included in the ProjectSettings->Link->Input->Object/library modules properties. Michael :-) Communication is the first step towards enlightenment.
That's it, allright! :-D I thought that the linker uses the standard libraries in vc98\lib directory by default. But you have to include them on the link-tab. I did that only for the debug-tab. Mike, you're the man ;)
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
-
the lib-file is not missing. checked it. Is there a way to view the dll member functions, (not the headerfile)? maybe they've changed. If I use it dynamicaly, can I use the dll-functions more or less in the same manner?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
X| Bluute tette! X|
Add vfw32.lib in Project|Settings|Link, Object/Library modules. It's not a static lib but an import lib (you can tell because it contains only names). Your exe will link at runtime to the right dll and more importantly will compile ok too. tried just now with this fantastic test program: #include #include int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int) { AVIFileInit(); AVIFileExit(); return 0; } (I think you can only do the thing with putting libs into your project with static libraries, which contain code as well as import names, but I'm not sure.)