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. Compile errors

Compile errors

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
2 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.
  • M Offline
    M Offline
    msh
    wrote on last edited by
    #1

    Hi all, I am brand new to VC++. I an always having problems with paths when compiling. For instance, the MIDL compiler does not compile if the path of directories include blank spaces (e.g. c:\Program Files\.....). So, I am always compiling with include files in non blank spaces directories (c:\temp\include). What is wrong? Thank you in advance:((

    B 1 Reply Last reply
    0
    • M msh

      Hi all, I am brand new to VC++. I an always having problems with paths when compiling. For instance, the MIDL compiler does not compile if the path of directories include blank spaces (e.g. c:\Program Files\.....). So, I am always compiling with include files in non blank spaces directories (c:\temp\include). What is wrong? Thank you in advance:((

      B Offline
      B Offline
      benjymous
      wrote on last edited by
      #2

      Are you try to do something like

      #include "C:\Program Files\Microsoft Visual Studio\VC98\Include\stdio.h"

      by any chance? This is where the difference with include "file" and include <file> comes in. If you're including a standard system header, just do

      #include <stdio.h>

      and the compiler will find the header for you. If it's a header you've written yourself, then it should either be in the same directory as the project, or a "near by" folder, in which case you can just do

      #include "myheader.h"

      or

      #include "../commonheaders/myheader.h"

      for example (though in this case, it'd be better to add the "commonheaders" folder into the VC include folders settings, then it'll find it without needing to specify the path) If you have a common header that's used in multiple projects, you can use source control (i.e. SourceSafe) to share a single file across multiple projects and keep them in sync for you Hard coding exact directory paths into sourcecode is very bad, as it locks down the code to your specific PC. If you hand the source to someone else to work on, they'll have to have their directory layout identical to yours in order to be able to compile the code, which isn't particularly desirable -- Help me! I'm turning into a grapefruit!

      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