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

strange linking behaviour

Hi all,

I'm creating a DLL which contains a certain class ( class A), but i forgot
to export it. I created instances from this class in the DLL and passed a
pointers to the executable. I then called some VIRTUAL operations on the
instances. No problem so far. Everything compiled and linked flawless. I
used static linking so the class was also declared in the executable's
project.
I then created some extra non-virtual functionality for class A and wanted
to call these functions too. Now my linker started to complain about
unresolved externals. A quick glance at the header made clear that I forgot
to export the class. I corrected this and again no further problems.
(Visual Studio 6.0)

This made me starting to wonder why the executable did get linked in the
first case where I only called the virtual functions. I would have thought
the linker should also have been complaining. Or am I wrong ?

Can anybody explain this ?

thanks,

Wouter
Jul 22 '05 #1
1 1139

"Wouter" <wm****@jtag.nl> wrote in message
news:c1**********@reader10.wxs.nl...
Hi all,

I'm creating a DLL which contains a certain class ( class A), but i forgot
to export it. I created instances from this class in the DLL and passed a
pointers to the executable. I then called some VIRTUAL operations on the
instances. No problem so far. Everything compiled and linked flawless. I
used static linking so the class was also declared in the executable's
project.
I then created some extra non-virtual functionality for class A and wanted to call these functions too. Now my linker started to complain about
unresolved externals. A quick glance at the header made clear that I forgot to export the class. I corrected this and again no further problems.
(Visual Studio 6.0)

This made me starting to wonder why the executable did get linked in the
first case where I only called the virtual functions. I would have thought
the linker should also have been complaining. Or am I wrong ?

Can anybody explain this ?


Linkers and their behavior are not topical here. Each one will work
in its own way, also necessarily dependent upon the environment in which
it is used.

This newsgroup is about the platform-independent C++ programming language.
See: http://www.slack.net/~shiva/welcome.txt

For help with your linker, consult support resources available from its
vendor, e.g. websites, tech support, etc. There are probably also one
or more newsgroups which discuss it. Check www.groups.google.com
or www.usenet.org etc, to find them.

-Mike
Jul 22 '05 #2

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

Similar topics

5
by: Arnab Nandi | last post by:
We are using the Sun Workshop 6 C++ compiler to compile some CPP files. The command line looks like follows: - CC -g -xsb -c -o output/x.o x.cpp We get the following error: - CC: language...
2
by: Paul Drummond | last post by:
Hi all, I am developing software for Linux Redhat9 and I have noticed some very strange behaviour when throwing exceptions within a shared library. All our exceptions are derived from...
3
by: Sebastian C. | last post by:
Hello everybody Since I upgraded my Office XP Professional to SP3 I got strange behaviour. Pieces of code which works for 3 years now are suddenly stop to work properly. I have Office XP...
6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
31
by: DeltaOne | last post by:
#include<stdio.h> typedef struct test{ int i; int j; }test; main(){ test var; var.i=10; var.j=20;
2
by: teddysnips | last post by:
We've been supporting a number of Access applications for a particular client for some years. Some of them were written by third parties, some by us (even one or two by me, though not this...
8
by: Dox33 | last post by:
I ran into a very strange behaviour of raw_input(). I hope somebody can tell me how to fix this. (Or is this a problem in the python source?) I will explain the problem by using 3 examples....
1
by: agarwasa2008 | last post by:
Hi, I have a perfect file called "Products.xls" that I link to my MS Access 2003 database and everytthing looks good in that file. When I view the same file after linking in my database the...
20
by: Pilcrow | last post by:
This behavior seems very strange to me, but I imagine that someone will be able to 'explain' it in terms of the famous C standard. -------------------- code -----------------------------------...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.