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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. adding a C file to a CPP proj

adding a C file to a CPP proj

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
3 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.
  • A Offline
    A Offline
    ABean
    wrote on last edited by
    #1

    I added a C file to a CPP proj and got an error complaing about the precompiled header thing. MSDN says I should create a subproject and stick the file in that. However, I would rather not create a new sub project for a number of reasons. As a solution, I found that I could rename the .c to .cpp and get it to compile file. Everything works but I'm wondering if there is a ticking time bomb just waiting to happen after this program goes into production. Thanks, Al

    M 1 Reply Last reply
    0
    • A ABean

      I added a C file to a CPP proj and got an error complaing about the precompiled header thing. MSDN says I should create a subproject and stick the file in that. However, I would rather not create a new sub project for a number of reasons. As a solution, I found that I could rename the .c to .cpp and get it to compile file. Everything works but I'm wondering if there is a ticking time bomb just waiting to happen after this program goes into production. Thanks, Al

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      change the compile setting for the C file to not use precompile headers.


      Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

      A 1 Reply Last reply
      0
      • M Maximilien

        change the compile setting for the C file to not use precompile headers.


        Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

        A Offline
        A Offline
        ABean
        wrote on last edited by
        #3

        Is it possible to do that for a single file in VC7? MSDN seems to indicate that the only way to do this would be to stick it in its own sub-project. In any case I would rather not change ANY environment settings because this is for inclusion into an open source project that can be compiled on many platforms/compilers. Renaming it to CPP seems to be the easy way out. It’s just a collection of functions so I really can’t see how it would hurt. But thought it would be good to check with you guys first.

        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