User forums > Help

Building fails for sample project

<< < (2/2)

oBFusCATed:
Read the documentation or ask in a forum which supports your compiler, here we support C::B, only.
Looks like you're using some embedded compiler, probably there is no support for printf in it, I don't know.
There is a chance that the compiler is not installed correctly.

pwnedu46:

--- Quote from: cooded on July 26, 2011, 10:53:55 am ---Hi,

My program consists of the following code. When i comment the printf syntax, then it rebuilds without error. I have already included the stdanrd libraries for C. Should it even give an error??

Regards
Rahul


--- Code: ---#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a;
    a = 1 ;
    printf("Hello world!\n");
    return 0;
}

--- End code ---

--- End quote ---

try it with std::cout instead of printf.

--- Code: ---
#include <iostream> // cout is a member of iostream

using namespace std; // allows cout to be used instead of std::cout

int main()
{
    int a = 1;
    cout << "Hello World\n";
    return 0;
}

--- End code ---

[edit: removed excess whitespace from quote]

Navigation

[0] Message Index

[*] Previous page

Go to full version