HEADS-project / heads_ide

http://heads-project.eu
9 stars 2 forks source link

C Compiler generates erroneous code when thing and configuration have the same name #43

Closed brice-morin closed 9 years ago

brice-morin commented 9 years ago

Though it might not be recommended to have a configuration and a thing having the same name, this is valid and should be supported by all compiler. The C compiler currently does not support that feature and generates a long list of error on make

cc -O2 -w -c ChatServer.c 
cc -O2 -w -c ChatClient.c 
cc -O2 -w -c CPrinter.c 
cc -O2 -w -c runtime.c 
cc -o ChatServer ChatServer.o ChatClient.o CPrinter.o ChatServer.o runtime.o -lpthread  -lm
ChatServer.o: In function `enqueue_ChatServer_send_chatRoom_chat_stop':
ChatServer.c:(.text+0x0): multiple definition of `enqueue_ChatServer_send_chatRoom_chat_stop'
ChatServer.o:ChatServer.c:(.text+0x0): first defined here
ChatServer.o: In function `enqueue_ChatServer_send_chatRoom_chat':
ChatServer.c:(.text+0xd0): multiple definition of `enqueue_ChatServer_send_chatRoom_chat'
ChatServer.o:ChatServer.c:(.text+0xd0): first defined here
ChatServer.o: In function `enqueue_ChatServer_send_Print_customPrint':
ChatServer.c:(.text+0x1a0): multiple definition of `enqueue_ChatServer_send_Print_customPrint'
ChatServer.o:ChatServer.c:(.text+0x1a0): first defined here
ChatServer.o: In function `enqueue_ChatClient_send_chatRoom_chat_start':
ChatServer.c:(.text+0x310): multiple definition of `enqueue_ChatClient_send_chatRoom_chat_start'
ChatServer.o:ChatServer.c:(.text+0x310): first defined here
ChatServer.o: In function `enqueue_ChatClient_send_chatRoom_chat_stop':
ChatServer.c:(.text+0x3e0): multiple definition of `enqueue_ChatClient_send_chatRoom_chat_stop'
ChatServer.o:ChatServer.c:(.text+0x3e0): first defined here
ChatServer.o: In function `enqueue_ChatClient_send_chatRoom_chat':
ChatServer.c:(.text+0x4b0): multiple definition of `enqueue_ChatClient_send_chatRoom_chat'
ChatServer.o:ChatServer.c:(.text+0x4b0): first defined here
ChatServer.o: In function `enqueue_ChatClient_send_Print_customPrint':
ChatServer.c:(.text+0x580): multiple definition of `enqueue_ChatClient_send_Print_customPrint'
ChatServer.o:ChatServer.c:(.text+0x580): first defined here
ChatServer.o: In function `dispatch_ChatClient_send_chatRoom_chat_start':
ChatServer.c:(.text+0x6f0): multiple definition of `dispatch_ChatClient_send_chatRoom_chat_start'
ChatServer.o:ChatServer.c:(.text+0x6f0): first defined here
ChatServer.o: In function `dispatch_ChatClient_send_chatRoom_chat_stop':
ChatServer.c:(.text+0x720): multiple definition of `dispatch_ChatClient_send_chatRoom_chat_stop'
ChatServer.o:ChatServer.c:(.text+0x720): first defined here
ChatServer.o: In function `dispatch_ChatClient_send_chatRoom_chat':
ChatServer.c:(.text+0x750): multiple definition of `dispatch_ChatClient_send_chatRoom_chat'
ChatServer.o:ChatServer.c:(.text+0x750): first defined here
ChatServer.o: In function `dispatch_ChatClient_send_Print_customPrint':
ChatServer.c:(.text+0x780): multiple definition of `dispatch_ChatClient_send_Print_customPrint'
ChatServer.o:ChatServer.c:(.text+0x780): first defined here
ChatServer.o: In function `dispatch_ChatServer_send_chatRoom_chat_stop':
ChatServer.c:(.text+0x7b0): multiple definition of `dispatch_ChatServer_send_chatRoom_chat_stop'
ChatServer.o:ChatServer.c:(.text+0x7b0): first defined here
ChatServer.o: In function `dispatch_ChatServer_send_chatRoom_chat':
ChatServer.c:(.text+0x7c0): multiple definition of `dispatch_ChatServer_send_chatRoom_chat'
ChatServer.o:ChatServer.c:(.text+0x7c0): first defined here
ChatServer.o: In function `dispatch_ChatServer_send_Print_customPrint':
ChatServer.c:(.text+0x7f0): multiple definition of `dispatch_ChatServer_send_Print_customPrint'
ChatServer.o:ChatServer.c:(.text+0x7f0): first defined here
ChatServer.o: In function `processMessageQueue':
ChatServer.c:(.text+0x810): multiple definition of `processMessageQueue'
ChatServer.o:ChatServer.c:(.text+0x810): first defined here
ChatServer.o: In function `initialize_configuration_ChatServer':
ChatServer.c:(.text+0xb40): multiple definition of `initialize_configuration_ChatServer'
ChatServer.o:ChatServer.c:(.text+0xb40): first defined here
ChatServer.o: In function `main':
ChatServer.c:(.text.startup+0x0): multiple definition of `main'
ChatServer.o:ChatServer.c:(.text.startup+0x0): first defined here
ChatServer.o: In function `initialize_configuration_ChatServer':
ChatServer.c:(.text+0xb4a): undefined reference to `register_ChatServer_send_chatRoom_chat_listener'
ChatServer.c:(.text+0xb54): undefined reference to `register_ChatServer_send_chatRoom_chat_stop_listener'
ChatServer.c:(.text+0xb5e): undefined reference to `register_ChatServer_send_Print_customPrint_listener'
ChatServer.c:(.text+0xc42): undefined reference to `ChatServer_behavior_OnEntry'
ChatServer.o: In function `dispatch_ChatClient_send_chatRoom_chat_start':
ChatServer.c:(.text+0x70e): undefined reference to `ChatServer_handle_chatRoom_chat_start'
ChatServer.o: In function `dispatch_ChatClient_send_chatRoom_chat_stop':
ChatServer.c:(.text+0x73e): undefined reference to `ChatServer_handle_chatRoom_chat_stop'
ChatServer.o: In function `dispatch_ChatClient_send_chatRoom_chat':
ChatServer.c:(.text+0x76e): undefined reference to `ChatServer_handle_chatRoom_chat'
ChatServer.o: In function `initialize_configuration_ChatServer':
ChatServer.c:(.text+0xb4a): undefined reference to `register_ChatServer_send_chatRoom_chat_listener'
ChatServer.c:(.text+0xb54): undefined reference to `register_ChatServer_send_chatRoom_chat_stop_listener'
ChatServer.c:(.text+0xb5e): undefined reference to `register_ChatServer_send_Print_customPrint_listener'
ChatServer.c:(.text+0xc42): undefined reference to `ChatServer_behavior_OnEntry'
ChatServer.o: In function `dispatch_ChatClient_send_chatRoom_chat_start':
ChatServer.c:(.text+0x70e): undefined reference to `ChatServer_handle_chatRoom_chat_start'
ChatServer.o: In function `dispatch_ChatClient_send_chatRoom_chat_stop':
ChatServer.c:(.text+0x73e): undefined reference to `ChatServer_handle_chatRoom_chat_stop'
ChatServer.o: In function `dispatch_ChatClient_send_chatRoom_chat':
ChatServer.c:(.text+0x76e): undefined reference to `ChatServer_handle_chatRoom_chat'
collect2: error: ld returned 1 exit status
make: *** [ChatServer] Error 1
brice-morin commented 9 years ago

@Lyadis is that still an issue?

nharrand commented 9 years ago

Yes it is. But i'm on it.

nharrand commented 9 years ago

Ok, it should work now, at least with the latest version of the compiler.