Thread: How do I add .C Project to my complier?

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    65

    How do I add .C Project to my complier?

    Someone gave me instructions on how to compile. Part of the instructions are make a Project File and a .C project. How do I add .C

    The complier I am using is Visual C++ 2008 Express Edition

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Use a win32 console project and when adding new files, add a .c extension instead of .cpp.
    Then it's just the normal way of compiling. Typical F7 shortcut.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    Quote Originally Posted by Elysia View Post
    Use a win32 console project and when adding new files, add a .c extension instead of .cpp.
    Then it's just the normal way of compiling. Typical F7 shortcut.

    I am not understanding. I did click on Win32. It wants a filename and everything else. I don't even see where I add the .c extension. F7 for what?

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    It means you add .c after the filename.
    Like "my super cool file.c", instead of "my super cool file".
    F7 is the shortcut for building your solution.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    I think it failed when I pressed F7



    1>------ Build started: Project: C Programming File.c, Configuration: Debug Win32 ------
    1>Compiling...
    1>C Programming File.c.cpp
    1>c:\documents and settings\baseball\my documents\visual studio 2008\projects\c programming file.c\c programming file.c\C Programming File.c.h(1) : fatal error C1083: Cannot open include file: 'studio.h': No such file or directory
    1>Build log was saved at "file://c:\Documents and Settings\baseball\My Documents\Visual Studio 2008\Projects\C Programming File.c\C Programming File.c\Debug\BuildLog.htm"
    1>C Programming File.c - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========




    Quote Originally Posted by Elysia View Post
    It means you add .c after the filename.
    Like "my super cool file.c", instead of "my super cool file".
    F7 is the shortcut for building your solution.

  6. #6
    Registered User
    Join Date
    Sep 2008
    Posts
    34
    stdio.h instead of studio.h

  7. #7
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    Quote Originally Posted by Trafalgar Law View Post
    stdio.h instead of studio.h


    Thank you very much. It worked. I am learning as we go.

  8. #8
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    Alright,

    Here is another copy of the log that failed. We was all new at once. Just bare with me!



    1>------ Build started: Project: C Programming File.c, Configuration: Debug Win32 ------
    1>Compiling...
    1>C Programming File.c.cpp
    1>c:\documents and settings\baseball\my documents\visual studio 2008\projects\c programming file.c\c programming file.c\C Programming File.c.h(4) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>.\C Programming File.c.cpp(7) : fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\baseball\my documents\visual studio 2008\projects\c programming file.c\c programming file.c\C Programming File.c.h(5)' was matched
    1>Build log was saved at "file://c:\Documents and Settings\baseball\My Documents\Visual Studio 2008\Projects\C Programming File.c\C Programming File.c\Debug\BuildLog.htm"
    1>C Programming File.c - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Code, please.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    Quote Originally Posted by Elysia View Post
    Code, please.

    Sorry.


    #include <stdio.h>

    main()
    {printf("hello, world\n");
    {

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    In the future, you should use code tags: [code]my code[/code].
    The problem is due to that you're using implicit main. Add "int" before main and it will compile.
    Btw, it would be better if you put printf on a line below the first {.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    [code]nifty[/code]

    Yep. I am that easily entertained.

  13. #13
    Registered User
    Join Date
    Sep 2008
    Posts
    34
    he used
    Code:
    { instead of }

  14. #14
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    Quote Originally Posted by Elysia View Post
    In the future, you should use code tags: [code]my code[/code].
    The problem is due to that you're using implicit main. Add "int" before main and it will compile.
    Btw, it would be better if you put printf on a line below the first {.


    1.) I am not good at using forum functions. I don't know how to use code tags. Just one day I showed up at forums not knowing anything. Even with quoting, I don't know how to separate quotes either.

    2.) It failed again.


    #include <stdio.h>

    "int"main()
    {
    printf("hello, world\n");
    {

  15. #15
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Have you ever studied a C book at all?
    I didn't mean you to include the quotes.
    Code:
    int main()
    {
        printf("Hello world!\n");
    }
    You may not realize, but if you don't use code tags, your code will look messed up in the forum.
    There a symbol that looks like #. Select your code, then select that button and it will look right.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem about making setup project
    By sgh in forum Windows Programming
    Replies: 0
    Last Post: 04-30-2008, 03:09 AM
  2. Add a VS 2K8 express template for .c
    By vtechv in forum C Programming
    Replies: 2
    Last Post: 02-11-2008, 03:13 AM
  3. How to add a file to a project in bloodshed.
    By Smeep in forum C++ Programming
    Replies: 4
    Last Post: 04-22-2005, 09:29 PM
  4. Project details: Dedicated
    By Stack Overflow in forum Projects and Job Recruitment
    Replies: 9
    Last Post: 02-22-2005, 03:10 PM
  5. Can somebody test this code please
    By andy bee in forum C Programming
    Replies: 6
    Last Post: 10-09-2001, 03:08 PM