Like Tree5Likes
  • 1 Post By Click_here
  • 1 Post By nonpuz
  • 3 Post By stahta01

net beans 7.2 unable to compile c file(some make error)

This is a discussion on net beans 7.2 unable to compile c file(some make error) within the C Programming forums, part of the General Programming Boards category; mkdir -p build/Debug/MinGW-Windows rm -f build/Debug/MinGW-Windows/main.o.d g++.exe -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp main.cpp: In function 'int ...

  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    2

    net beans 7.2 unable to compile c file(some make error)

    mkdir -p build/Debug/MinGW-Windows
    rm -f build/Debug/MinGW-Windows/main.o.d
    g++.exe -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
    main.cpp: In function 'int main(int, char**)':
    main.cpp:16:19: error: 'printf' was not declared in this scope
    make: *** [build/Debug/MinGW-Windows/main.o] Error 1
    nbproject/Makefile-Debug.mk:66: recipe for target `build/Debug/MinGW-Windows/main.o' failed




    BUILD FAILED (exit value 2, total time: 1s)

    THIS IS THE ERROR I AM GETTING

  2. #2
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,384
    Sounds like you forgot to include stdio.h
    stahta01 likes this.
    Fact - Beethoven wrote his first symphony in C

  3. #3
    Ultraviolence Connoisseur
    Join Date
    Mar 2004
    Posts
    472
    main.cpp:16:19: error: 'printf' was not declared in this scope

    Sounds like you didn't include stdio.h?

    POST some code next time though, its quite rude to demand an answer to a problem that we didn't get the question for.
    stahta01 likes this.

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    2,577
    Likely you forgot to included the correct header file.

    Edit: I was really slow on posting my reply.

    Tim S.
    Last edited by stahta01; 01-28-2013 at 08:10 PM.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  5. #5
    Registered User
    Join Date
    Jan 2013
    Posts
    2
    #include <cstdlib>


    using namespace std;




    int main(int argc, char** argv) {
    printf("Hello");
    return 0;


    mkdir -p build/Debug/MinGW-Windows
    rm -f build/Debug/MinGW-Windows/main.o.d
    g++.exe -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
    main.cpp: In function 'int main(int, char**)':
    main.cpp:16:19: error: 'printf' was not declared in this scope
    make: *** [build/Debug/MinGW-Windows/main.o] Error 1
    nbproject/Makefile-Debug.mk:66: recipe for target `build/Debug/MinGW-Windows/main.o' failed




    BUILD FAILED (exit value 2, total time: 1s)


    THIS WAS THE CODE ABOVE ........ITS SOME MAKE ERROR I DONT KNOW WHAT IF YOU CAN HELP IT WOULD BE GREAT.......

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    2,577
    Please read the info at this link!! printf - C++ Reference
    What header did you include?
    What does the link say is the correct header?
    Do you now realize they are not the same header?
    Do you realize it is C++ code that you posted?

    Tim S.
    Last edited by stahta01; 01-28-2013 at 08:30 PM.
    nonpuz, Salem and Tanu like this.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  7. #7
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,384
    C and C++ are different.
    Fact - Beethoven wrote his first symphony in C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 12-05-2011, 04:07 PM
  2. libusb: unable to compile
    By nndhawan in forum C Programming
    Replies: 1
    Last Post: 02-17-2011, 09:56 PM
  3. Unable to compile pro C generated C file in cygwin
    By SasDutta in forum C Programming
    Replies: 4
    Last Post: 07-14-2010, 08:49 AM
  4. compile error when make a wchar_t conversion
    By George2 in forum C Programming
    Replies: 2
    Last Post: 11-26-2007, 09:30 AM
  5. (Error message) Fatal: Unable to open file 'C.OBJ'
    By drojen in forum C++ Programming
    Replies: 2
    Last Post: 05-02-2006, 12:05 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21