memset has conflicting declaration

This is a discussion on memset has conflicting declaration within the C++ Programming forums, part of the General Programming Boards category; Hello Everyone, I compile the following file, mydate.cpp, and get these errors: idun:/h/odin/IOCDir/IDate >make /usr/vacpp/bin/xlC_r -c -qsource -qlistopt -qxref -qattr ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    19

    memset has conflicting declaration

    Hello Everyone,

    I compile the following file, mydate.cpp, and get these errors:


    idun:/h/odin/IOCDir/IDate >make
    /usr/vacpp/bin/xlC_r -c -qsource -qlistopt -qxref -qattr -I/usr/vacpp/include -I/h/odin/IOCDir/IDate -o mydate.o /h/odin/IOCDir/IDate/mydate.cpp
    "/usr/vacpp/include/string.h", line 37.30: 1540-0400 (S) "memset(void *, int, size_t)" has a conflicting declaration.
    "/usr/include/sys/time.h", line 171.18: 1540-0424 (I) "memset" is declared on line 171 of "/usr/include/sys/time.h".
    "/usr/vacpp/include/string.h", line 119.30: 1540-0400 (S) "memset(void *, int, size_t)" has a conflicting declaration.
    "/usr/include/sys/time.h", line 171.18: 1540-0424 (I) "memset" is declared on line 171 of "/usr/include/sys/time.h".
    "/usr/include/string.h", line 79.26: 1540-0424 (I) "memset" is declared on line 79 of "/usr/include/string.h".
    make: 1254-004 The error code from the last command is 1.


    mydate.cpp
    ----------------------------------------------------------------------------
    ----------------------------------------------------------------------------


    Code:
    #include <iostream>
    #include <idate.hpp>
    
    using namespace std;
    
    int main()
    {
    	IDate date;
    	
    	cout<< "Days in the year are: " << date.daysInYear(2002) << endl;
    	
    	cout<< "Days in the year are: " << date.daysInYear(2004) << endl;
    
    	return(0);
    
    }
    Now the other two files, idate.cpp and idate.hpp don't contain anything fancy except that idate.cpp has the following extern declarations:

    Code:
    extern "C"
    {
        #include <stddef.h>
        #include <time.h>
        #include <string.h>
    }
    Any hints or help would be greatly appreciated. Oh, and I am using the IBM vacpp 6.0 compiler on AIX 5.1.

    Thanks!

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,806
    Have you tried removing those old C header and replacing them with the newer versions?

    Code:
    #include <cstddef>
    #include <ctime>
    #include <cstring>
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    19
    Yes I did switch to the new C headers but that did not solve the problem.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 11:17 AM
  2. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM

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