retrohackers.org
https://www.retrohackers.org/

uIP in windows ..
https://www.retrohackers.org/viewtopic.php?f=5&t=110
Page 1 of 1

Author:  Bones [ Mon Jun 12, 2006 8:38 pm ]
Post subject:  uIP in windows ..

Hi ..
I'm trying to compile one of the sample applications for uIP under win32 using cl65 in Crimson editor.

This is the output I'm getting :

Code:
Opened include file `hello-world.h'
Opened include file `C:\Program Files\cc65\include/uipopt.h'
C:\Program Files\cc65\include/uipopt.h(70): Error: Include file `uip-conf.h' not
 found
Input: #include "uip-conf.h"
Opened include file `C:\Program Files\cc65\include/psock.h'
Opened include file `C:\Program Files\cc65\include/uipopt.h'
Opened include file `C:\Program Files\cc65\include/pt.h'
Opened include file `C:\Program Files\cc65\include/lc.h'
Opened include file `C:\Program Files\cc65\include/lc-switch.h'
C:\Program Files\cc65\include/psock.h(96): Error: Type expected
Input: u8_t *ptr;
C:\Program Files\cc65\include/psock.h(96): Error: `;' expected
Input: u8_t *ptr;
C:\Program Files\cc65\include/psock.h(96): Error: Type expected
Input: u8_t *ptr;
C:\Program Files\cc65\include/psock.h(110): Error: Type expected
Input: const u8_t *sendptr;
C:\Program Files\cc65\include/psock.h(110): Error: `;' expected
Input: const u8_t *sendptr;
C:\Program Files\cc65\include/psock.h(110): Error: Type expected
Input: const u8_t *sendptr;
C:\Program Files\cc65\include/psock.h(111): Error: Type expected
Input: u8_t *readptr;
C:\Program Files\cc65\include/psock.h(111): Error: Multiple definition for `u8_t
'
Input: u8_t *readptr;
C:\Program Files\cc65\include/psock.h(111): Error: `;' expected
Input: u8_t *readptr;
C:\Program Files\cc65\include/psock.h(111): Error: Type expected
Input: u8_t *readptr;
C:\Program Files\cc65\include/psock.h(111): Fatal: Too many errors
Input: u8_t *readptr;
Press any key to exit


Any idea what is going wrong ? My C is not so hot ..

Author:  Bones64 [ Mon Jun 12, 2006 10:08 pm ]
Post subject: 

OK ..
I managed to find the missing .h files and included them in my CC65_INCLUDE path.

I also had to replace #include <Inttypes.h> with #include <stdtypes.h> which seemed to work ..

Now I have this problem..

Code:
Opened include file `hello-world.h'
Opened include file `C:\Program Files\cc65\include/uipopt.h'
Opened include file `C:\Program Files\cc65\include/uip-conf.h'
Opened include file `C:\Program Files\cc65\include/stdint.h'
Opened include file `C:\Program Files\cc65\include/webserver.h'
Opened include file `C:\Program Files\cc65\include/httpd.h'
Opened include file `C:\Program Files\cc65\include/psock.h'
Opened include file `C:\Program Files\cc65\include/uipopt.h'
Opened include file `C:\Program Files\cc65\include/pt.h'
Opened include file `C:\Program Files\cc65\include/lc.h'
Opened include file `C:\Program Files\cc65\include/lc-switch.h'
Opened include file `C:\Program Files\cc65\include/httpd-fs.h'
Opened include file `C:\Program Files\cc65\include/psock.h'
Opened include file `C:\Program Files\cc65\include/uip.h'
Opened include file `C:\Program Files\cc65\include/uipopt.h'
Opened include file `C:\Program Files\cc65\include/string.h'
Opened include file `C:\Program Files\cc65\include/stddef.h'
hello-world.c(91): Error: Expression expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Warning: Statement has no effect
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Error: `;' expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Error: Expression expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Warning: Statement has no effect
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Error: `;' expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Error: Expression expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Warning: Statement has no effect
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Error: `;' expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Error: Expression expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Warning: Statement has no effect
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Error: `;' expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Error: Expression expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Warning: Statement has no effect
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Error: `;' expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Error: Expression expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
hello-world.c(91): Fatal: Too many errors
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);
Press any key to exit

