Thread: GCC does not compile anymore

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    10

    GCC does not compile anymore

    Hello,

    I have written 2 programs with GCC and they worked. I upgraded to ubuntu 8.10 and reinstalled code:blocks. Now i get this message

    Code:
    ||=== GraphVizConverter, Release ===|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp|3|warning: ignoring #pragma warn |
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp||In function ‘std::string filename_(int, std::string)’:|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp|36|error: ‘strlen’ was not declared in this scope|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp||In function ‘void str_print(std::string)’:|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp|47|warning: comparison between signed and unsigned integer expressions|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp||In function ‘void print(std::ofstream&, std::string)’:|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp|95|warning: comparison between signed and unsigned integer expressions|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp||In function ‘void color(std::ofstream&, std::string)’:|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp|109|warning: comparison between signed and unsigned integer expressions|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp||In function ‘void get_all(std::ifstream&)’:|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp|138|error: ‘memcpy’ was not declared in this scope|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp||In function ‘void GrapheViz()’:|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp|320|error: ‘system’ was not declared in this scope|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp||In function ‘int main()’:|
    /home/taghawi/Documents/Thesis/GraphVizConverter Video/GraphVizConverter.cpp|329|error: ‘system’ was not declared in this scope|
    ||=== Build finished: 4 errors, 4 warnings ===|
    What is wrong? How can I fixe this?

    David

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    To use strlen and memcpy, you need #include<cstring>; to use system you need #include <cstdlib>. That shouldn't have compiled previously, I don't think, as C++ (it might have compiled as straight C, except for the std::string part).

  3. #3
    Registered User carrotcake1029's Avatar
    Join Date
    Apr 2008
    Posts
    404
    Seeing as your source files are .cpp, try using g++.

  4. #4
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by carrotcake1029 View Post
    Seeing as your source files are .cpp, try using g++.
    gcc and g++ can both compile C++ code. The difference between the two comes up during link time.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to compile with libraries (*.a) with gcc?
    By prthealien in forum Linux Programming
    Replies: 1
    Last Post: 04-27-2007, 11:19 AM
  2. segfault with gcc, but not with TC
    By koodoo in forum C Programming
    Replies: 15
    Last Post: 04-23-2007, 09:08 AM
  3. Mixing gcc 2.9* with gcc 3.*
    By rotis23 in forum Linux Programming
    Replies: 1
    Last Post: 07-19-2003, 12:21 AM
  4. gcc compile problem
    By keyz in forum Linux Programming
    Replies: 3
    Last Post: 05-22-2003, 07:14 AM
  5. How can I compile C or C++ with Visual Studio .NET?
    By Dakkon in forum C Programming
    Replies: 8
    Last Post: 02-11-2003, 02:58 PM