Print Page | Close Window

Static VS Dynamic linking

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=9346
Printed Date: 07 June 2025 at 6:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Static VS Dynamic linking
Posted By: Usha
Subject: Static VS Dynamic linking
Date Posted: 18 January 2008 at 4:48am
We are using XtremeToolkitPro_v10.3.1 and I am using classes CXTShellList and CXTShellTree to simulate Windows Explorer folder view.
When I statically link with CodeJock I get lot of assertions, esp. resource related.
 
Example :
File XTHeaderCtrl.cpp, Line 585,
 
CMenu menu;
VERIFY(XTPResourceManager()->LoadMenu(&menu, XT_IDM_POPUP))
 
This fails.
 
If I link dynamically, then I do not see these problems.
 
All I did was defined the following in my header file to make it link statically.
 
#define _XTP_STATICLINK
#include <XTToolkitPro.h> // Codejock Software Components
 
Am I missing anything? Can someone please explain.
 
thanks
 
 



Replies:
Posted By: mgampi
Date Posted: 18 January 2008 at 5:45am
Hi;
In Codejocks users help you find a section about statically linking...
Here's the solution:
 
Question:
How do I statically link with Xtreme Toolkit Pro and when statically linked to MFC?
Answer:
Follow these steps to statically link with the Xtreme Toolkit Professional Version:
  1. Change your project settings to “Use MFC in a Static Library”. This is found on the “General” tab in your project settings dialog.
  2. Change your “C/C++ Code Generation” to use either “Multithreaded” or “Debug Multithreaded” run-time library. For release builds use the “Multithreaded” (non DLL) run-time library. For debug builds use “Debug Multithreaded” (non DLL) run-time library.
  3. Some libraries are incompatible when statically linking to MFC. On the link tab under input settings you will need to ignore the following libraries.
    For “Multithreaded” add the following to the “Ignore libraries” list:
    libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib
    For “Debug Multithreaded” add the following to the “Ignore libraries” list:
    libc.lib, libcmt.lib, msvcrt.lib, libcmtd.lib, msvcrtd.lib
    See Linker Tools Warning LNK4098 in MSDN for more details.
  4. Add the following line to your application's .rc2 file. This will link in the toolkit resources so they are available to your application.
    Xtreme Toolkit Pro:
    #include <XTToolkitPro.rc>
    
    Xtreme Suite:
    #include <XTSuitePro.rc>


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net