Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
3.2 KiB

  1. // ForceLib.h -- Forces correct link order when mixing C Run-Time
  2. // (CRT) and MFC libraries
  3. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  4. // 1998. This computer program includes Confidential, Proprietary
  5. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  6. // use, disclosure, and/or reproduction is prohibited unless authorized
  7. // in writing. All Rights Reserved.
  8. #if !defined(SLBCSP_FORCELIB_H)
  9. #define SLBCSP_FORCELIB_H
  10. // From MSDN Knowledge Base article ID: Q148652, when mixing the CRT
  11. // and MFC, the linker may complain about symbols already defined in
  12. // other CRT/MFC modules. One fix is to always include Afx.h directly
  13. // or indirectly through StdAfx.h but if the module doesn't use MFC,
  14. // then this header file can be used to force the right link order.
  15. // This head file was created from ..\MsDev\MFC\Include\Afx.h
  16. #ifndef _AFX_NOFORCE_LIBS
  17. /////////////////////////////////////////////////////////////////////////////
  18. // Win32 libraries
  19. #ifndef _AFXDLL
  20. #ifndef _UNICODE
  21. #ifdef _DEBUG
  22. #pragma comment(lib, "nafxcwd.lib")
  23. #else
  24. #pragma comment(lib, "nafxcw.lib")
  25. #endif
  26. #else
  27. #ifdef _DEBUG
  28. #pragma comment(lib, "uafxcwd.lib")
  29. #else
  30. #pragma comment(lib, "uafxcw.lib")
  31. #endif
  32. #endif
  33. #else
  34. #ifndef _UNICODE
  35. #ifdef _DEBUG
  36. #pragma comment(lib, "mfc42d.lib")
  37. #pragma comment(lib, "mfcs42d.lib")
  38. #else
  39. #pragma comment(lib, "mfc42.lib")
  40. #pragma comment(lib, "mfcs42.lib")
  41. #endif
  42. #else
  43. #ifdef _DEBUG
  44. #pragma comment(lib, "mfc42ud.lib")
  45. #pragma comment(lib, "mfcs42ud.lib")
  46. #else
  47. #pragma comment(lib, "mfc42u.lib")
  48. #pragma comment(lib, "mfcs42u.lib")
  49. #endif
  50. #endif
  51. #endif
  52. #ifdef _DLL
  53. #if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
  54. #pragma comment(lib, "msvcrtd.lib")
  55. #else
  56. #pragma comment(lib, "msvcrt.lib")
  57. #endif
  58. #else
  59. #ifdef _MT
  60. #if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
  61. #pragma comment(lib, "libcmtd.lib")
  62. #else
  63. #pragma comment(lib, "libcmt.lib")
  64. #endif
  65. #else
  66. #if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
  67. #pragma comment(lib, "libcd.lib")
  68. #else
  69. #pragma comment(lib, "libc.lib")
  70. #endif
  71. #endif
  72. #endif
  73. #pragma comment(lib, "kernel32.lib")
  74. #pragma comment(lib, "user32.lib")
  75. #pragma comment(lib, "gdi32.lib")
  76. #pragma comment(lib, "comdlg32.lib")
  77. #pragma comment(lib, "winspool.lib")
  78. #pragma comment(lib, "advapi32.lib")
  79. #pragma comment(lib, "shell32.lib")
  80. #pragma comment(lib, "comctl32.lib")
  81. // force inclusion of NOLIB.OBJ for /disallowlib directives
  82. #pragma comment(linker, "/include:__afxForceEXCLUDE")
  83. // force inclusion of DLLMODUL.OBJ for _USRDLL
  84. #ifdef _USRDLL
  85. #pragma comment(linker, "/include:__afxForceUSRDLL")
  86. #endif
  87. // force inclusion of STDAFX.OBJ for precompiled types
  88. #ifdef _AFXDLL
  89. #pragma comment(linker, "/include:__afxForceSTDAFX")
  90. #endif
  91. #endif //!_AFX_NOFORCE_LIBS
  92. #endif // !defined(SLBCSP_FORCELIB_H)