473,378 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

undefined reference to ...

Hi i am trying to compile a set of programs but i receive the following
error with try to make the time running program, i write my program in
C and try to call a C++ function of a library building in and
compilated succesfully in C++,

the funtion (in C++) is:
#include "header.h"
.....
extern "C" int llamada(int det,pgmd* ventana) { ... }
......

with a header :
#ifdef __cplusplus
extern "C"
#endif
int llamada(int det, pgmd* ventana);

and the calling in C is:
#include "header.h"
.....
det = llamada(ii, &ventana);
.....

The result of compilation is:

server@user:~/Gideo-0TRY/src$ gcc -Wall -g -lcrypt -o gideo support.o
main.o interface.o callbacks.o avilib.o spcadecoder.o spcav4l.o utils.o
-Wl,--export-dynamic -L/usr/local/lib -L/usr/X11R6/lib
/usr/lib/libgnomeui-2.so -L/usr/lib /usr/lib/libgnome-keyring.so
/usr/lib/libbonoboui-2.so -lSM -lICE /usr/lib/libgnomecanvas-2.so
/usr/lib/libgtk-x11-2.0.so /usr/lib/libgdk-x11-2.0.so
/usr/lib/libgdk_pixbuf-2.0.so /usr/lib/libgnome-2.so /usr/lib/libesd.so
/usr/lib/libaudiofile.so /usr/lib/libart_lgpl_2.so
/usr/lib/libpangoft2-1.0.so /usr/lib/libgnomevfs-2.so
/usr/lib/libxml2.so /usr/lib/libgnutls.so /usr/lib/libtasn1.so
/usr/lib/libgcrypt.so -lnsl /usr/lib/libgpg-error.so -lresolv -lrt
/usr/lib/libbonobo-2.so /usr/lib/libgconf-2.so
/usr/lib/libbonobo-activation.so /usr/lib/libORBitCosNaming-2.so
/usr/lib/libORBit-2.so /usr/lib/libpopt.so /usr/lib/libgthread-2.0.so
/usr/local/lib/libgtk-x11-2.0.so /usr/local/lib/libgdk-x11-2.0.so
/usr/lib/libatk-1.0.so /usr/local/lib/libgdk_pixbuf-2.0.so
/usr/lib/libpangoxft-1.0.so /usr/lib/libpangox-1.0.so
/usr/lib/libpango-1.0.so /usr/lib/libgobject-2.0.so
/usr/lib/libgmodule-2.0.so /usr/lib/libglib-2.0.so -laudio -lXt -lX11
-lXext /usr/lib/libaa.so -lncurses -lslang /usr/lib/libasound.so -ldl
-lm /usr/lib/libSDL_image.so -ltiff /usr/lib/libjpeg.so -lpng -lz
/usr/lib/libSDL.so -lpthread -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath
-Wl,/usr/local/lib
/usr/bin/ld: warning: libtiff.so.4, needed by /usr/lib/libSDL_image.so,
may conflict with libtiff.so.3
main.o(.text+0x1660): In function `processvideo':
/home/user/Gideo-0TRY/src/main.c:640: undefined reference to `llamada'
collect2: ld returned 1 exit status

Thank you for your colaboration

benzasu

Jun 11 '06 #1
2 2692
On 11 Jun 2006 16:43:42 -0700, "benzasu" <sb****@gmail.com> wrote in
comp.lang.c:
Hi i am trying to compile a set of programs but i receive the following
error with try to make the time running program, i write my program in
C and try to call a C++ function of a library building in and
compilated succesfully in C++,


Pretty much anything to do with C++ is off-topic in this group. C,
which came first, does not define an interface to any other language,
and that includes C++. So this is not a C language issue.

Even if your C and C++ compilers provide a method of doing this, it is
100% compiler specific. Undefined references are generated by the
linker, and neither language defines the operation of such tools.

I would suggest you ask this question in
news:comp.os.linux.development.apps

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jun 12 '06 #2
benzasu wrote:
Hi i am trying to compile a set of programs but i receive the following
error with try to make the time running program, i write my program in
C and try to call a C++ function of a library building in and
compilated succesfully in C++,

the funtion (in C++) is:
#include "header.h"
.....
extern "C" int llamada(int det,pgmd* ventana) { ... }
......

with a header :
#ifdef __cplusplus
extern "C"
#endif
int llamada(int det, pgmd* ventana);

You probably want

#ifdef __cplusplus
extern "C" {
#endif

int llamada(int det, pgmd* ventana);

#ifdef __cplusplus
}
#endif

--
Ian Collins.
Jun 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RU | last post by:
Hi, I am working on a porting project to port C/C++ application from unixware C++, AT&T Standard components to g++ with STL on Linux. This application has been working properly on...
13
by: david | last post by:
Hi, I have some problems to link a simple hello world program using g++ (version 3.2.3 or 3.3) and dinkumware 402. //hallo world... #include <iostream> main () { std::cout << "bla" <<...
1
by: Codemutant | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** I just cannot find what is undefined in this code.
1
by: Foolster41 | last post by:
I'm rather new to C++ programing. I'm using the dev-C++ program on a windows XP OS. I'm trying to compile the code for a multi user dungeon (MUD) called circle-mud. When I compile I get the...
1
by: Dom | last post by:
I'm new to c++. Just started learning it 24 hours ago. Am running into a compile problem. Please, no one waste the effort telling me to google it. I've been researching it for quite a while with no...
1
by: Andre Janssen | last post by:
Hi.... I tried to compile the following src with this command: "g++ -Wall -o bla alsaswitch.cpp". The src is an example src of xosd package. #include <xosd.h> int main (int argc, char...
3
by: Michael Sgier | last post by:
Hi i get thousands of messages like below. How shall i resolve that? Thanks Mcihael Release/src/Utility/RawImage.o: In function `CMaskImage::CMaskImage(int, int, char const*)':...
45
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to...
3
by: prakash.mirji | last post by:
Hello, I am getting below mention linker error when I tried to link my class test.C I use below command to compile test.C /usr/bin/g++ -g -fpic -fvisibility=default -D_POSIX_SOURCE...
2
by: zqiang320 | last post by:
Hello: I execute make ,then get error: $ make Making all in libsbml/src make: Entering directory `/home/internet/mydoc/test_pj/libsbml/src' ........ /bin/sh ./libtool --tag=CC --mode=link...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.