global namespace errors

This is a discussion on global namespace errors within the C++ Programming forums, part of the General Programming Boards category; Hi folks I'm really new to all this, but I feel like this should be an easily solveable issue. If ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    4

    global namespace errors

    Hi folks

    I'm really new to all this, but I feel like this should be an easily solveable issue. If anyone can help me out I'd really (REALLY) appreciate it. I've been struggling with it well over a week!

    I'm trying to compile, using VC++ 2005 Express on Windows, the code for a model written in C++, originally for Unix. I've been at it for a while, slowly figuring things out, but now I'm stumped. I'm just not familiar enough with C++ yet to make head or tail of what I feel like is a pretty simple error.

    This is a snippet of the build output - the errors shown, all repetitive, apply to the files cstdio and cstring in C:\Program Files\Microsoft Visual Studio 8\VC\include. The errors appear identical for both files as far as I can tell (I get "fatal error C1003: error count exceeds 100; stopping compilation" after only 12 cstring-related errors so I can't tell if there are other files involved).

    ------ Build started: Project: tarse, Configuration: Release Win32 ------
    Compiling...
    XMLUtils.cpp
    C:\cygwin\usr\include\sys/_types.h(15) : error C2144: syntax error : '__int64' should be preceded by ';'
    C:\cygwin\usr\include\sys/_types.h(15) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\cygwin\usr\include\sys/_types.h(34) : error C4980: '__value' : use of this keyword requires /clr:oldSyntax command line option
    C:\cygwin\usr\include\sys/_types.h(34) : error C2059: syntax error : '__value'
    C:\cygwin\usr\include\sys/reent.h(607) : error C2144: syntax error : 'unsigned __int64' should be preceded by ';'
    C:\cygwin\usr\include\sys/reent.h(607) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\cygwin\usr\include\stdlib.h(62) : warning C4392: 'int abs(void)' : incorrect number of arguments for intrinsic function, expected '1' arguments
    C:\cygwin\usr\include\stdlib.h(63) : error C2733: second C linkage of overloaded function 'atexit' not allowed
    C:\cygwin\usr\include\stdlib.h(63) : see declaration of 'atexit'
    C:\cygwin\usr\include\stdlib.h(85) : warning C4392: 'long labs(void)' : incorrect number of arguments for intrinsic function, expected '1' arguments
    C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdio(25) : error C2039: 'fpos_t' : is not a member of '`global namespace''
    C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdio(25) : error C2873: 'fpos_t' : symbol cannot be used in a using-declaration
    C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdio(25) : error C2039: 'FILE' : is not a member of '`global namespace''
    C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdio(25) : error C2873: 'FILE' : symbol cannot be used in a using-declaration
    C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdio(26) : error C2039: 'clearerr' : is not a member of '`global namespace''
    C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdio(26) : error C2873: 'clearerr' : symbol cannot be used in a using-declaration
    etc etc etc for 100 errors before stopping and moving on to compile the next .cpp file

    Here is the code for XMLUtil.cpp, the source code in question above, though I should add that these errors are repeated exactly for the 4 other .cpp files during the attemped build.

    The final error in the report is "Project : warning PRJ0018 : The following environment variables were not found: $(IDB_PATH)"

    "_types.h"
    Code:
    /* ANSI C namespace clean utility typedefs */
    
    /* This file defines various typedefs needed by the system calls that support
       the C library.  Basically, they're just the POSIX versions with an '_'
       prepended.  This file lives in the `sys' directory so targets can provide
       their own if desired (or they can put target dependant conditionals here).
    */
    
    #ifndef	_SYS__TYPES_H
    #define _SYS__TYPES_H
    
    #include <sys/lock.h>
    
    typedef long _off_t;
    __extension__ typedef long long _off64_t;
    
    #if defined(__INT_MAX__) && __INT_MAX__ == 2147483647
    typedef int _ssize_t;
    #else
    typedef long _ssize_t;
    #endif
    
    #define __need_wint_t
    #include <stddef.h>
    
    /* Conversion state information.  */
    typedef struct
    {
      int __count;
      union
      {
        wint_t __wch;
        unsigned char __wchb[4];
      } __value;		/* Value so far.  */
    } _mbstate_t;
    
    typedef _LOCK_RECURSIVE_T _flock_t;
    
    /* Iconv descriptor type */
    typedef void *_iconv_t;
    
    #endif	/* _SYS__TYPES_H */
    and "XMLUtils.cpp" (sorry it's such a beast)
    Code:
    //;-*-c++-*-
    
    /*! \file  XMLUtils.cpp
    
      \brief 
    
    
      \author Andrew I. James 
      \date 2004-2007 
      \version 1.0.0
    
      For full copyright information see the file COPYING in the top level directory.
    
      \license Copyright (C) 2004-2007 Andrew I. James 
           - ajames at waterqualitymodeling dot com -
     
           This program is free software; you can redistribute it and/or modify it
           under the terms of the GNU General Public License as published by the
           Free Software Foundation; either * version 2 of the License, or (at your
           option) any later version.
     
           This program is distributed in the hope that it will be useful, but
           WITHOUT ANY WARRANTY; without even the implied warranty of
           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
           General Public License for more details.
     
           You should have received a copy of the GNU General Public License along
           with this program; if not, write to the Free Software Foundation, Inc.,
           675 Mass Ave, Cambridge, MA 02139, USA.
    */
    //-*-*- EH -*-*-//
    
    #include "Misc/XMLUtils.hpp"
    
    namespace wqxml {
    
      using namespace boost::gregorian;
      using namespace boost::posix_time;
      using namespace boost::local_time;
    
      typedef boost::shared_ptr<ptime>                            ptime_ptr;
      typedef boost::shared_ptr<time_iterator>                    time_iterator_ptr;
      typedef boost::shared_ptr<time_duration>                    time_duration_ptr;
    
    
      xmlNodePtr
      get_node( xmlNodePtr start, const std::string& name, bool outermost ) 
      {
        xmlNodePtr curr_node = NULL;
        xmlNodePtr found_node = NULL;
        for ( curr_node = start; curr_node; curr_node = curr_node->next ) {
          if ( curr_node->type == XML_ELEMENT_NODE && xmlStrEqual(curr_node->name, BAD_CAST name.c_str( )) ) {
            found_node = curr_node;
            break;
          }
          found_node = get_node(curr_node->children, name, false);
          if ( found_node != NULL ) break;
        }
        if ( outermost ) XML_THROW_IF_NODE_NOT_FOUND( found_node, name );
        return found_node;
      }
    
      xmlNodePtr
      get_child_node( xmlNodePtr start, const std::string& name, bool throw_if_nil ) 
      {
        xmlNodePtr curr_node;
        xmlNodePtr found_node = NULL;
        // std::cerr << "Name: " << name << " line: " << start->line << std::endl;
        try {
          for ( curr_node = start->children; curr_node; curr_node = curr_node->next ) {
            if ( curr_node->type == XML_ELEMENT_NODE && xmlStrEqual(curr_node->name, BAD_CAST name.c_str()) ) {
              found_node = curr_node;
              break;
            }
          }
          if ( throw_if_nil ) XML_THROW_IF_NODE_NOT_FOUND( found_node, name );
        }
        catch ( const std::exception& error ) {
          std::cerr << error.what( ) << std::endl;
          assert( 0 );
        }
        return found_node;
      }
    
      std::string get_node_name( xmlNodePtr np )
      {
        XML_THROW_IF_BAD_NODE( np );
        std::string n_name((char*)np->name);
        std::istringstream iss(n_name);
        std::string the_name;
        iss >> std::skipws >> the_name;
        return the_name;
      }
    
      bool property_is_equal_to( xmlNodePtr np, const char* prop_name, const char* prop_val )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlGetProp( np, BAD_CAST prop_name );
        XML_THROW_IF_ATTRIBUTE_NOT_FOUND( (char*)char_name, prop_name );
        bool prop_is_equal( xmlStrEqual( char_name, BAD_CAST prop_val ) );
        xmlFree( char_name );
        return prop_is_equal;
      }
    
      template<typename T>
      T get_property( xmlNodePtr np, const char* prop_name, bool throw_if_nil )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlGetProp( np, BAD_CAST prop_name );
        if ( throw_if_nil ) XML_THROW_IF_ATTRIBUTE_NOT_FOUND( (char*)char_name, prop_name );
        std::istringstream iss(( char_name != NULL ) ? (char*)char_name : "");
        T the_content;
        if ( char_name != NULL ) iss >> std::skipws >> the_content;
        xmlFree( char_name );
        return the_content;
      }
    
      // Make sure this doesn't mung up the specialization with <bool>, below.
      template<typename T>
      T get_property( xmlNodePtr np, const char* prop_name, const T& default_val, int dummy )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlGetProp( np, BAD_CAST prop_name );
        T the_content(default_val);
        if ( char_name != NULL ) {
          std::istringstream iss( (char*)char_name );
          iss >> std::skipws >> the_content;
        }
        xmlFree( char_name );
        return the_content;
      }
    
      // Force instantiation
      template std::string get_property<std::string>( xmlNodePtr np, const char* prop_name, 
                                                      bool throw_if_nil );
      template std::string get_property<std::string>( xmlNodePtr np, const char* prop_name, const std::string& def, int dummy );
    
      template double get_property<double>( xmlNodePtr np, const char* prop_name, bool throw_if_nil );
      template int get_property<int>( xmlNodePtr np, const char* prop_name, bool throw_if_nil );
      template double get_property<double>( xmlNodePtr np, const char* prop_name, const double& default_val, int dummy );
    
    
      template<>
      bool get_property<bool>( xmlNodePtr np, const char* prop_name, bool throw_if_nil )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlGetProp( np, BAD_CAST prop_name );
        if ( throw_if_nil ) XML_THROW_IF_ATTRIBUTE_NOT_FOUND( (char*)char_name, prop_name );
        std::istringstream iss(( char_name != NULL ) ? (char*)char_name : "");
        bool the_content;
        iss >> std::skipws >> std::boolalpha >> the_content;
        xmlFree( char_name );
        return the_content;
      }
    
      template<>
      bool get_property<bool>( xmlNodePtr np, const char* prop_name, const bool& default_val, int dummy )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlGetProp( np, BAD_CAST prop_name );
        bool the_content(default_val);
        if ( char_name != NULL ) {
          std::istringstream iss( (char*)char_name );
          iss >> std::skipws >> std::boolalpha >> the_content;
        }
        xmlFree( char_name );
        return the_content;
      }
    
      template<>
      std::vector<int> get_property<std::vector<int> >( xmlNodePtr np, const char* prop_name, bool throw_if_nil )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlGetProp( np, BAD_CAST prop_name );
        if ( throw_if_nil ) XML_THROW_IF_ATTRIBUTE_NOT_FOUND( (char*)char_name, prop_name );
        std::istringstream iss(( char_name != NULL ) ? (char*)char_name : "");
        std::vector<int> the_content;
        while ( !iss.eof( ) ) {
          int entry(0);
          iss >> std::skipws >> entry;
          the_content.push_back(entry);
        }
        xmlFree( char_name );
        return the_content;
      }
    
      template<>
      std::vector<std::string> get_property<std::vector<std::string> >( xmlNodePtr np, const char* prop_name, bool throw_if_nil )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlGetProp( np, BAD_CAST prop_name );
        if ( throw_if_nil ) XML_THROW_IF_ATTRIBUTE_NOT_FOUND( (char*)char_name, prop_name );
        std::istringstream iss(( char_name != NULL ) ? (char*)char_name : "");
        std::vector<std::string> the_content;
        while ( !iss.eof( ) ) {
          std::string entry;
          iss >> std::skipws >> entry;
          the_content.push_back(entry);
        }
        xmlFree( char_name );
        // for ( int i = 0; i < the_content.size( ); ++i ) std::cout << the_content[i] << std::endl;
        return the_content;
      }
    
    
      char get_action_property( xmlNodePtr np, bool throw_if_nil )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlGetProp( np, BAD_CAST "action" );
        if ( throw_if_nil ) XML_THROW_IF_ATTRIBUTE_NOT_FOUND( (char*)char_name, "action" );
        char ret_val = ( xmlStrEqual( char_name, BAD_CAST "mult" ) ) ? '*' : '/';
        xmlFree( char_name );
        return ret_val;
      }
    
      template<typename T>
      T get_node_content( xmlNodePtr np, bool throw_if_nil )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlNodeGetContent( np );
        if ( throw_if_nil ) XML_THROW_IF_CONTENT_NOT_FOUND( (char*)char_name, (char*)np->name );
        std::istringstream iss(( char_name != NULL ) ? (char*)char_name : "");
        T the_content;
        iss >> std::skipws >> the_content;
        xmlFree( char_name );
        return the_content;
      }
    
      // Have to force instantiation
      template std::string get_node_content<std::string>( xmlNodePtr np, bool throw_if_nil );
      template double get_node_content<double>( xmlNodePtr np, bool throw_if_nil );
      template int get_node_content<int>( xmlNodePtr np, bool throw_if_nil );
    
      template<>
      bool get_node_content<bool>( xmlNodePtr np, bool throw_if_nil )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlNodeGetContent( np );
        if ( throw_if_nil ) XML_THROW_IF_CONTENT_NOT_FOUND( (char*)char_name, (char*)np->name );
        std::istringstream iss(( char_name != NULL ) ? (char*)char_name : "");
        bool the_content;
        iss >> std::skipws >> std::boolalpha >> the_content;
        xmlFree( char_name );
        return the_content;
      }
    
      template<>
      ptime_ptr get_node_content<ptime_ptr>( xmlNodePtr np, bool throw_if_nil )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlNodeGetContent( np );
        if ( throw_if_nil ) XML_THROW_IF_CONTENT_NOT_FOUND( (char*)char_name, (char*)np->name );
        std::stringstream ss(( char_name != NULL ) ? (char*)char_name : "");
        ptime_ptr pt( new ptime(not_a_date_time) );
        ss >> *pt;
        xmlFree( char_name );
        return pt;
      }
    
      // double get_node_content_as_double( xmlNodePtr np, bool throw_if_nil )
      // {
      //   XML_THROW_IF_BAD_NODE( np );
      //   xmlChar* char_name = xmlNodeGetContent( np );
      //   if ( throw_if_nil ) XML_THROW_IF_CONTENT_NOT_FOUND( (char*)char_name, (char*)np->name );
      //   // std::string 
      //   double val = ( char_name != NULL ) ? atof((char*)char_name) : 0.0 ;
      //   return val;
      // }
    
      std::string get_node_content_with_whitespace( xmlNodePtr np, bool throw_if_nil )
      {
        XML_THROW_IF_BAD_NODE( np );
        xmlChar* char_name = xmlNodeGetContent( np );
        if ( throw_if_nil ) XML_THROW_IF_CONTENT_NOT_FOUND( (char*)char_name, (char*)np->name );
        std::istringstream iss(( char_name != NULL ) ? (char*)char_name : "");
        xmlFree( char_name );
        return iss.str( );
      }
    
    
      std::string xml_xpath_get_string( xmlNodePtr np, const std::string& name, bool throw_if_nil )
      {
        if ( throw_if_nil ) XML_THROW_IF_BAD_NODE( np );
        std::string the_name = (char*) xmlNodeGetContent( np );
        return the_name;
      }
    
      bool xml_xpath_get_bool( xmlNodePtr np, const std::string& name, bool throw_if_nil )
      {
        if ( throw_if_nil ) XML_THROW_IF_BAD_NODE( np );
        xmlChar* cp = xmlNodeGetContent( np );
        // perhaps not use a string for this...
        std::string the_bool = ( cp != NULL ) ? (char*)cp : "" ;
        xmlFree( cp );
        return ( the_bool == "true" || the_bool == "True" || the_bool == "yes" 
                 || the_bool == "Yes" || the_bool == "1" );
      }
    
      double xml_xpath_get_double( xmlNodePtr np, const std::string& name, bool throw_if_nil )
      {
        if ( throw_if_nil ) XML_THROW_IF_BAD_NODE( np );
        xmlChar* cp = xmlNodeGetContent( np );
        double ret_val = ( cp != NULL ) ? atof((char*)cp) : 0.0; 
        xmlFree( cp );
        return ret_val;
      }
    
    };
    I've had no dice on codeguru so here's hoping you guys & gals can give me some hope...

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    You can't just take Unix's (Cygwin's, in this case) system headers, which are written for GCC and use GCC's special extensions, and expect them to compile with VC++.

    But I don't think you were even aware you were doing that.

    The problem, as I see it, is hinted at by this part of the error message:
    C:\cygwin\usr\include\stdlib.h
    For some reason, VC++ picks up this header over its own stdlib.h. That can only result in total chaos.

    Check your environment variables. It seems that something wrote a lot of garbage into your global INCLUDE variable, and probably some other variables, too. You need to clean out your garbage in order to be able to compile anything. Right now, I think even a Hello World wouldn't compile on your system.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    4
    Hi CornedBee

    Um yeah - I had no clue ;-/

    Right now I feel like I could star in a sequel to Clueless...

    I did think it was kinda weird to see cygwin in there, but I just figured it was somehow tied to PETSc (I had to install cygwin in order to install PETSc).

    So, here's where I think I began to so gloriously screw things up. Initially I was blocked by some errors for files that could not be found, so I searched for the vagrant files and then added their directory paths to the Additional Include Directories in Project < Properties < Configuration Properties < C/C++ < General. Like I said, I'm really stumbling around in the dark here. Clearly. But given what you've said it seems like the addition of the last 2 or 3 in this list of Additional Includes is dodgy.

    "C:\Program Files\boost\boost_1_34_1";
    "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\tarse\tarse\tarse\src";
    "$(MPICH2)\include";
    "$(PETSC_DIR)";
    "$(PETSC_DIR)\bmake\$(PETSC_ARCH)";
    "$(PETSC_DIR)\include";
    "$(LIBXML_DIR)\include";
    "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\xmllib\xmllib\include";
    "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\xmllib\xmllib\include\libxml";
    "C:\cygwin\home\Administrator\soft\petsc-2.3.3-p8\externalpackages\mpich2-1.0.5p4\src\include";
    "C:\cygwin\usr\include\sys";
    "C:\cygwin\usr\include"


    You know, Cygwin and I never got along well from the start. This hasn't helped our relationship.

    Currently I have the System Variable PETSC_DIR set to C:\cygwin\home\Administrator\soft\petsc-2.3.3-p8 - but this just points to PETSc-related files, not Cygwin files, so that shouldn't be a problem... right?

    So, I deleted the last 3 additional includes and got a bunch of errors that pertained to the model's code itself (it's in a transitory state so I don't expect a perfectly clean compilation), so that was an improvement! But fundamental errors should not appear and the final two lines of the build log read:

    C:\cygwin\home\Administrator\soft\petsc-2.3.3-p8\include\petsc.h(138) : fatal error C1083: Cannot open include file: 'mpi.h': No such file or directory
    Project : warning PRJ0018 : The following environment variables were not found: $(IDB_PATH)

    A system search for "mpi.h" yielded a bunch of hits, including the third from last include listed above ("C:\cygwin\home\Administrator\soft\petsc-2.3.3-p8\externalpackages\mpich2-1.0.5p4\src\include") which seemed the least potentially harmful. So I reinstated that, rebuilt, and got stopped with the same error but now for "sys\param.h" - and this is where the killer was I think.

    Another search yielded four instances of param.h, three of them in various folders within the cygwin include directory, hence why I added the last two Additional Includes in that list above. I had guessed that the one in a folder called "sys" was the right one, given that "sys\param.h" couldn't be found, but having exposed Cygwin's treason I decided to try the fourth one, which was part of PETSc.

    Since the file wasn't in a directory called sys, which is still worrying me, I created one and added param.h and param.c to it, and then placed the directory in C:\cygwin\home\Administrator\soft\petsc-2.3.3-p8\externalpackages\mpich2-1.0.5p4\src\include since that was already included for the mpi.h issue above.

    Lo and behold the beast seems to have compiled! Am I genius or what! ;-)

    If you could quell my nerves by telling me that what I did wasn't reckless++ and potentially source material for another horror story that'd be swell.

    I'm also still trying to figure out if this is anything important - it always appears as the last line of the build log:
    Project : warning PRJ0018 : The following environment variables were not found:
    $(IDB_PATH)

    Finally, just to be clear, the fact that it even tried to link implies that the compilation was successful right? I never expected a successful link - I just want to know that she compiled, which I'm assumng this represents:

    Linking...
    LINK : fatal error LNK1181: cannot open input file 'zlib.lib'

    THANKS! Very much!! (!!!)

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Well, if it works ...

    This PETSc looks like quite the horror to install, judging from a brief look at their site.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    4
    You have NO idea. I was flabergasted that such a ubiquitous library was such a nightmare to install on Windows - it took me daaaaaays.

    This was the root of Cygwin woes... more like PESTc

    Thanks again for the help!

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,012
    I must urge to beware, however. Just because it compiles doesn't mean it works.
    For example, Visual Studio uses __int64 for 64-bit integers, and some other compilers use long long int or such. Long long int is 32-bit in Visual Studio. Uh-oh.
    That's why it can be bad to include other headers. Do proper testing if you get it to compile!
    And for the linking error, you need to download zlib and link against it's .lib file and put the zlib.dll in the same directory as the app.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Long long int is 32-bit in Visual Studio
    No, it's not. Since the first version to support long long (.Net 2003), it has always been 64 bits.

    It's plain long that's inconsistent between GCC and VC++, but only on 64-bit platforms.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,012
    Wait, no, I remember I was corrected about that...
    No, you're right, CornedBee. My mistake. But other things may or may not work.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Registered User
    Join Date
    Apr 2008
    Posts
    4
    So assuming I'm on 32-bit system, which I believe I am, I don't actually have to worry about this GCC/VC++ long int issue right?

    It's going to be a while before I can run any tests I think. I now have to create an interface to connect this model (TARSE) with another model (FTLOADDS) that will supply the inputs TARSE needs to actually run.

    Wish me luck - FTLOADDS is coded in Fortran...

  10. #10
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,012
    Quote Originally Posted by stubaan View Post
    So assuming I'm on 32-bit system, which I believe I am, I don't actually have to worry about this GCC/VC++ long int issue right?
    It appears not. But there may be other errors. They'll show up once the code is running.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. namespace problem
    By DL1 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2008, 01:10 PM
  2. global variable and prototype
    By Lincoln_Poh in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2008, 04:25 AM
  3. global functions and OO
    By l2u in forum C++ Programming
    Replies: 2
    Last Post: 05-12-2007, 12:00 PM
  4. Global variables used in a linked class, getting errors.
    By RealityFusion in forum C++ Programming
    Replies: 3
    Last Post: 09-24-2005, 01:25 AM
  5. Winsock compilation errors
    By jmd15 in forum Networking/Device Communication
    Replies: 2
    Last Post: 08-03-2005, 09:00 AM

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