[Dev-C++] Compilation of multiple files
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jan M. <jan...@vo...> - 2007-07-10 12:07:27
|
Hello, I have problems with compiling using gcc in Dev-C. I am trying to compile two .c and two .h files. In main.h I have preprocesor commands: #ifndef __stdio_h__ #include<stdio.h> #define __stdio_h__ #endif /* and the similarly with standard .h headers. */ #ifndef __bet_list_h__ #include "bet_list.h" #define __bet_list_h__ #endif #ifndef __bet_list_h__ #include "bet_list.h" #define __bet_list_h__ #endif In main.c and bet_list.c I have: #ifndef __main_h__ #include "main.h" #define __main_h__ #endif The output from make is: gcc main.c bet_list.c -o out_exe C:\DOCUME~1\tereza\LOCALS~1\Temp/ccqobaaa.o(.data+0x0):bet_list.c: multiple definition of `bet_no' C:\DOCUME~1\tereza\LOCALS~1\Temp/cc0Yaaaa.o(.data+0x0):main.c: first defined here C:\DOCUME~1\tereza\LOCALS~1\Temp/ccqobaaa.o(.data+0x4):bet_list.c: multiple definition of `max_bet_no' C:\DOCUME~1\tereza\LOCALS~1\Temp/cc0Yaaaa.o(.data+0x4):main.c: first defined here C:\DOCUME~1\tereza\LOCALS~1\Temp/ccqobaaa.o(.data+0x8):bet_list.c: multiple definition of `d_name' C:\DOCUME~1\tereza\LOCALS~1\Temp/cc0Yaaaa.o(.data+0x8):main.c: first defined here C:\DOCUME~1\tereza\LOCALS~1\Temp/ccqobaaa.o(.data+0x10):bet_list.c: multiple definition of `d_description' C:\DOCUME~1\tereza\LOCALS~1\Temp/cc0Yaaaa.o(.data+0x10):main.c: first defined here C:\DOCUME~1\tereza\LOCALS~1\Temp/ccqobaaa.o(.data+0x18):bet_list.c: multiple definition of `d_multiplicator' C:\DOCUME~1\tereza\LOCALS~1\Temp/cc0Yaaaa.o(.data+0x18):main.c: first defined here C:\DOCUME~1\tereza\LOCALS~1\Temp/ccqobaaa.o(.data+0x20):bet_list.c: multiple definition of `d_calculation' C:\DOCUME~1\tereza\LOCALS~1\Temp/cc0Yaaaa.o(.data+0x20):main.c: first defined here C:\DOCUME~1\tereza\LOCALS~1\Temp/ccqobaaa.o(.data+0x28):bet_list.c: multiple definition of `module_name' C:\DOCUME~1\tereza\LOCALS~1\Temp/cc0Yaaaa.o(.data+0x28):main.c: first defined here C:\DOCUME~1\tereza\LOCALS~1\Temp/cc0Yaaaa.o(.text+0xb2):main.c: undefined reference to `print_' collect2: ld returned 1 exit status make: *** [build] Error 1 Anyone knows where is an error. I have tried to do it using just simple #include, without the definition the preprocesor variables but it doesn't work neither. Thank you very much Jan Mura jan...@vo... |