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. why compile occur error???

why compile occur error???

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 Posts 4 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.
  • D Offline
    D Offline
    don7cry
    wrote on last edited by
    #1

    I had include header file in stdafx.h and set precompiled headers is stdafx.h but when i compile my project it still error some variable not defined. somebody can help me? thanks Nho'c Ti`

    C 1 Reply Last reply
    0
    • D don7cry

      I had include header file in stdafx.h and set precompiled headers is stdafx.h but when i compile my project it still error some variable not defined. somebody can help me? thanks Nho'c Ti`

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      I think you need to supply more information. To start with: What compiler error occurred?


      "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!

      D 1 Reply Last reply
      0
      • C Colin Angus Mackay

        I think you need to supply more information. To start with: What compiler error occurred?


        "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!

        D Offline
        D Offline
        don7cry
        wrote on last edited by
        #3

        -- in stdafx.h file #include "mylib.h" -- in myfile.h file I use some variable and some define in mylib.h ex : #define A 1 but when i compile it still error in myfile.h with message : A isn't defined Nho'c Ti`

        J D 2 Replies Last reply
        0
        • D don7cry

          -- in stdafx.h file #include "mylib.h" -- in myfile.h file I use some variable and some define in mylib.h ex : #define A 1 but when i compile it still error in myfile.h with message : A isn't defined Nho'c Ti`

          J Offline
          J Offline
          jmkhael
          wrote on last edited by
          #4

          because in myfile.h you dont include stdafx.h try including stdafx.h before you include your myfile.h Papa while (TRUE) Papa.WillLove ( Bebe ) ;

          1 Reply Last reply
          0
          • D don7cry

            -- in stdafx.h file #include "mylib.h" -- in myfile.h file I use some variable and some define in mylib.h ex : #define A 1 but when i compile it still error in myfile.h with message : A isn't defined Nho'c Ti`

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Unless mylib.h rarely changes, it should not be included in stdafx.h. Otherwise, the majority, if not all, of the project gets needlessly rebuilt. Include mylib.h only where it is needed. That aside, you haven't shown what file actually uses A. In that file is where you'll need to include mylib.h.


            "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

            D 1 Reply Last reply
            0
            • D David Crow

              Unless mylib.h rarely changes, it should not be included in stdafx.h. Otherwise, the majority, if not all, of the project gets needlessly rebuilt. Include mylib.h only where it is needed. That aside, you haven't shown what file actually uses A. In that file is where you'll need to include mylib.h.


              "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

              D Offline
              D Offline
              don7cry
              wrote on last edited by
              #6

              i saw some project don't need include when mylib.h use include in stdafx.h and stdafx.h is set precompiled headerfiles for project setting. Nho'c Ti`

              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