LNK1266 error

kaveh rahimi 61 Reputation points
2021-09-12T19:42:21.68+00:00

Hi , I debug my project and I receive 'LNK1266' error my consoleapplication6 is:
// 2004.05.28, 2004.10.20, 2005.01.08, 2005.03.25, 2005.04.28, 2005.07.18, 2005.07.28, 2005.09.19, 2007.12.19, 2008.10.15
//****************************************
//** Copyright (C) W.ch 1999-2008 **
//** Web: http://www.winchiphead.com **
//****************************************
//** DLL for USB interface chip CH341 **
//** C, VC5.0 **
//****************************************
//
// USB×ÜÏß½Ó¿ÚоƬCH341²¢¿ÚÓ¦Óòã½Ó¿Ú¿â V2.1
// ÄϾ©Çߺãµç×ÓÓÐÏÞ¹«Ë¾ ×÷Õß: W.ch 2008.10
// CH341-DLL V2.1
// ÔËÐл·¾³: Windows 98/ME, Windows 2000/XP
// support USB chip: CH341, CH341A
// USB => Parallel, I2C, SPI, JTAG ...
//

pragma comment(lib, "CH341DLL.LIB")

include <windows.h>

ifndef _CH341_DLL_H

define _CH341_DLL_H

ifdef __cplusplus

extern "C" {

endif

define mOFFSET( s, m ) ( (ULONG) & ( ( ( s * ) 0 ) -> m ) ) // ¶¨Òå»ñÈ¡½á¹¹³ÉÔ±Ïà¶ÔÆ«ÒƵØÖ·µÄºê

ifndef max

define max( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) // ½Ï´óÖµ

endif

ifndef min

define min( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) // ½ÏСֵ

endif

ifdef ExAllocatePool

undef ExAllocatePool // ɾ³ý´øTAGµÄÄÚ´æ·ÖÅä

endif

ifndef NTSTATUS

typedef     long    NTSTATUS;                   // ·µ»Ø״̬

endif

typedef struct  _USB_SETUP_PKT {                // USB¿ØÖÆ´«ÊäµÄ½¨Á¢½×¶ÎµÄÊý¾ÝÇëÇó°ü½á¹¹
    unsigned char           mUspReqType;                // 00H ÇëÇóÀàÐÍ
    unsigned char           mUspRequest;                // 01H ÇëÇó´úÂë
    union {
        struct {
            unsigned char   mUspValueLow;               // 02H Öµ²ÎÊýµÍ×Ö½Ú
            unsigned char   mUspValueHigh;              // 03H Öµ²ÎÊý¸ß×Ö½Ú
        };

And the header file I use is:
// 2004.05.28, 2004.10.20, 2005.01.08, 2005.03.25, 2005.04.28, 2005.07.18, 2005.07.28, 2005.09.19, 2007.12.19, 2008.10.15
//****************************************
//** Copyright (C) W.ch 1999-2008 **
//** Web: http://www.winchiphead.com **
//****************************************
//** DLL for USB interface chip CH341 **
//** C, VC5.0 **
//****************************************
//
// USB×ÜÏß½Ó¿ÚоƬCH341²¢¿ÚÓ¦Óòã½Ó¿Ú¿â V2.1
// ÄϾ©Çߺãµç×ÓÓÐÏÞ¹«Ë¾ ×÷Õß: W.ch 2008.10
// CH341-DLL V2.1
// ÔËÐл·¾³: Windows 98/ME, Windows 2000/XP
// support USB chip: CH341, CH341A
// USB => Parallel, I2C, SPI, JTAG ...
//

include <windows.h>

ifndef _CH341_DLL_H

define _CH341_DLL_H

ifdef __cplusplus

extern "C" {

endif

define mOFFSET( s, m ) ( (ULONG) & ( ( ( s * ) 0 ) -> m ) ) // ¶¨Òå»ñÈ¡½á¹¹³ÉÔ±Ïà¶ÔÆ«ÒƵØÖ·µÄºê

ifndef max

define max( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) // ½Ï´óÖµ

endif

ifndef min

define min( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) // ½ÏСֵ

endif

ifdef ExAllocatePool

undef ExAllocatePool // ɾ³ý´øTAGµÄÄÚ´æ·ÖÅä

endif

ifndef NTSTATUS

typedef     LONG    NTSTATUS;                   // ·µ»Ø״̬

endif

How can I fix my problem .
Please help
Thanks

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,743 questions
{count} votes

1 answer

Sort by: Most helpful
  1. YujianYao-MSFT 4,291 Reputation points Microsoft Vendor
    2021-09-20T09:53:45.613+00:00

    Hi,

    Profile Guided Optimizations is a very advanced function of C++. I suggest that you should check the optimization settings of the project and enable PGO (Profile Guided Optimizations) in the compiler and linker.

    You can use /GENPROFILE or /FASTGENPROFILE to specify the linker to generate .pgd files to support Profile Guided Optimization (PGO).

    Best Regards,

    Elya


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.