This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

compile error


I'm receiving a compile time error message that I could use some help
interpreting:

/usr/lib/libcygwin.a(libcmain.o)(.text+0x6a):libcmain.c: undefined reference to
`WinMain@16'
collect2: ld returned 1 exit status

Here's the full command that is being executed at the time of the error:

$ make -fgnumakefile systemdep.lib
gcc -MMD -D_68302 -Ie:/microtec/tools/include -Ie:/vss/working/source/rtos
-Ie:/vss/working/source/s
ystem  -DDEBUG -DEMUL -DFINCH -o fletcher.d fletcher.c; \
  sed -e 's/\.o:/.o01:/' < fletcher.d > deps/fletcher.DEP; \
  sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$//' \
      -e '/^$/ d' -e 's/$/ :/' < fletcher.d >> deps/fletcher.DEP;
/usr/lib/libcygwin.a(libcmain.o)(.text+0x6a):libcmain.c: undefined reference to
`WinMain@16'
collect2: ld returned 1 exit status
cannot open fletcher.d: no such file
cannot open fletcher.d: no such file
make: *** [fletcher.o01] Error 2

The source is short so I have included it below.  I don't see anything that
would lead toward WinMain@16.  

Any ideas would be appreciated.

Steve

fletcher.c:
#include "fletcher.h"


/*
 * Function Name:  ComputeCheckSum()
 *
 * Description: 
 * Compute the Checksum of a block of memory.
 *
 * Calculate the checksum of a block using Fletcher's method.
 * 
 *
 * Parameters: pucBuffer    - Buffer containing the data to be checksummed.
 *             ulLength     - Number of bytes in the buffer to be checksummed.
 *
 * Calls: 
 *  None
 *
 * Return(s): 
 *  ComputedCheckSum
 *
 * See Also:
 *  
 */


Ushort ComputeCheckSum(Uchar *pucBuffer, Ulong ulLength)
{
  Uchar sum1 = 0;
  Ulong sum2 = 0;

  if (ulLength == 0) return (0);

  do {
    sum1 += *pucBuffer++;
    sum2 += sum1;
  } while (--ulLength);
  sum2 = 256 - ((sum2 + sum1) & 0xff);
  sum1 = (Uchar)(256 - (Uchar)(sum1 + sum2));
  sum2 <<= 8;
  sum2 |= (Ulong)sum1;
  return ((Ushort)sum2);
}

fletcher.h:

#ifndef FLETCHER_H
#define FLETCHER_H

#include "system.h"

extern Ushort ComputeCheckSum(Uchar *pucBuffer, Ulong ulLength);


#endif /* FLETCHER_H */

Here's system.h

#ifndef _SYSTEM_H /* [ */
#define _SYSTEM_H

#ifdef __cplusplus
extern "C" {
#endif


/* Configure the number of independent hrdw channels in the device */
#ifdef PC_SIM /* [ */
  #define NUM_OF_CHANNELS     2
#else /* ][ */
  #define NUM_OF_CHANNELS     1
#endif /* PC_SIM ] */

/* Define the endian of the processor */
#if defined(WIN32)
  #define _MOTOROLA     (0)
  #define _INTEL        (1)
#elif (defined(_lint) || defined(__mcore) || defined(PC_SIM) || defined
(_68302))  /* [ */
  #define _MOTOROLA     (1)
  #define _INTEL        (0)
#else /* ][ */
  #error "ENDIAN Format not defined"
#endif /* Select Endian Format ] */


typedef void                Void;       /* Void (empty type) */
typedef signed char         Char;       /* Signed 8 bits */
typedef unsigned char       Uchar;      /* Unsigned 8 bits */
typedef signed short        Short;      /* Signed 16 bits */
typedef unsigned short      Ushort;     /* Unsigned 16 bits */
typedef signed short int    Int;        /* Signed 16 bits */  
typedef unsigned short int  Uint;       /* Unsigned 16 bits */
typedef signed long         Long;       /* Signed 32 bits */
typedef unsigned long       Ulong;      /* Unsigned 32 bits */


/* Boolean enumerated type: Preferred boolean type */
typedef enum {
    E_FALSE=0u, E_TRUE=255u
} EBoolean;


// Macro which is an identity in DEBUG mode, but is empty otherwise 
#ifdef DEBUG /* [ */
  #define DBG_ONLY(x) x
#else /* ][ */
  #define DBG_ONLY(x)
#endif /* DEBUG ] */


#if defined(EMUL) && !defined(_lint) /* [ */
  // This macro creates a dummy function to allow easy access
  // to source files while using the emulator.  Do not use this
  // macro directly in 'C' source files.  Instead, use the
  // CREATE_EMUL_FILENAME_TAG() macro below.
  #define EMUL_FILENAME(name) void name##_c(void) { }

  // This macro is needed to force the preprocessor to expand the 
  // __FILENAME__ definition below.
  #define EMUL_FILENAME_FN_MACRO_EXPAND(name) EMUL_FILENAME(name)


  // Place the CREATE_EMUL_FILENAME_TAG() macro in a 'C' source
  // file to allow emulator access by filename.  For example, 
  // to access the file "queue.c" on the emulator, type "queue_c"
  // in the code display box.
  #define CREATE_EMUL_FILENAME_TAG()
EMUL_FILENAME_FN_MACRO_EXPAND(__FILENAME__)
#else /* ][ */
  #define CREATE_EMUL_FILENAME_TAG() enum { NON_EMUL_FN_TAG_TO_TRICK_LINT }
#endif /* EMUL && !LINT ] */


/* Standard returned value for success/fail */
#ifndef SUCCESS /* [ */
  #define SUCCESS                              0
#endif /* !SUCCESS ] */
#ifndef FAIL /* [ */
  #define FAIL                                (!SUCCESS)
#endif /* !FAIL ] */

#endif /* !_SYSTEM_H ] */




__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]