473,461 Members | 1,315 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

" undefined reference to" g++ error

3
Hello,

i am trying to compile a code(main.cpp) which uses a function that is declared in a header file that is within the directory where the main.cpp file resides so the header is included as
#include"abc.h"

that function's definition is inside abc.cpp that also resides in the directory of main.cpp i.e with abc.h

but still on usage of that function i get "undefined reference to" that function error....

How is this possible??

Please can anybody help me out with this.

Thanks

Best Regards
Feb 2 '08 #1
1 2110
weaknessforcats
9,208 Expert Mod 8TB
You don't say whether this is a compiler error or a linker error.

If it's a compiler error of undefined reference:
a) you are a calling a function that is not the header
b) you are calling a function that is in the header but the arguments don't match the prototype in the header.

If it's a linker error, then your abc.cpp was not part of your make file.

You might post the relevant header lines plus the call where you are getting the error. Include the definitions of the argument variables.
Feb 2 '08 #2

Sign in to post your reply or Sign up for a free account.

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...
2
by: Jozef | last post by:
Hello, I have a friend in the UK and another in Denmark that I sent an Access XP database to. I used the Package and Deployment wizard to create this file. The only reference that I added was...
2
by: TJS | last post by:
i get a reference error to CssDropDown object when the session expires Why is object reference on "CssDropDown" not being found ? ========================================================...
16
by: Paul S. Natanson | last post by:
What is a Null Reference error and how do I fix it? My newly installed VB.Net2003 gives me a "Microsoft Development Environment" error message box EVERY time I try to run/start ANY project -...
6
by: Nadia | last post by:
Hi, I am having the symbol reference error while linking the object files. I have added the library at the end of the commmand . g++ -D_XWIN -DRT_DIAG=cerr -DRT_INFO=cerr -I/usr/X11R6/include...
40
by: vfunc | last post by:
I get an undefined reference error for a definition that clearly looks like it is in a .h file. So what can be the cause of an undefined reference error, when this .h file containing the...
6
by: mihailsmilev | last post by:
Hello, let me first describe the situation: I am developing an application using Qt Designer 3.3.5 on OpenSuSE Linux for my mp3 player. So I need to get the id3 tags from the mp3 files, and I've...
8
by: utab | last post by:
Dear all, I am getting an undefined reference error wrn I try to initilialize a static map in the class constructor. my map: map<string,vector<string> > m; and in the constructor ...
8
by: vfunc | last post by:
I get compile error: undefined reference to snd_pcm_format_width. I included the library directory with -I flag on gcc. #include <stdio.h> #include <stdlib.h> #include <string.h> #include...
6
by: SunshineInTheRain | last post by:
can anyone please help me on problem of 'Sys' is undefined error? I know a lot forum has discussed about this, but none i success to solve the error. I have run it on Window server 2000, IIS 5,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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...
0
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.