473,408 Members | 1,743 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,408 software developers and data experts.

Problem with linking in Borland Builder C++ 5

Welcome,
When I'am trying to call static function(setAreaLoader) from other class, I
get following linker-error. How to solve it? I'm slowly getting crazy... And
I have the same problem with the rest of static members... Help me!

[Linker Error] Unresolved external 'Area::m_loader' referenced from
C:\DAREK\NAVIGATOR\AREA.OBJ

***Area.h:***

#ifndef area_H
#define area_H

#include <vcl.h>
#include "Map.h"
#include "AreaLoader.h"

class Area
{

private:
Map * m_maps;
int m_mapsNumber;
public:
Area();
~Area();
static void setAreaLoader(AreaLoader * p_loader);
static Area * createAreaWithLoader(AnsiString p_areaId);
static AreaLoader * m_loader;
};
#endif

***area.cpp:***

#include "Area.h"

....

void Area::setAreaLoader(AreaLoader * p_loader)
{
m_loader = p_loader;
}

....

Best Regards,
Dariusz
Jul 19 '05 #1
3 2357

"Dariusz Plygawko" <Da**************@cern.ch> wrote in message
news:be**********@sunnews.cern.ch...
Welcome,
When I'am trying to call static function(setAreaLoader) from other class, I get following linker-error. How to solve it? I'm slowly getting crazy... And I have the same problem with the rest of static members... Help me!

[Linker Error] Unresolved external 'Area::m_loader' referenced from
C:\DAREK\NAVIGATOR\AREA.OBJ

***Area.h:***

#ifndef area_H
#define area_H

#include <vcl.h>
#include "Map.h"
#include "AreaLoader.h"

class Area
{

private:
Map * m_maps;
int m_mapsNumber;
public:
Area();
~Area();
static void setAreaLoader(AreaLoader * p_loader);
static Area * createAreaWithLoader(AnsiString p_areaId);
static AreaLoader * m_loader;
};
#endif

***area.cpp:***

#include "Area.h"

...

void Area::setAreaLoader(AreaLoader * p_loader)
{
m_loader = p_loader;
}

You have just declared Area::m_loader, not defined it.You need to
define it in an implementation file (area.cpp) like
Area::m_loader = .... // define m_loader
You try to access it in Area::setAreaLoader without defining it, so you
know why you are getting the linker error.

--
With best wishes,
J.Schafer
Jul 19 '05 #2
> >
You have just declared Area::m_loader, not defined it.You need to
define it in an implementation file (area.cpp) like
Area::m_loader = .... // define m_loader


Actually like this

AreaLoader* Area::m_loader = ...;

john
Jul 19 '05 #3
Thank You! :)
Jul 19 '05 #4

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

Similar topics

5
by: Steven O. | last post by:
First, sorry if by some chance I am not posting to the correct newsgroups, these seemed to be the most applicable to my question (see disclaimer at end of post for further comments....). Started...
11
by: TGF | last post by:
I am wondering if it is feasible to use .NET for applications that have to be very fast. We have a few applications that are blazingly fast, written in Borland C++ using Borland C++ Builder. We...
15
by: Chris | last post by:
I am just beginning programming again and need a bit of advice. I have both Visual C++ 6.0 Standard Edition and Borland C++ Builder 6. Of these two which do you consider the best for programming...
24
by: serdar | last post by:
Hi. Does anybody say that what is better borland c++ or visual c++? Which compiler does have more help?
3
by: shuusaku | last post by:
Dear all, I'm not sure this is the right place to ask for help, but I cannot find any solution anywhere else, I hope you could help me. I'm using Borland C++ Builder 6 with TeeChart v4.04...
0
by: Xproblem | last post by:
FTP Client Engine for C/C++ 2.4 Screenshot - Soft.comFTP Client Engine for C/C++ 2.4. ... System Requirements: Windows C/C++ compiler - Microsoft operating system: Windows 95, Windows 98, Windows...
22
by: smartwolf agassi via DotNetMonster.com | last post by:
I'm a C# language learner. I want to know which IDE is better for C# programing, Borland C#Builder or VS.net 2003? -- Message posted via http://www.dotnetmonster.com
6
by: Uli | last post by:
Hello, I'm trying to use a DLL (by static linking) which was compiled with Borland C++Builder (BCB) in Visual C++ (Visual-Studio 2003). All functions are declared with the directive 'extern...
2
by: amarok | last post by:
I've got a problem - I must to static link to dll library, which is placed in subdirectory of application. I knonw how do it in delphi but I don't known how do it in c++ (builder). In delphi I...
0
by: DevEng | last post by:
Hi all, I am new to Python and trying to embed it into a c/c++ application. I started with examples from the documentation pages and go to the Pure Embedding example...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.