PDA

View Full Version : Using IC-3.0 librairie with MFC as static Lib



vdaanen
July 25, 2007, 12:17:45
Hi,

I MUST use MFC as static lib in my projects.


On one hand, if I set the project preferences to "Use MFc as a static lib", I get this error:

c:\program files\the imaging source europe gmbh\ic imaging control 3.0\classlib\include\udshl_lnk.h(62) : fatal error C1189: #error : "Wrong C Runtime specified. The ICImagingControl library requires you to link to the Multithreaded DLL Runtime"


On the other hand, if I set "Use MFC in a shared DLL", I got thousand of errors because of redefinition of symbol in "static" MFC libraires.

Is there a solution ? or should I start to search for another frame grabber :(

Vince

Stefan Geissler
July 25, 2007, 13:04:17
Vincent,

If you use other libraries in your project, that use MFC in a static library, then you will get a problem.

vdaanen
July 25, 2007, 13:38:17
Vincent,

If you use other libraries in your project, that use MFC in a static library, then you will get a problem.

You're right Stefan, I have a problem !

Is there a way to shortcut the checks performed in "udshl_lnk.h" ?
I remember I used IC-2.0 with static library without problems !

By the way, why does ImagingSource not provide static librairies to use the grabber ?

V

Stefan Geissler
July 26, 2007, 09:13:20
Vincent,

You edit the "udshl_lnk.h" and remove all the lines, that are disturbing you. They are only pragmas for the linker. You can, and you may alread have, added the lib files and library pathes and include pathes to your project. Thus it would be no problem if the "udshl_lnk.h" is empty.

But this will not fix your static library problem anyway.


By the way, why does ImagingSource not provide static librairies to use the grabber ?
Good question, but I guess, there was a reason.

vdaanen
July 26, 2007, 09:38:28
Hi Stefa,

finally, I found a way to make it works. But I do not understand what is passing 'underground'.

Instead of linking with the 'big' customer library I must use, I linked against smaller ones which are part of the big one. It seems that the big library embedded some MFC static lib parts whereas small ones don't :confused:

Anyway, it works and that's great !!

V

Stefan Geissler
July 26, 2007, 09:48:04
Vincent,

If you use a dynmic instead of a static DLL, then your main application does not need all files and libraries. I guess, the small customer library does not link MFC static, thus the errors were gone.

At least, the last solution I would have for you would be a DLL that wraps the IC Classlibrary. This DLL is small, does not need MFC and DirectShow SDK, but is not as power full as the classlibrary itself. It it is able to handle video capture devices, capture images and returns a unsigned char* pointer to the last snapped image.

vdaanen
July 26, 2007, 19:01:09
Vincent,

If you use a dynmic instead of a static DLL, then your main application does not need all files and libraries. I guess, the small customer library does not link MFC static, thus the errors were gone.

At least, the last solution I would have for you would be a DLL that wraps the IC Classlibrary. This DLL is small, does not need MFC and DirectShow SDK, but is not as power full as the classlibrary itself. It it is able to handle video capture devices, capture images and returns a unsigned char* pointer to the last snapped image.

Hi Stefan,

I will keep that alive in a part of my head.
If I have others problems a day, I would wake-up this thread.

V