Author:  RaveGuru [ Tue Jun 13, 2006 12:08 am ]
Post subject: 

Something is missing. What does hello-world.c look like?

Author:  Bones [ Tue Jun 13, 2006 7:58 am ]
Post subject: 

ver simple app :

Code:

/**
 * \addtogroup helloworld
 * @{
 */

/**
 * \file
 *         An example of how to write uIP applications
 *         with protosockets.
 * \author
 *         Adam Dunkels <adam@sics.se>
 */

/*
 * This is a short example of how to write uIP applications using
 * protosockets.
 */

/*
 * We define the application state (struct hello_world_state) in the
 * hello-world.h file, so we need to include it here. We also include
 * uip.h (since this cannot be included in hello-world.h) and
 * <string.h>, since we use the memcpy() function in the code.
 */
#include "hello-world.h"
#include "uip.h"
#include <string.h>

/*
 * Declaration of the protosocket function that handles the connection
 * (defined at the end of the code).
 */
static int handle_connection(struct hello_world_state *s);
/*---------------------------------------------------------------------------*/
/*
 * The initialization function. We must explicitly call this function
 * from the system initialization code, some time after uip_init() is
 * called.
 */
void
hello_world_init(void)
{
  /* We start to listen for connections on TCP port 1000. */
  uip_listen(HTONS(1000));
}
/*---------------------------------------------------------------------------*/
/*
 * In hello-world.h we have defined the UIP_APPCALL macro to
 * hello_world_appcall so that this funcion is uIP's application
 * function. This function is called whenever an uIP event occurs
 * (e.g. when a new connection is established, new data arrives, sent
 * data is acknowledged, data needs to be retransmitted, etc.).
 */
void
hello_world_appcall(void)
{
  /*
   * The uip_conn structure has a field called "appstate" that holds
   * the application state of the connection. We make a pointer to
   * this to access it easier.
   */
  struct hello_world_state *s = &(uip_conn->appstate);

  /*
   * If a new connection was just established, we should initialize
   * the protosocket in our applications' state structure.
   */
  if(uip_connected()) {
    PSOCK_INIT(&s->p, s->inputbuffer, sizeof(s->inputbuffer));
  }

  /*
   * Finally, we run the protosocket function that actually handles
   * the communication. We pass it a pointer to the application state
   * of the current connection.
   */
  handle_connection(s);
}
/*---------------------------------------------------------------------------*/
/*
 * This is the protosocket function that handles the communication. A
 * protosocket function must always return an int, but must never
 * explicitly return - all return statements are hidden in the PSOCK
 * macros.
 */
static int
handle_connection(struct hello_world_state *s)
{
  PSOCK_BEGIN(&s->p);
 
 
  PSOCK_SEND_STR(&s->p, "Hello. What is your name?\n");
  PSOCK_READTO(&s->p, '\n');
  strncpy(s->name, s->inputbuffer, sizeof(s->name));
  PSOCK_SEND_STR(&s->p, "Hello ");
  PSOCK_SEND_STR(&s->p, s->name);
  PSOCK_CLOSE(&s->p);

  PSOCK_END(&s->p);
}
/*---------------------------------------------------------------------------*/

[/code]

Author:  RaveGuru [ Tue Jun 13, 2006 11:52 am ]
Post subject: 

Code:
hello-world.c(91): Error: Expression expected
Input: do { (((&((&s->p)->pt))))->lc = __LINE__; case __LINE__:; if(!(!(((psock_
send(&s->p, "Hello. What is your name?\n", strlen("Hello. What is your name?\n")
)) == 0)))) { return 0; } } while(0);


The defines seem a bit screwed up. Try re-ordering your #include's, putting the standard libraries first, followed by the "global" ones, such as pt.h, psock.h, uipopt.h, uip.h and so on, then the local ones, such as webserver.h and httpd-fs.h, and finally hello-world.h. Thus you'll be sure that all macros and define's are defined before used.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/