Home > database >  include file 'string' not found
include file 'string' not found

Time:11-13

Learning C , day 1, lesson 2

My simple string concatenation test works on the online c compiler

#include <stdio.h>
#include <string>
#include <iostream>

int main() 
{

    // Declare and initialize string
    std::string mystr = "bananas";
    
    std::cout << "Gwen Stefani is " << mystr << "\n";
    return 0;
}

Which works fine: Gwen Stefani is bananas as expected. However, using Tiny CC I get the error:

Error: include file 'string' not found

Still new to compilers, all being equal... So I'm a little confused as to what's gone wrong.

CodePudding user response:

Tiny CC is a C compiler, it does not support C .

Since <string> is a C standard header, it is not supported by Tiny CC.

  • Related