struct: command not found

Hi,

I am developing a application using C language. In my case I am using a common header file for store constant variables and structures. But in the compilation stage it will displaying this error.

My common header file " Configuration.h "
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * Configuration.h
 *
 *  Created on: Oct 8, 2013
 *      Author: Dushantha Bandara Rathnayake
 */

#ifndef CONFIGURATION_H_
#define CONFIGURATION_H_

#define RET_SUCCESS							         0
#define RET_INVAL_PORT						        -1
#define RET_QUEUE_IS_FULL					        -2
#define RET_QUEUE_IS_GOING_TO_DESTROY		-3
#define RET_WRITE_TO_CLIENT_FAIL			        -4
#define RET_CLIENT_DISCONNECT_ERR			        -5
#define RET_CLIENT_SOCKET_CLOSE_ERR			-6
#define RET_CRC_MISMATCH					        -7
#define RET_INVAL_DATA_LEN					        -8


struct REQUEST_OBJ{
	int *socketFD;
	char request[2048];
};

#endif /* CONFIGURATION_H_ */


Output

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
./config/Configuration.h
./config/Configuration.h: line 1: /bin: is a directory
comm: extra operand `Debug'
Try `comm --help' for more information.
comm: extra operand `Debug'
Try `comm --help' for more information.
comm: extra operand `Debug'
Try `comm --help' for more information.
comm: extra operand `Debug'
Try `comm --help' for more information.
./config/Configuration.h: line 6: comm/: is a directory
./config/Configuration.h: line 22: struct: command not found
./config/Configuration.h: line 23: int: command not found
./config/Configuration.h: line 24: char: command not found
./config/Configuration.h: line 25: syntax error near unexpected token `}'
./config/Configuration.h: line 25: `};'
make: *** [RequestQueue.o] Error 2


Please help me to fix this.

Thank you.
Last edited on
It looks like you try to run the file as a shell script but that will of course not work. Not sure if you are trying to compile the file. Normally only source files are compiled, not header files.
Don't compile it but when you compile an implementation file that includes it use "-I /path/to/folder/with/header" so it can find the header file if it is not in the system include directories (e.g. /usr/include, /usr/local/include, etc.)
Hi,

Sorry for the delay and Thanks for the reply's. The problem is solved. I do not know the real reason. This is what I did.

Header file

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef CONFIGURATION_H_
#define CONFIGURATION_H_

#define RET_SUCCESS							         0
#define RET_INVAL_PORT						        -1
#define RET_QUEUE_IS_FULL					        -2
#define RET_QUEUE_IS_GOING_TO_DESTROY		-3
#define RET_WRITE_TO_CLIENT_FAIL			        -4
#define RET_CLIENT_DISCONNECT_ERR			        -5
#define RET_CLIENT_SOCKET_CLOSE_ERR			-6
#define RET_CRC_MISMATCH					        -7
#define RET_INVAL_DATA_LEN					        -8

#endif 


I did remove the comment. And put the structure into another header file.

Thank you.
Last edited on
Topic archived. No new replies allowed.