public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* some GCC questions
@ 2003-08-31 13:19 Jonathan Wilson
  2003-08-31 14:36 ` Using C functions in C++ albert
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wilson @ 2003-08-31 13:19 UTC (permalink / raw)
  To: gcc-help

1.does GCC supprt Structured Exception Handling in any way?
2.does GCC supprt Thread Local Storage in any way?
and 3.how does GCC handle constructors/destructors? I know its got 
something to do with the .ctors segment (for constructors) but how does the 
linker match the segments up so that all the constructors get called?

I am interested in adding support to the windows version of GCC for these 
things (i.e. SEH and TLS) but would need to make sure that the hooks in GCC 
are there.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Using C functions in C++
  2003-08-31 13:19 some GCC questions Jonathan Wilson
@ 2003-08-31 14:36 ` albert
  2003-08-31 17:27   ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: albert @ 2003-08-31 14:36 UTC (permalink / raw)
  To: gcc-help

Hi!
  I'm trying to use the sphinx2 library within a C++ program and I can't
get it work. I took an example program that comes with the library and I
can make it compile using: 'gcc main.c -lm -lsphinx2 -lsphinx2ad
-lsphinx2fe' but If I put the 2 main functions the program has in a
class, the compiler doesn't give any errors but the linker says:

/tmp/ccrCoGun.o(.text+0x55): In function `KK::utterance_loop()':
: undefined reference to `ad_read(ad_rec_t*, short*, int)'
/tmp/ccrCoGun.o(.text+0x60): In function `KK::utterance_loop()':
: undefined reference to `cont_ad_init(ad_rec_t*, int (*)(ad_rec_t*,
short*, int))'
/tmp/ccrCoGun.o(.text+0x86): In function `KK::utterance_loop()':
: undefined reference to `_E__pr_header(char const*, long, char const*)'
................

so it is only a linking problem and of course I'm using the '-l' flags.
So, my question is... could there be something that didn't let me use this
functions within a class? I've tried using the :: prefix before the
cont_ad_init function but didn't make any effect. Any other suggestions?

PS: I could send you the files if it was useful.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using C functions in C++
  2003-08-31 14:36 ` Using C functions in C++ albert
@ 2003-08-31 17:27   ` Florian Weimer
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2003-08-31 17:27 UTC (permalink / raw)
  To: albert; +Cc: gcc-help

<albert@wickywicky.net> writes:

> /tmp/ccrCoGun.o(.text+0x55): In function `KK::utterance_loop()':
> : undefined reference to `ad_read(ad_rec_t*, short*, int)'

Make sure that the functions are declared 'extern "C"'.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-08-31 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-31 13:19 some GCC questions Jonathan Wilson
2003-08-31 14:36 ` Using C functions in C++ albert
2003-08-31 17:27   ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).