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

stupid error

Hi,

this must be a stupid mistake, but I can't find it.
When I try to link the following code:

#include <iostream.h>
#include "TestSK.hh"

class Test_Impl : public POA_Test // , public PortableServer::RefCountServantBase
{
public:
Test_Impl();
~Test_Impl();
CORBA::Long getNumber();

private:
CORBA::Long theNumber;
};

Test_Impl::Test_Impl()
{
}

CORBA::Long Test_Impl::getNumber()
{
return( theNumber );
}

int main( int argc, char ** argv )
{
cout << "hello world\n";
return( 0 );
}

the linker returns these error messages

../main.o(.text+0x8d): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'
../main.o(.text+0xa4): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'
../main.o(.text+0xbf): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'
../main.o(.text+0xd6): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'
../main.o(.text+0xe5): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'
../main.o(.text+0xf5): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'
../main.o(.text+0x105): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'
../main.o(.text+0x118): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'

What could be wrong?

Thanks a lot,

Andre
Jul 22 '05 #1
3 2160

"sieg1974" <si******@yahoo.com> wrote in message
news:89**************************@posting.google.c om...
Hi,

this must be a stupid mistake, but I can't find it.
When I try to link the following code:

#include <iostream.h>
#include "TestSK.hh"

class Test_Impl : public POA_Test // , public PortableServer::RefCountServantBase {
public:
Test_Impl();
~Test_Impl();
CORBA::Long getNumber();

private:
CORBA::Long theNumber;
};

Test_Impl::Test_Impl()
{
}

CORBA::Long Test_Impl::getNumber()
{
return( theNumber );
}

int main( int argc, char ** argv )
{
cout << "hello world\n";
return( 0 );
}

the linker returns these error messages

./main.o(.text+0x8d): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'
./main.o(.text+0xa4): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'
./main.o(.text+0xbf): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'
./main.o(.text+0xd6): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'
./main.o(.text+0xe5): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'
./main.o(.text+0xf5): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'
./main.o(.text+0x105): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'
./main.o(.text+0x118): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'

What could be wrong?

Thanks a lot,

Andre


Hard to say. You don't show what POA_Test looks like. Does it declare
functions you haven't implemented? Also, where does the CORBA namespace
come in? And where's your destructor implemented? It looks to me like
something is not included in your link, but I can't tell from this what that
might be. Is there an implementation for the TestSK.hh header file? Has it
been compiled, and included as part of the link?

Link problems are usually a matter of setup, specific to your platform, and
are not considered C++ language issues (the subject of this newsgroup). But
the answers to my questions *may* lead you to getting it to link properly.

-Howard


Jul 22 '05 #2
"Howard" <al*****@hotmail.com> wrote in message news:<32********************@bgtnsc05-news.ops.worldnet.att.net>...
"sieg1974" <si******@yahoo.com> wrote in message
news:89**************************@posting.google.c om...
Hi,

this must be a stupid mistake, but I can't find it.
When I try to link the following code:

#include <iostream.h>
#include "TestSK.hh"

class Test_Impl : public POA_Test // , public

PortableServer::RefCountServantBase
{
public:
Test_Impl();
~Test_Impl();
CORBA::Long getNumber();

private:
CORBA::Long theNumber;
};

Test_Impl::Test_Impl()
{
}

CORBA::Long Test_Impl::getNumber()
{
return( theNumber );
}

int main( int argc, char ** argv )
{
cout << "hello world\n";
return( 0 );
}

the linker returns these error messages

./main.o(.text+0x8d): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'

./main.o(.text+0xa4): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'

./main.o(.text+0xbf): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'

./main.o(.text+0xd6): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'

./main.o(.text+0xe5): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'

./main.o(.text+0xf5): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'

./main.o(.text+0x105): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `vtable for Test_Impl'

./main.o(.text+0x118): In function `Test_Impl::Test_Impl[in-charge]()':
: undefined reference to `VTT for Test_Impl'

What could be wrong?

Thanks a lot,

Andre


Hard to say. You don't show what POA_Test looks like. Does it declare
functions you haven't implemented? Also, where does the CORBA namespace
come in? And where's your destructor implemented? It looks to me like
something is not included in your link, but I can't tell from this what that
might be. Is there an implementation for the TestSK.hh header file? Has it
been compiled, and included as part of the link?

Link problems are usually a matter of setup, specific to your platform, and
are not considered C++ language issues (the subject of this newsgroup). But
the answers to my questions *may* lead you to getting it to link properly.

-Howard

I don't know why, but after I added the implementation od the
destructor, the linker didn't complain anymore.
The destructor code is just:

Test_Impl::~Test_Impl()
{
}

Andre
Jul 22 '05 #3
"sieg1974" <si******@yahoo.com> wrote in message
news:89**************************@posting.google.c om...

I don't know why, but after I added the implementation od the
destructor, the linker didn't complain anymore.
The destructor code is just:

Test_Impl::~Test_Impl()
{
}


Well, that makes sense, since you had declared a destructor,
but hadn't defined one.

-Mike
Jul 22 '05 #4

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

Similar topics

3
by: Joăo Santa Bárbara | last post by:
Hi all. i have a funny error in the IDE but only in one form. :( i have declare a Method like this "Private Sub MyTransGForms(ByVal sender As Object, ByVal e As EventArgs)" and i have an...
5
by: raz | last post by:
Greetings all. I apologize for what is almost certainly a stupid question, but I can't figure this out, and have no more time for head bashing... The short version: what is the appropriate...
2
by: Lampa Dario | last post by:
Hi, where is this stupid error in this program? When I execute it, i receive a segmentation fault error. #include <stdio.h> int main(int argc, char *argv, char *env) { int i=0; int l=0; int...
4
by: Uchiha Jax | last post by:
Hello everyone, I am a plenty silly person who is trying to learn .NET remoting through trial and error (all articles I read are going over my head at the moment (mostly) so I thought i'd give...
3
by: Amil | last post by:
I must be missing something very simple. I've had a web site running for a long time (anonymous access). Web.config authentication is original (anyone gets in): <authentication mode="Windows"...
4
by: Smoothcoder | last post by:
Hi, there, smart guys! I have an AMD 64 3000+ based system, with Windows XP Professional on it; I recently installed Visual Studio 2003 Enterprise Architect; I created a new C# ASP.NET Web...
5
by: One Handed Man [ OHM# ] | last post by:
I'm doing something stupid !, I must be because this throws no exception, but does not delete the file which "is" there. Amy ideas ? Try System.IO.File.Delete("c:\test.txt") Catch ex As...
15
by: sparks | last post by:
We get more and more data done in excel and then they want it imported into access. The data is just stupid....values of 1 to 5 we get a lot of 0's ok that alright but 1-jan ? we get colums...
2
by: Ike | last post by:
Im wondering if someone can take a look at this simple INSERT statement which is puking on me. I KNOW I must have something stupid in it that I am NOT seeing, which will likely be obvious to...
5
by: Puppet_Sock | last post by:
So, I'm madly coding away, and my fingers stutter, and I produce this. (mfirstToken is a std::string object.) if(m_firstToken.c_str() == 'M' || m_firstToken.c_str().c_str() == 'T') { // ......
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: 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...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.