Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Prod-UIS in MFC with static linked librrary Collapse All
Subject Author Date
Sahil Tha Aug 13, 2004 - 9:00 PM

Hi


Prof-UIS samples default configuration is to have MFC as Shared Library. How can I enable MFC in static library? First of all, I want to see the size of entire executable with MFC libraries.


I tried changing project properties for ProfUIS_Controls, profuisdll and profuislib.. but when I build it gives a linking error: ProfUIS_Controls fatal error LNK1104: cannot open file ’ProfUIS225snd.lib’

I see that ExtMfcDef.h defines the lib name based on some flags, but ’ProfUIS225snd.lib’ is never generated, its always ’ProfUIS225nd.lib’


What is the correct way to generate Apps with statically linked MFC libraries with ProfUIs?


Thanks
Sahil


 

Sahil Tha Aug 13, 2004 - 9:50 PM

I tried getting rid of _AFXDLL as suggesteds in the help, but I still havent managed to build the project.


I’m trying to build ProfUIS_Controls, profuisdll and profuislib.
In ansi debug configuration I went into project settings > Resources > General and removed _AFXDLL for ProfUIS_Controls and profuisdll. I also changed in Configuration Properties > General tab to Use MFC in a Static Library for all three projects.


profuislib does not give me a Resources tab in Project settings and I cant find _AFXDLL defined anywhere else.


Unfortunately, when I build it it still complains:


C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxver_.h(139): fatal error C1189: #error :  Please use the /MD switch for _AFXDLL builds


ProfUIS_Controls fatal error LNK1104: cannot open file ’ProfUIS225snd.lib’


 

Technical Support Aug 14, 2004 - 10:11 AM

To link your app with MFC/Prof-UIS static libraries, you just need to set the "Use MFC As Static Library" option in the project settings. Please note, some of sample applications (including Prof-UIS-Controls) can be compiled only with DLL libraries because only dynamic libraries include several resource-based features such as the color picker dialog and customization forms.

Sahil Tha Aug 14, 2004 - 2:57 PM

I tried setting ProfUIS-Controls to use mfc in a static library, but when I build it gives error saying "cannot open file ’ProfUIS225snd.lib’." So I tried setting ’use mfc in a static library’ in all three projects; ProfUIS-Controls, produidll and profuilib, but I get :


 fatal error C1189: #error :  Please use the /MD switch for _AFXDLL builds
fatal error LNK1104: cannot open file ’ProfUIS225snd.lib’

I also tried doing this with few other projects instead of ProfUIS-Controls as the starting project, but it gives same results.


What I need to do it port an app made using Prof-UIS onto another machine that does not have mfc libraries. If I can do that then ProfUIs will be an invaluable UI library for me. I dont need color picker or customization forms.



 

Technical Support Aug 15, 2004 - 4:50 AM

We recommend you to visit the following web pages:

http://www.prof-uis.com/ArticleRead.aspx?AID=220#@lt;br />
http://www.prof-uis.com/ArticleRead.aspx?AID=141#@lt;br />

The will help you find out that ProfUIS225snd.lib file is produced by the "Static MBCS Debug" configuration of the "profuislib" project. Please compile this library configuration first before compiling any other static-library-based samples and/or your applications.

You have chosen the absolutely correct build configuration. Your application will include both MFC and Prof-UIS libraries as part of the generated EXE image. But you should note that not all features are included to the static Prof-UIS library. For instance, you will not be able to use the color picker dialog because it is based on the dialog resource that is not available in static builds.