S
stephen henry
Hi all,
Please help me...
I have two projects: systemc (written in C++) and x264 (written in C).
I would like to have a C++ project that that can call both systemc
functions and x264 functions. What I've done is I've linked both
libraries into my project, using an additional header file to include
the C functions from x264 as follows:
#ifndef __x264__h__
#define __x264__h__
extern "C" {
#include "../x264/...";
// include all the x264 headers here.
}
The project seems to compile fine, however when it gets to the linking
stage it complains that it can't find a bunch of functions. What I'm
having difficulty with is the fact that I'm using g++ (and explicitly
linking in the stdc++ library) and the functions it can't find all
relate to C++ functions, either in the standard library or in systemc.
Previous usenet posts suggest that I may be using gcc opposed to g++,
but, as my log shows, I am using the correct compiler. Even odder is
the fact that it doesn't report that it can't find the x264 C
functions I use (at least to my knowledge).
When I run make I get (just a bit of the output):
In file included from algorithm/x264/core/common.h:35,
from algorithm/x264.h:15,
from arch/src/camera.h:10,
from arch/src/camg++ -Wno-deprecated -g -Wall -I.
-I.. -I./algorithm -I./algorithm/core -I./algorithm/encoder In file
included from algorithm/x264/core/common.h:35,
from alg++ -Wno-deprecated -g -Wall -I. -I..
-I./algorithm -I./algorithm/core -I./algorithm/encoder -Isystemc
-I../common/systemc/include -L. -L.. -L../common/systemc/lib-linux
-L./algorithm/x26../common/systemc/lib-linux/libsystemc.a(sc_main.o):
In function `_GLOBAL__I_sc_in_action':
sc_main.o(.text+0xc): undefined reference to
`std::ios_base::Init::Init[in-charge]()'
.../common/systemc/lib-linux/libsystemc.a(sc_main.o): In function
`main':
sc_main.o(.text+0x8b): undefined reference to `__cxa_begin_catch'
sc_main.o(.text+0x92): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std::endl<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&)'
sc_main.o(.text+0xa7): undefined reference to `std::cout'
sc_main.o(.text+0xac): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0xb5): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0xbe): undefined reference to
sc_main.o(.text+0xc6): undefined reference to `__cxa_end_catch'
sc_main.o(.text+0xd5): undefined reference to `__cxa_begin_catch'
sc_main.o(.text+0xe4): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std::endl<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&)'
sc_main.o(.text+0xf5): undefined reference to `std::cout'
sc_main.o(.text+0xfa): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0x103): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0x10c): undefined reference to
sc_main.o(.text+0x117): undefined reference to `__cxa_begin_catch'
sc_main.o(.text+0x11e): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std::endl<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&)'
sc_main.o(.text+0x12f): undefined reference to `std::cout'
sc_main.o(.text+0x134): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0x13d): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0x146): undefined reference to
sc_main.o(.text+0x153): undefined reference to `__cxa_end_catch'
sc_main.o(.text+0x15c): undefined reference to `_Unwind_Resume'
.../common/systemc/lib-linux/libsystemc.a(sc_main.o): In function
`__tcf_0':
sc_main.o(.text+0x3c): undefined reference to
`std::ios_base::Init::~Init [in-charge]()'
.../common/systemc/lib-linux/libsystemc.a(sc_main.o)(.gcc_except_table+0x2c):
undefined reference to `typeinfo for char const*'
.../common/systemc/lib-linux/libsystemc.a(sc_main.o)(.eh_frame+0x12):
undefined reference to `__gxx_personality_v0'
.../common/systemc/lib-linux/libsystemc.a(sc_simcontext.): In function
`_GLOBAL__I__ZN16sc_process_tableC2Ev':
sc_simcontext.(.text+0x19c): undefined reference to
`std::ios_base::Init::Init[in-charge]()'
.../common/systemc/lib-linux/libsystemc.a(sc_simcontext.): In function
`sc_simcontext::crunch()':
sc_simcontext.(.text+0x669): undefined reference to `_Unwind_Resume'
sc_simcontext.(.text+0x69f): undefined reference to
`__cxa_begin_catch'
sc_simcontext.(.text+0x6a6): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std::endl<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&)'
sc_simcontext.(.text+0x6bf): undefined reference to `std::cout'
sc_simcontext.(.text+0x6c4): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_simcontext.(.text+0x6cd): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_simcontext.(.text+0x6d6): undefined reference to
sc_simcontext.(.text+0x6e2): undefined reference to `__cxa_end_catch'
Thanks for your help.
Stephen
Please help me...
I have two projects: systemc (written in C++) and x264 (written in C).
I would like to have a C++ project that that can call both systemc
functions and x264 functions. What I've done is I've linked both
libraries into my project, using an additional header file to include
the C functions from x264 as follows:
#ifndef __x264__h__
#define __x264__h__
extern "C" {
#include "../x264/...";
// include all the x264 headers here.
}
The project seems to compile fine, however when it gets to the linking
stage it complains that it can't find a bunch of functions. What I'm
having difficulty with is the fact that I'm using g++ (and explicitly
linking in the stdc++ library) and the functions it can't find all
relate to C++ functions, either in the standard library or in systemc.
Previous usenet posts suggest that I may be using gcc opposed to g++,
but, as my log shows, I am using the correct compiler. Even odder is
the fact that it doesn't report that it can't find the x264 C
functions I use (at least to my knowledge).
When I run make I get (just a bit of the output):
In file included from algorithm/x264/core/common.h:35,
from algorithm/x264.h:15,
from arch/src/camera.h:10,
from arch/src/camg++ -Wno-deprecated -g -Wall -I.
-I.. -I./algorithm -I./algorithm/core -I./algorithm/encoder In file
included from algorithm/x264/core/common.h:35,
from alg++ -Wno-deprecated -g -Wall -I. -I..
-I./algorithm -I./algorithm/core -I./algorithm/encoder -Isystemc
-I../common/systemc/include -L. -L.. -L../common/systemc/lib-linux
-L./algorithm/x26../common/systemc/lib-linux/libsystemc.a(sc_main.o):
In function `_GLOBAL__I_sc_in_action':
sc_main.o(.text+0xc): undefined reference to
`std::ios_base::Init::Init[in-charge]()'
.../common/systemc/lib-linux/libsystemc.a(sc_main.o): In function
`main':
sc_main.o(.text+0x8b): undefined reference to `__cxa_begin_catch'
sc_main.o(.text+0x92): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std::endl<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&)'
sc_main.o(.text+0xa7): undefined reference to `std::cout'
sc_main.o(.text+0xac): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0xb5): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0xbe): undefined reference to
(*)(std::basic_ostream<char, std::char_traits<char> >&))'`std::basic_ostream said::perator<<(std::basic_ostream<char, std::char_traits<char> >&
sc_main.o(.text+0xc6): undefined reference to `__cxa_end_catch'
sc_main.o(.text+0xd5): undefined reference to `__cxa_begin_catch'
sc_main.o(.text+0xe4): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std::endl<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&)'
sc_main.o(.text+0xf5): undefined reference to `std::cout'
sc_main.o(.text+0xfa): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0x103): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0x10c): undefined reference to
(*)(std::basic_ostream<char, std::char_traits<char> >&))'`std::basic_ostream said::perator<<(std::basic_ostream<char, std::char_traits<char> >&
sc_main.o(.text+0x117): undefined reference to `__cxa_begin_catch'
sc_main.o(.text+0x11e): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std::endl<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&)'
sc_main.o(.text+0x12f): undefined reference to `std::cout'
sc_main.o(.text+0x134): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0x13d): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_main.o(.text+0x146): undefined reference to
(*)(std::basic_ostream<char, std::char_traits<char> >&))'`std::basic_ostream said::perator<<(std::basic_ostream<char, std::char_traits<char> >&
sc_main.o(.text+0x153): undefined reference to `__cxa_end_catch'
sc_main.o(.text+0x15c): undefined reference to `_Unwind_Resume'
.../common/systemc/lib-linux/libsystemc.a(sc_main.o): In function
`__tcf_0':
sc_main.o(.text+0x3c): undefined reference to
`std::ios_base::Init::~Init [in-charge]()'
.../common/systemc/lib-linux/libsystemc.a(sc_main.o)(.gcc_except_table+0x2c):
undefined reference to `typeinfo for char const*'
.../common/systemc/lib-linux/libsystemc.a(sc_main.o)(.eh_frame+0x12):
undefined reference to `__gxx_personality_v0'
.../common/systemc/lib-linux/libsystemc.a(sc_simcontext.): In function
`_GLOBAL__I__ZN16sc_process_tableC2Ev':
sc_simcontext.(.text+0x19c): undefined reference to
`std::ios_base::Init::Init[in-charge]()'
.../common/systemc/lib-linux/libsystemc.a(sc_simcontext.): In function
`sc_simcontext::crunch()':
sc_simcontext.(.text+0x669): undefined reference to `_Unwind_Resume'
sc_simcontext.(.text+0x69f): undefined reference to
`__cxa_begin_catch'
sc_simcontext.(.text+0x6a6): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std::endl<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&)'
sc_simcontext.(.text+0x6bf): undefined reference to `std::cout'
sc_simcontext.(.text+0x6c4): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_simcontext.(.text+0x6cd): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std:perator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
sc_simcontext.(.text+0x6d6): undefined reference to
(*)(std::basic_ostream<char, std::char_traits<char> >&))'`std::basic_ostream said::perator<<(std::basic_ostream<char, std::char_traits<char> >&
sc_simcontext.(.text+0x6e2): undefined reference to `__cxa_end_catch'
Thanks for your help.
Stephen