Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. After including #include <atlbase.h> I am getting error C2632

After including #include <atlbase.h> I am getting error C2632

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    ptr_Electron
    wrote on last edited by
    #1

    After including

    #include

    . Please suggest 2>C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\rpcndr.h(154) : warning C4114: same type qualifier used more than once 2>C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\rpcndr.h(154) : error C2632: 'char' followed by 'char' is illegal 2>C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\rpcndr.h(154) : warning C4091: 'typedef ' : ignored on left of 'unsigned char' when no variable is declared

    J 1 Reply Last reply
    0
    • P ptr_Electron

      After including

      #include

      . Please suggest 2>C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\rpcndr.h(154) : warning C4114: same type qualifier used more than once 2>C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\rpcndr.h(154) : error C2632: 'char' followed by 'char' is illegal 2>C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\rpcndr.h(154) : warning C4091: 'typedef ' : ignored on left of 'unsigned char' when no variable is declared

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      Such things may happen when including header files in the wrong order, required header files has not been loaded, or are skipped due to exclusions. Because we don't know the other headers file that might be involved, it can't be answered for now. A common problem is the inclusion of winsock2.h. This must be included before windows.h. I mention it here beacuse RPC is network related. If this does not help you should try to find out the correct order by inspecting the header file inclusion tree. You can generate an include file tree by editing your project settings (Configuration Properties - C/C++ - Advanced - Show Includes). Inspect the line of error (154 in rpcnhdr.h) to know which definitions trigger the error. Then try to find these definitions in header files included before that.

      P 1 Reply Last reply
      0
      • J Jochen Arndt

        Such things may happen when including header files in the wrong order, required header files has not been loaded, or are skipped due to exclusions. Because we don't know the other headers file that might be involved, it can't be answered for now. A common problem is the inclusion of winsock2.h. This must be included before windows.h. I mention it here beacuse RPC is network related. If this does not help you should try to find out the correct order by inspecting the header file inclusion tree. You can generate an include file tree by editing your project settings (Configuration Properties - C/C++ - Advanced - Show Includes). Inspect the line of error (154 in rpcnhdr.h) to know which definitions trigger the error. Then try to find these definitions in header files included before that.

        P Offline
        P Offline
        ptr_Electron
        wrote on last edited by
        #3

        Thanks you for response. Basically I was trying to use ATL in non-ATL application.. Please advise the line 154 in rpcnhdr.h is

        typedef unsigned char byte;

        J 1 Reply Last reply
        0
        • P ptr_Electron

          Thanks you for response. Basically I was trying to use ATL in non-ATL application.. Please advise the line 154 in rpcnhdr.h is

          typedef unsigned char byte;

          J Offline
          J Offline
          Jochen Arndt
          wrote on last edited by
          #4

          When you use ATL, then your application is not a non-ATL one. The first error message is "same type qualifier used more than once". So byte has been already defined. The next one "'char' followed by 'char' is illegal" indicates that byte has been probably defined using a #define statement so that the compiler sees

          typedef unsigned char char;

          The third error is just based on the previous one. So the goal is to find the previous definition of byte and check if the definition can be suppressed or the header file containing it might be included later. That might be some work because atlbase.h includes a lot of other files. I did a quick search but did not found it. But you should better perform this search with your files because they may change with the Visual Studi and the SDK versions.

          P 1 Reply Last reply
          0
          • J Jochen Arndt

            When you use ATL, then your application is not a non-ATL one. The first error message is "same type qualifier used more than once". So byte has been already defined. The next one "'char' followed by 'char' is illegal" indicates that byte has been probably defined using a #define statement so that the compiler sees

            typedef unsigned char char;

            The third error is just based on the previous one. So the goal is to find the previous definition of byte and check if the definition can be suppressed or the header file containing it might be included later. That might be some work because atlbase.h includes a lot of other files. I did a quick search but did not found it. But you should better perform this search with your files because they may change with the Visual Studi and the SDK versions.

            P Offline
            P Offline
            ptr_Electron
            wrote on last edited by
            #5

            Thanks for response. Actual I had a non ATL C++ application, to which I need to add Text to speech(https://msdn.microsoft.com/en-us/library/jj127898.aspx[^]), and hence I was trying to add

            #include extern CComModule _Module;
            #include

            And there by started with this issue.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups