473,545 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Kang Su Gatlin: Linker Whitepaper question

I recently read your whitepaper under the "extremely long link times" post
and have a question that I was hoping you could answer.

My question is based on the following paragraph:
Directives
The linker's handling of directives left something to be desired in VC2003,
and for this reason code with lots of directives can suffer. In particular
__declspec(expo rt), as it's likely the most common linker directive.
Besides that, don't export functions that you don't need to export.
Besides it becoming a code maintenance nightmare, it also increases your
link times.
Is there some other "better" way to handle DLL exports that makes the
"maintenanc e nightmare" more manageable?
Or do you just think that creating APIs is a bad idea?

Thanks for writing this article and I hope you can help clear up my
questions.
-Steve
Nov 17 '05 #1
3 1771
Yes, I can see the confusion that can arise from that statement.
__declspec(expo rt) in itself is not a bad thing. The code maintenance
problem has to do with exporting functions that you don't need to export,
as now you have exports that later developers added to the code base are
wondering "who else uses this??".

Let me rewrite the snippet and see if this is more clear:
"The linker's handling of directives left something to be desired in
VC2003, and for this reason code with lots of directives can suffer. In
particular __declspec(expo rt), as it's likely the most common linker
directive. Given this, don't export functions that you don't need to
export. Exposing exports that are not necessary can be confusing to
developers working on the codebase, and it additionally increases your link
times. Of course creating exports for your APIs with __declspec(expo rt)
is exactly what you should do. For VS2005 we do plan on fixing some of
these speed issues related to directives. I'll update this note when that
happens (although the recommendation to export only what you want to expose
stays intact regardless)."

I hope this makes things a bit more clear. If not, feel free to let me
know. Either on here or directly at ka******@micros oft.com.

I'll post an updated version of the note shortly.

Thanks,

Kang Su Gatlin
Visual C++ Program Manager

--------------------
| From: "Steve Baer" <a-*****@mcneel.co m>
| Subject: Kang Su Gatlin: Linker Whitepaper question
| Date: Mon, 9 Aug 2004 23:36:43 -0700

|
| I recently read your whitepaper under the "extremely long link times" post
| and have a question that I was hoping you could answer.
|
| My question is based on the following paragraph:
| Directives
| The linker's handling of directives left something to be desired in
VC2003,
| and for this reason code with lots of directives can suffer. In
particular
| __declspec(expo rt), as it's likely the most common linker directive.
| Besides that, don't export functions that you don't need to export.
| Besides it becoming a code maintenance nightmare, it also increases your
| link times.
|
|
| Is there some other "better" way to handle DLL exports that makes the
| "maintenanc e nightmare" more manageable?
| Or do you just think that creating APIs is a bad idea?
|
| Thanks for writing this article and I hope you can help clear up my
| questions.
| -Steve
|
|
|

Nov 17 '05 #2
Thanks for the quick reply and for helping me understand your point.

Our application exposes a large API for 3rd party developers to write
plug-ins, so we are stuck on this issue.

We've had some quirky issues with the incremental linker in the past, and
are trying to find ways to fix this. Our main issue is that the IL will work
just fine for a while and all of a sudden completely fail. This forces us to
do a full rebuild. I don't have the error code on me, but I will pass along
the word to everyone in the company to write down the error message when the
IL fails.

Thanks again,
-Steve Baer
Robert McNeel & Associates
"Kang Su Gatlin [MS]" <ka******@micro soft.com> wrote in message
news:YR******** *****@cpmsftngx a06.phx.gbl...
Yes, I can see the confusion that can arise from that statement.
__declspec(expo rt) in itself is not a bad thing. The code maintenance
problem has to do with exporting functions that you don't need to export,
as now you have exports that later developers added to the code base are
wondering "who else uses this??".

Let me rewrite the snippet and see if this is more clear:
"The linker's handling of directives left something to be desired in
VC2003, and for this reason code with lots of directives can suffer. In
particular __declspec(expo rt), as it's likely the most common linker
directive. Given this, don't export functions that you don't need to
export. Exposing exports that are not necessary can be confusing to
developers working on the codebase, and it additionally increases your link times. Of course creating exports for your APIs with __declspec(expo rt)
is exactly what you should do. For VS2005 we do plan on fixing some of
these speed issues related to directives. I'll update this note when that
happens (although the recommendation to export only what you want to expose stays intact regardless)."

I hope this makes things a bit more clear. If not, feel free to let me
know. Either on here or directly at ka******@micros oft.com.

I'll post an updated version of the note shortly.

Thanks,

Kang Su Gatlin
Visual C++ Program Manager

--------------------
| From: "Steve Baer" <a-*****@mcneel.co m>
| Subject: Kang Su Gatlin: Linker Whitepaper question
| Date: Mon, 9 Aug 2004 23:36:43 -0700

|
| I recently read your whitepaper under the "extremely long link times" post | and have a question that I was hoping you could answer.
|
| My question is based on the following paragraph:
| Directives
| The linker's handling of directives left something to be desired in
VC2003,
| and for this reason code with lots of directives can suffer. In
particular
| __declspec(expo rt), as it's likely the most common linker directive.
| Besides that, don't export functions that you don't need to export.
| Besides it becoming a code maintenance nightmare, it also increases your
| link times.
|
|
| Is there some other "better" way to handle DLL exports that makes the
| "maintenanc e nightmare" more manageable?
| Or do you just think that creating APIs is a bad idea?
|
| Thanks for writing this article and I hope you can help clear up my
| questions.
| -Steve
|
|
|

Nov 17 '05 #3
Adding /TEST to the linker switch might be useful, so when you do see this
quirky IL behavior it may give you a hint, or you can mail it to us and see
what we can derive from it. We may need to request a link repro though to
get to the bottom of it.

Thanks,

Kang Su Gatlin
Visual C++ Program Manager

--------------------
| From: "Steve Baer" <a-*****@mcneel.co m>
| References: <O#************ **@TK2MSFTNGP10 .phx.gbl>
<YR************ *@cpmsftngxa06. phx.gbl>
| Subject: Re: Kang Su Gatlin: Linker Whitepaper question
| Date: Tue, 10 Aug 2004 09:05:12 -0700

|
| Thanks for the quick reply and for helping me understand your point.
|
| Our application exposes a large API for 3rd party developers to write
| plug-ins, so we are stuck on this issue.
|
| We've had some quirky issues with the incremental linker in the past, and
| are trying to find ways to fix this. Our main issue is that the IL will
work
| just fine for a while and all of a sudden completely fail. This forces us
to
| do a full rebuild. I don't have the error code on me, but I will pass
along
| the word to everyone in the company to write down the error message when
the
| IL fails.
|
| Thanks again,
| -Steve Baer
| Robert McNeel & Associates
|
|
| "Kang Su Gatlin [MS]" <ka******@micro soft.com> wrote in message
| news:YR******** *****@cpmsftngx a06.phx.gbl...
| > Yes, I can see the confusion that can arise from that statement.
| > __declspec(expo rt) in itself is not a bad thing. The code maintenance
| > problem has to do with exporting functions that you don't need to
export,
| > as now you have exports that later developers added to the code base are
| > wondering "who else uses this??".
| >
| > Let me rewrite the snippet and see if this is more clear:
| > "The linker's handling of directives left something to be desired in
| > VC2003, and for this reason code with lots of directives can suffer. In
| > particular __declspec(expo rt), as it's likely the most common linker
| > directive. Given this, don't export functions that you don't need to
| > export. Exposing exports that are not necessary can be confusing to
| > developers working on the codebase, and it additionally increases your
| link
| > times. Of course creating exports for your APIs with
__declspec(expo rt)
| > is exactly what you should do. For VS2005 we do plan on fixing some of
| > these speed issues related to directives. I'll update this note when
that
| > happens (although the recommendation to export only what you want to
| expose
| > stays intact regardless)."
| >
| > I hope this makes things a bit more clear. If not, feel free to let me
| > know. Either on here or directly at ka******@micros oft.com.
| >
| > I'll post an updated version of the note shortly.
| >
| > Thanks,
| >
| > Kang Su Gatlin
| > Visual C++ Program Manager
| >
| > --------------------
| > | From: "Steve Baer" <a-*****@mcneel.co m>
| > | Subject: Kang Su Gatlin: Linker Whitepaper question
| > | Date: Mon, 9 Aug 2004 23:36:43 -0700
| >
| > |
| > | I recently read your whitepaper under the "extremely long link times"
| post
| > | and have a question that I was hoping you could answer.
| > |
| > | My question is based on the following paragraph:
| > | Directives
| > | The linker's handling of directives left something to be desired in
| > VC2003,
| > | and for this reason code with lots of directives can suffer. In
| > particular
| > | __declspec(expo rt), as it's likely the most common linker directive.
| > | Besides that, don't export functions that you don't need to export.
| > | Besides it becoming a code maintenance nightmare, it also increases
your
| > | link times.
| > |
| > |
| > | Is there some other "better" way to handle DLL exports that makes the
| > | "maintenanc e nightmare" more manageable?
| > | Or do you just think that creating APIs is a bad idea?
| > |
| > | Thanks for writing this article and I hope you can help clear up my
| > | questions.
| > | -Steve
| > |
| > |
| > |
| >
|
|
|

