LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-07-2006, 10:45 PM   #1
zongtongyi
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
Question compiling 1394 error?


I have making a projet -TCP/IP transmitting based on IEEE1394.That is packeting the data using TCP/IP
stack and transmitting the packets using IEEE1394 device driver.
I have realised the TCP/IP stack and 1394 interface,then make it and met problems.

This is the errors,compiled by gcc-3.2.2
1394.c:32: conflicting types for `InitM1394'
1394.h:15: previous declaration of `InitM1394'
1394.c: In function `InitM1394':
1394.c:42: parse error before '(' token
1394.c: At top level:
1394.c:54: parse error before '->' token
1394.c:61: parse error before numeric constant
1394.c:61: conflicting types for `set_active_port'
1394.h:27: previous declaration of `set_active_port'
1394.c:63: parse error before '->' token
1394.c:63: conflicting types for `raw1394_set_userdata'
/usr/include/libraw1394/raw1394.h:46: previous declaration of `raw1394_set_userdata'
1394.c:64: parse error before '->' token
1394.c:64: conflicting types for `raw1394_set_fcp_handler'
/usr/include/libraw1394/raw1394.h:148: previous declaration of `raw1394_set_fcp_handler'
1394.c:65: parse error before '->' token
1394.c:65: conflicting types for `raw1394_set_bus_reset_handler'
/usr/include/libraw1394/raw1394.h:99: previous declaration of `raw1394_set_bus_reset_handler'
1394.c:67: parse error before '->' token
1394.c:72: parse error before '->' token
1394.c:72: conflicting types for `raw1394_set_iso_handler'
/usr/include/libraw1394/raw1394.h:137: previous declaration of `raw1394_set_iso_handler'
1394.c:78: conflicting types for `ExitM1394'
1394.h:21: previous declaration of `ExitM1394'
1394.c:83: conflicting types for `isOK'
1394.h:22: previous declaration of `isOK'
1394.c:88: conflicting types for `get_current_error_msg'
1394.h:23: previous declaration of `get_current_error_msg'
1394.c:93: conflicting types for `get_generation'
1394.h:24: previous declaration of `get_generation'
1394.c:98: conflicting types for `get_port_count'
1394.h:25: previous declaration of `get_port_count'
1394.c:103: conflicting types for `get_port_info'
1394.h:26: previous declaration of `get_port_info'
1394.c:112: conflicting types for `set_active_port'
1394.c:61: previous declaration of `set_active_port'
1394.c:198: conflicting types for `async_read'
1394.h:28: previous declaration of `async_read'
1394.c:206: conflicting types for `async_write'
1394.h:29: previous declaration of `async_write'
1394.c:213: conflicting types for `async_lock'
1394.h:30: previous declaration of `async_lock'
1394.c:219: conflicting types for `async_iso_write'
1394.h:31: previous declaration of `async_iso_write'
1394.c:227: conflicting types for `sync_read'
1394.h:32: previous declaration of `sync_read'
1394.c:233: conflicting types for `sync_write'
1394.h:33: previous declaration of `sync_write'
1394.c:239: conflicting types for `sync_lock'
1394.h:34: previous declaration of `sync_lock'
1394.c:245: conflicting types for `sync_iso_write'
1394.h:35: previous declaration of `sync_iso_write'
1394.c:250: conflicting types for `pollForLeftOverMessages'
1394.h:36: previous declaration of `pollForLeftOverMessages'
1394.c:270: conflicting types for `InitPortInfo'
1394.h:57: previous declaration of `InitPortInfo'
1394.c:276: conflicting types for `getTotalNodes'
1394.h:58: previous declaration of `getTotalNodes'
1394.c:281: conflicting types for `getName'
1394.h:59: previous declaration of `getName'
1394.c:286: conflicting types for `setName'
1394.h:60: previous declaration of `setName'
1394.c:291: conflicting types for `setTotalNodes'
1394.h:61: previous declaration of `setTotalNodes'
1394.c:296: conflicting types for `start_iso_rcv'
1394.h:37: previous declaration of `start_iso_rcv'
1394.c:301: conflicting types for `stop_iso_rcv'
1394.h:38: previous declaration of `stop_iso_rcv'
1394.c:306: conflicting types for `process_msg'
1394.h:41: previous declaration of `process_msg'
1394.c:311: conflicting types for `start_fcp_listen'
1394.h:39: previous declaration of `start_fcp_listen'
1394.c:316: conflicting types for `stop_fcp_listen'
1394.h:40: previous declaration of `stop_fcp_listen'
1394.c:321: conflicting types for `get_local_id'
1394.h:42: previous declaration of `get_local_id'
1394.c:326: conflicting types for `set_fcp_handler'
1394.h:43: previous declaration of `set_fcp_handler'
1394.c:345: conflicting types for `generic_send_command'
1394.h:44: previous declaration of `generic_send_command'
1394.c:366: conflicting types for `fcp_send_response'
1394.h:46: previous declaration of `fcp_send_response'
1394.c:371: conflicting types for `fcp_send_command'
1394.h:45: previous declaration of `fcp_send_command'
1394.c:376: conflicting types for `set_busreset_handler'
1394.h:50: previous declaration of `set_busreset_handler'
1394.c:381: conflicting types for `set_iso_handler'
1394.h:48: previous declaration of `set_iso_handler'
1394.c:386: conflicting types for `isowrite'
1394.h:47: previous declaration of `isowrite'
1394.c:406: conflicting types for `set_tag_handler'
1394.h:49: previous declaration of `set_tag_handler'
1394.c:411: conflicting types for `set_userdata'
1394.h:51: previous declaration of `set_userdata'
1394.c:416: conflicting types for `get_userdata'
1394.h:52: previous declaration of `get_userdata'
1394.c:435: conflicting types for `generate_bus_reset'
1394.h:55: previous declaration of `generate_bus_reset'
1394.c:442: conflicting types for `get_node_count'
1394.h:55: previous declaration of `get_node_count'
make: *** [1394.o] Error 1
 
Old 04-08-2006, 10:27 AM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Well "previous declaration" errors normally mean that you are including the header file too many times.
 
Old 04-08-2006, 11:22 AM   #3
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Quote:
Originally Posted by graemef
Well "previous declaration" errors normally mean that you are including the header file too many times.
Or maybe it could be defined in the header file and again in the C file. If graemef is right, try wrapping your .h file in an ifndef macro, like:
Code:
#ifndef _MY_1394_H
#define _MY_1394_H

... /* defs go here */

#endif
If it's the latter problem (redefined in .c file; it looks from your errors that this is the case) then only use the C file for the implementation, not the definition. For example, function definitions like
Code:
void foo(int x);
go in the header and function implementations like
Code:
void foo(int x) {
    printf("%d\n", x);
}
go in the C file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
1394 programming? zongtongyi Programming 1 04-08-2006 03:34 AM
i get an error ./term.c :95 error conflicting types of tpam when compiling bitchx eveningblush Programming 0 03-30-2006 06:46 AM
Error compiling php 5.1 and also a fantastico error arachn1d Linux - Software 0 02-19-2006 04:52 PM
Networking Usign 1394 (IP over 1394) sapna Programming 2 04-06-2005 06:54 AM
dvgrab - raw 1394 error santner Linux - Software 2 12-21-2004 09:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration