Stupid Error :: MSVC++ 6.0

This is a discussion on Stupid Error :: MSVC++ 6.0 within the Windows Programming forums, part of the Platform Specific Boards category; This is really making me mad. I am trying to make a VERY SIMPLE socket program. I get a stupid ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Angry Stupid Error :: MSVC++ 6.0

    This is really making me mad. I am trying to make a VERY SIMPLE socket program. I get a stupid error. I have 2 files, socket.h and socket.cpp:

    /* Socket.h */
    // The Class
    class PLSOCKET
    {
    public:
    PLSOCKET ();
    ~PLSOCKET ();
    int PLConnect (char* ip_addr, int port);

    private:
    int plSocket;
    struct sockaddr_in saddr;
    };

    /* Socket.cpp */

    // =============== //
    // This Is The Main Source //
    // File For Our Socket Class //
    // =============== //

    // The Class Definitions
    PLSOCKET::PLSOCKET ()
    {
    plSocket = socket (AF_INET, SOCK_STREAM, 0);
    }
    PLSOCKET::~PLSOCKET ()
    {
    plSocket = INVALID_SOCKET;
    }
    int PLSOCKET::PLConnect (char* ip_addr, int port)
    {
    saddr.sin_addr.s_addr = INADDR_ANY;
    saddr.sin_family = AF_INET;
    saddr.sin_port =htons (port);
    memset (& (saddr.sin_zero), '\0', 8);

    if (bind (plSocket, (struct sockaddr *) &saddr, sizeof (struct sockaddr)) == -1)
    return -1;
    }

    It gives me the error in socket.cpp:

    fatal error C1010: unexpected end of file while looking for precompiled header directive

    I HATE Microsoft. Can anyone tell me why I get this error?
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Sometimes I get this if I have cut and pasted from somewhere (more so though with Devc++ than VC++)

    Try retype it into another file.....

  3. #3
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    Put #include "stdafx.h" at the top.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling x64 code in VC++ 6.0?
    By cpjust in forum Windows Programming
    Replies: 7
    Last Post: 07-29-2008, 09:36 AM
  2. Visual C++ 6.0 Pro vs Visual C++ 6.0 Enterprise
    By Joelito in forum Tech Board
    Replies: 5
    Last Post: 01-23-2007, 06:00 PM
  3. question about .net to 6.0 change causing errors
    By jverkoey in forum C++ Programming
    Replies: 17
    Last Post: 03-23-2004, 09:45 AM
  4. Visual Studio 6.0 Help
    By L_I_Programmer in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2003, 09:35 PM
  5. ListView 6.0 OnListItemClick Problem
    By blundstrom in forum Windows Programming
    Replies: 1
    Last Post: 07-21-2002, 11:03 AM

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