Nov 17 '05 #4

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

Similar topics

0
1767
by: TGF | last post by:
Hello, I am creating a console app. I try to link a static library by including it in the Linker-Input-Additional Dependencies field under the Project properties. Then I specify the path to the library in Linker-General-Addition Library Directories field under the Project options. The first question I have is....is this the correct way...
0
1614
by: TGF | last post by:
Hello, I am creating a console app. I try to link a static library by including it in the Linker-Input-Additional Dependencies field under the Project properties. Then I specify the path to the library in Linker-General-Addition Library Directories field under the Project options. The first question I have is....is this the correct way...
2
1240
by: JD | last post by:
Is there a whitepaper or other documentation that talks about SQL2000 performance limits? For example, transaction/sec limit? (Which I understand that hardware config would be a factor) thanks
1
4973
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a simple GUI app to display datas queried from PostgreSQL. I did make the following changes in the project's settings: ...
9
2727
by: Felix Kater | last post by:
Hi, if I link my code to other o-files: Does the linker include the whole o-file or does it use the needed functions from that only? Felix
0
2212
by: Tom McDermott | last post by:
I am having linker errors : error LNK2022: metadata operation failed (80131188) : Inconsistent field declarations in duplicated types This code linked sucessfully in C++.NET 2002, but does not link (causes several of these metadata errors) in C++.NET 2003.
0
2245
by: YellowFin Announcements | last post by:
Whitepaper: "Yellowfin Reporting" enables Embedded Business Intelligence -------------------------------------------------------------------------------- Embedded reports are a standard requirement of most applications. But users are increasingly demanding more sophisticated reporting from applications - seeking such features as custom...
1
4146
by: Deepath G | last post by:
This is deepath.. I am getting some linker error when i am trying to connect Websphere MQ using Borland C++ Builder 2006 using imqi.hpp on windows. Error Message ----------------------- Error: Unresolved external 'ImqMgr::~ImqMgr()' referenced from C:\DOCUMENTS AND SETTINGS\228753\MY DOCUMENTS\BORLAND STUDIO...
6
1718
by: ebony.soft | last post by:
Dear all Hi I encountered a simple but IMO important problem about the C++ linkage model and One Definition Rule. Why the following code link? file1.cpp int x; file2.cpp
0
7813
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7431
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7761
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5976
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5337
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4949
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1020
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
709
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.