473,499 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Undefined reference to...

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 *argv[])
{
xosd *osd;

osd = xosd_create (1);

xosd_set_font(osd, "fixed");
xosd_set_colour(osd, "LawnGreen");
xosd_set_timeout(osd, 3);
xosd_set_shadow_offset(osd, 1);

xosd_display (osd, 0, XOSD_string, "Example XOSD output");

xosd_wait_until_no_display(osd);

xosd_uninit (osd);

return 0;
}

this errors are shown - nothing is compiled

/tmp/ccSqE3te.o: In function `main':
alsaswitch.cpp:(.text+0x22): undefined reference to `xosd_create'
alsaswitch.cpp:(.text+0x38): undefined reference to `xosd_set_font'
alsaswitch.cpp:(.text+0x4b): undefined reference to `xosd_set_colour'
alsaswitch.cpp:(.text+0x5b): undefined reference to `xosd_set_timeout'
alsaswitch.cpp:(.text+0x6b): undefined reference to `xosd_set_shadow_offset'
alsaswitch.cpp:(.text+0x7f): undefined reference to `xosd_display'
alsaswitch.cpp:(.text+0x8d): undefined reference to `xosd_wait_until_no_display'
alsaswitch.cpp:(.text+0x9b): undefined reference to `xosd_uninit'
collect2: ld returned 1 exit status

I am still to unexperienced to understand what sort of problem can cause
these errors. So I would be glad if any one could help me out by giving me
some hints.

--
MfG
Andre Janßen

Feb 6 '06 #1
1 4262
"Andre Janssen" <An***********@LOESCHMICH.nerdflanders.de> wrote in
message news:pa****************************@LOESCHMICH.ner dflanders.de...
: 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 *argv[])
: {
: xosd *osd;
....
: this errors are shown - nothing is compiled
:
: /tmp/ccSqE3te.o: In function `main':
: alsaswitch.cpp:(.text+0x22): undefined reference to `xosd_create'
: alsaswitch.cpp:(.text+0x38): undefined reference to `xosd_set_font'
....
: collect2: ld returned 1 exit status
:
: I am still to unexperienced to understand what sort of problem can cause
: these errors. So I would be glad if any one could help me out by giving
me
: some hints.

Note that the problem appears to be a linkage error,
the compilation of the C++ code appearing to be successful.
You need to specify a library (maybe xosd.a or .o ?) to be
linked with your compiled file to have a complete application.

As this is an implementation-specific question, best would
be to post it in a forum dedicated to xosd or to your
platform/compiler (gcc).

hth -Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
Brainbench MVP for C++ <> http://www.brainbench.com
Feb 6 '06 #2

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

Similar topics

2
13103
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
3327
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
3131
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
9577
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
30981
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...
3
789
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
4760
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
11584
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
6209
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...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.