Linking c code with cpp code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm trying to integrate GNU Rx into a c++ program.  But I can't link
them together.

I get an error something like:

 <filename>.o(.text+0x72c):<filename>.cpp: undefined reference to
re_compile_pattern( ...)

when GCC tries to link the program.

It appears to me that when i compile regex.c with the C compiler, it
generates object code that is incompatible with the object code
generated by the C++ compiler, obviously due to the way the functions
are declared in regex.c

Is there a way to override these declarations so the c-compiler
generates object code that allows me to link them together?

Or is there a way I can make the linker link them together anyway.

Any suggestions?

Agnar Renolen
Trondheim
NORWAY


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux