Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Compiling C programs in VS.NET 2005

Compiling C programs in VS.NET 2005

Scheduled Pinned Locked Moved C / C++ / MFC
announcementcsharpdatabasevisual-studioworkspace
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sadheesh R
    wrote on last edited by
    #1

    I have a C program, which has to be compiled in VS.NET 2005 environment. I don't have any issues with the compilation part and the EXE is generated. When I run the EXE the program is looping. Pls find below the source code: /* ------------------------------------------------------------------------ */ /* Program Name : GLDBACK2.C */ /* Last Modified : 03/11/08 - RMC - Creation date */ /* N.B. GLD0DETL has 190 fields and is 1287 bytes */ /* */ /* ------------------------------------------------------------------------ */ /************************************************************************** */ /* Reads dBase file and outputs as text file. */ /* Based on Valour Software freeware. */ /************************************************************************** */ #include <fcntl.h> #include <sys\types.h> #include <sys\stat.h> #include <io.h> #include <malloc.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct dbase_head { unsigned char version; /*03 for dbIII and 83 for dbIII w/memo file*/ unsigned char l_update[3]; /*yymmdd for last update*/ unsigned long count; /*number of records in file*/ unsigned int header; /*length of the header *includes the \r at end */ unsigned int lrecl; /*length of a record *includes the delete *byte */ unsigned char reserv[20]; } DBASE_HEAD; typedef struct dbase_fld { char name[11]; /*field name*/ char type; /*field type*/ #define DB_FLD_CHAR 'C' #define DB_FLD_NUM 'N' #define DB_FLD_LOGIC 'L' #define DB_FLD_MEMO 'M' #define DB_FLD_DATE 'D' /* A-T uses large data model but drop it for now */ //char far *data_ptr; /*pointer into buffer*/ unsigned char length;

    C A 2 Replies Last reply
    0
    • S Sadheesh R

      I have a C program, which has to be compiled in VS.NET 2005 environment. I don't have any issues with the compilation part and the EXE is generated. When I run the EXE the program is looping. Pls find below the source code: /* ------------------------------------------------------------------------ */ /* Program Name : GLDBACK2.C */ /* Last Modified : 03/11/08 - RMC - Creation date */ /* N.B. GLD0DETL has 190 fields and is 1287 bytes */ /* */ /* ------------------------------------------------------------------------ */ /************************************************************************** */ /* Reads dBase file and outputs as text file. */ /* Based on Valour Software freeware. */ /************************************************************************** */ #include <fcntl.h> #include <sys\types.h> #include <sys\stat.h> #include <io.h> #include <malloc.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct dbase_head { unsigned char version; /*03 for dbIII and 83 for dbIII w/memo file*/ unsigned char l_update[3]; /*yymmdd for last update*/ unsigned long count; /*number of records in file*/ unsigned int header; /*length of the header *includes the \r at end */ unsigned int lrecl; /*length of a record *includes the delete *byte */ unsigned char reserv[20]; } DBASE_HEAD; typedef struct dbase_fld { char name[11]; /*field name*/ char type; /*field type*/ #define DB_FLD_CHAR 'C' #define DB_FLD_NUM 'N' #define DB_FLD_LOGIC 'L' #define DB_FLD_MEMO 'M' #define DB_FLD_DATE 'D' /* A-T uses large data model but drop it for now */ //char far *data_ptr; /*pointer into buffer*/ unsigned char length;

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Some suggestions: - Please use the pre tag to format your code properly. As it is now, it is barely readable. - What do you mean by "it loops" exactly ? Is it hanging ? - Did you try to use your debugger to track down the problem ?

      Cédric Moonen Software developer
      Charting control [v3.0] OpenGL game tutorial in C++

      1 Reply Last reply
      0
      • S Sadheesh R

        I have a C program, which has to be compiled in VS.NET 2005 environment. I don't have any issues with the compilation part and the EXE is generated. When I run the EXE the program is looping. Pls find below the source code: /* ------------------------------------------------------------------------ */ /* Program Name : GLDBACK2.C */ /* Last Modified : 03/11/08 - RMC - Creation date */ /* N.B. GLD0DETL has 190 fields and is 1287 bytes */ /* */ /* ------------------------------------------------------------------------ */ /************************************************************************** */ /* Reads dBase file and outputs as text file. */ /* Based on Valour Software freeware. */ /************************************************************************** */ #include <fcntl.h> #include <sys\types.h> #include <sys\stat.h> #include <io.h> #include <malloc.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct dbase_head { unsigned char version; /*03 for dbIII and 83 for dbIII w/memo file*/ unsigned char l_update[3]; /*yymmdd for last update*/ unsigned long count; /*number of records in file*/ unsigned int header; /*length of the header *includes the \r at end */ unsigned int lrecl; /*length of a record *includes the delete *byte */ unsigned char reserv[20]; } DBASE_HEAD; typedef struct dbase_fld { char name[11]; /*field name*/ char type; /*field type*/ #define DB_FLD_CHAR 'C' #define DB_FLD_NUM 'N' #define DB_FLD_LOGIC 'L' #define DB_FLD_MEMO 'M' #define DB_FLD_DATE 'D' /* A-T uses large data model but drop it for now */ //char far *data_ptr; /*pointer into buffer*/ unsigned char length;

        A Offline
        A Offline
        Aescleal
        wrote on last edited by
        #3

        Did it compile on the platform you've been porting it from? If it didn't it might be worth debugging it there rather than using a tool you're unfamiliar with. Cheers, Ash

        S 1 Reply Last reply
        0
        • A Aescleal

          Did it compile on the platform you've been porting it from? If it didn't it might be worth debugging it there rather than using a tool you're unfamiliar with. Cheers, Ash

          S Offline
          S Offline
          Sadheesh R
          wrote on last edited by
          #4

          I am familiar only with VS.NET environment. I was able to debug and found that dbhead.lrecl property is showing "0". Also I don't have MC6 environment. But I am not able to guess why record length property (dbread.lrecl) is giving "0". If this has some value, then my EXE will work. Any ideas?

          A 1 Reply Last reply
          0
          • S Sadheesh R

            I am familiar only with VS.NET environment. I was able to debug and found that dbhead.lrecl property is showing "0". Also I don't have MC6 environment. But I am not able to guess why record length property (dbread.lrecl) is giving "0". If this has some value, then my EXE will work. Any ideas?

            A Offline
            A Offline
            Aescleal
            wrote on last edited by
            #5

            I'd look in db3_read_dic myself, that seems to be where the header's read. Start there and work out. Cheers, Ash

            S 1 Reply Last reply
            0
            • A Aescleal

              I'd look in db3_read_dic myself, that seems to be where the header's read. Start there and work out. Cheers, Ash

              S Offline
              S Offline
              Sadheesh R
              wrote on last edited by
              #6

              It is a VC++, Win32 project created in VS.NET 2005 environment. I knew where the header is being read. But the property dbhead.lrecl itself is giving a value of 0. It is just a straight forward property...

              A 1 Reply Last reply
              0
              • S Sadheesh R

                It is a VC++, Win32 project created in VS.NET 2005 environment. I knew where the header is being read. But the property dbhead.lrecl itself is giving a value of 0. It is just a straight forward property...

                A Offline
                A Offline
                Aescleal
                wrote on last edited by
                #7

                Okay, so you know something's going wrong with the read. Next step is to find out what! I can't answer this as I don't have (or want) access to your data file. So have you checked... - that the data's kosher - what you really think's in the file is in the file - that the compiler's not making some assumptions about the size of data objects? That code looks so old it might be a 16 bit relic or the compiler may have made different assumptions about structure packing and so on... Cheers, Ash

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups