Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 08-01-2005, 08:40 AM   #1
Jonas Brannstrom
LQ Newbie
Registered: Jul 2005
Posts: 3

Rep: Reputation: 0
gcc compiling problems

Trying to compile code on Linux gcc 3.4.3-22.1 that works on several other Unix systems with differnt compilers. When I try to compile on gcc I get error as follow below. My qustions are: Why does not gcc accept this when other compilers on other platforms do? What do I need to do to solve this?

I would be thankful for any help or commnts on this.


gcc -W -Wall -Wpointer-arith -Wstrict-prototypes -Wshadow -Wwrite-strings -Waggregate-return -Wredundant-decls -Wnested-externs -Wmissing-declarations -Wcast-align -Wno-long-long -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -DOS_LINUX -posix -DFORC_OBJECT_MAP -O2 -I../../Common/include -I../../DatabaseExit/Oracle/src/include -I/export/oracle/product/ -I/export/oracle/product/ -I/export/oracle/product/ -I/export/oracle/product/ -I. -Icommon_source -ILinux/r -I/tmp/force/public/source -I/tmp/force/public/include -I/tmp/force/external/ACE_wrappers -I/tmp/force/external/openssl/Linux/include -I/tmp/force/external/ncipher/Linux/include -I/tmp/force/external/BSafe_CryptoC_ME/include -DEURO -DSET_REUSEADDR -c -o Linux/r/iamdist.o iamdist.c
In file included from /tmp/force/public/include/forc/cryptoid.h:11,
from ../../Common/include/cpt.h:10,
from iamdist.c:29:
/tmp/force/public/include/forc/somtypes.h:1186: redefinition of `ISAXParser'
/tmp/force/public/include/forc/somtypes.h:16: `ISAXParser' previously declared here
Old 08-01-2005, 07:23 PM   #2
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196

Rep: Reputation: 33
Maybe you could post the file to see at that gives an error.

As a general rule different compilers behave differently. Some implement C89 standard other C99, other compile code default as they are C++ and many other things.

Also this could be a platform problem. I guess on different platforms you don't execute exatly this line (it has some definitions regarding x86 and i386). Maybe there is code activated by this, for example :

#ifdef i386
        typedef int x;

typedef int x;
Old 08-02-2005, 03:21 AM   #3
Jonas Brannstrom
LQ Newbie
Registered: Jul 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you for helping me with this. Here are parts of the file that contains the error.

Thanks again!


#ifndef __SOMTYPES_H__
#define __SOMTYPES_H__

*   @file somtypes.h
*   @brief SOM type definitions.
*   This file contains definitions dealing primarily with declaring and defining
*   SOM interfaces.
#include "forc/base.h"
#include "forc/somdefs.h"

typedef interface ISAXParser ISAXParser;

/* Some other stuff goes here*/

    STDMETHOD( parse )( QBYTE* pData, QUINT32 uiDataLen, ISAXHandler* pHandler ) PURE;
    STDMETHOD( setElementHandler )( ISAXHandler* pHandler ) PURE;

}; /* ISAXParser */

/** Some other stuff goes here*/

#endif /* __SOMTYPES_H__ */
Old 08-02-2005, 04:12 PM   #4
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38

Where did you get the "forc" code from? If it is public domain/open source then please post the base.h, somdefs.h, and some parts of the somtypes.h (a dozen or so lines from around line 16, and a dozen or so lines from around line 1186) include files.

The problem that you are seeing is because the declaration of "ISAXParser" is occuring twice. First around line 16, and then again around line 1186.

We would need to see the scope of the declarations, and the context in order to help identify the problem.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Problems compiling gcc. sombre1 Linux - Software 3 07-17-2005 06:28 PM
compiling problems with gcc 3.4 1337 Twinkie Linux - Software 1 05-13-2005 04:51 PM
Problems Compiling Problems With GCC And C++ phnxbn Linux - Software 0 11-02-2004 06:49 PM
GCC 3.2.2 - problems compiling MeinVerstand Linux - General 0 05-25-2004 02:24 PM
problems compiling Palm Emulator w/ gcc billder3 Linux - Newbie 1 06-28-2001 12:34 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:00 AM.

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