472,374 Members | 1,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

Exporting Symbols From C++ Object File

Hi ,
myself Chetan

Is There anybody could help me ?

I am working on the project in c++ ,, I am in great confusion that
should I export c++ member functions OR methods to create objects of
that class OR
previously cretaed objects .. So those can be used by users by using
the header file ... of my " class "

But by exporting member functions of C++ class user would not
understand
which are the private // public functions and would get compilation
error ..!!!
OR may simply change the header file from private to public and would
use
private functions ....!!!

So I need information that how compiler checks that a perticular
symbol is private and won't allow us to call it by object from
anywhere ...

Because simply looking at the symbol table from ELF file it's not
getting clear diffrence between the public and private
functionss...!!!
So help ..!!!
Jul 22 '05 #1
3 3776

"chetan" <ro****@indiatimes.com> wrote in message
Hi ,
myself Chetan
I could guess from the header of your posting :-)
Is There anybody could help me ?
Sure, dozens out here.
I am working on the project in c++ ,, I am in great confusion that
should I export c++ member functions OR methods to create objects of
that class OR
previously cretaed objects .. So those can be used by users by using
the header file ... of my " class "
I am also in great confusion as to what exactly you meant in the above
lines. Care to give an example ?
But by exporting member functions of C++ class user would not
understand
which are the private // public functions and would get compilation
error ..!!!
OR may simply change the header file from private to public and would
use
private functions ....!!!

So I need information that how compiler checks that a perticular
symbol is private and won't allow us to call it by object from
anywhere ...

Because simply looking at the symbol table from ELF file it's not
What is an ELF file ?
getting clear diffrence between the public and private
functionss...!!!


Honestly I don't understand your question quite well (may be others might
feel the same). In that case it would be better that you present your
problem clearly with an example.

Sharad

Jul 22 '05 #2
ro****@indiatimes.com (chetan) wrote in news:4cb1a40c.0409222045.9e8b674
@posting.google.com:
I am working on the project in c++ ,, I am in great confusion that
should I export c++ member functions OR methods to create objects of
that class OR
previously cretaed objects .. So those can be used by users by using
the header file ... of my " class "
It sounds like you want to put a class in a library that users can link
with. Is that correct?

Unlike C, there is no industry standard for storing C++ symbol
information in an object file (like "ELF") that is compatible with all
compilers. You will probably therefore have to use the same compiler for
both the library and the client code if you want to link symbolically.

The alternative that is commonly done is to export an extern "C" function
that is responsible for creating the object, which must have all virtual
functions. The client then invokes functions through an abstract
interface so it does not need to link symbolically. This is basically
what COM does in Windows.
But by exporting member functions of C++ class user would not
understand
which are the private // public functions and would get compilation
error ..!!!
OR may simply change the header file from private to public and would
use
private functions ....!!!


The public/private stuff is not represented in the binary file because it
is only used at compile time, not run time. The client compiler will know
which is private and which is public from the header file. You are right
that the user could edit the header file, the access modes could be
chcanged. That is the case even without libraries. It is only a compile-
time mechanism.

Gregg
Jul 22 '05 #3

"chetan" <ro****@indiatimes.com> wrote in message
news:4c*************************@posting.google.co m...
Hi ,
myself Chetan

Is There anybody could help me ?

I am working on the project in c++ ,, I am in great confusion that
should I export c++ member functions OR methods to create objects of
that class OR
previously cretaed objects .. So those can be used by users by using
the header file ... of my " class "

But by exporting member functions of C++ class user would not
understand
which are the private // public functions and would get compilation
error ..!!!
OR may simply change the header file from private to public and would
use
private functions ....!!!
Is that a problem? Why do you care? Are you being paranoid?

So I need information that how compiler checks that a perticular
symbol is private and won't allow us to call it by object from
anywhere ...
It looks in the header file. If the header file has been changed by the user
there is not a lot you can do.

Because simply looking at the symbol table from ELF file it's not
getting clear diffrence between the public and private
functionss...!!!


There is no answer to your problem. Public and private are meant to help the
programmer, there are not a security system to stop the unauthorized
execution of code. If that is what you are trying to do then you are going
to have to look elsewhere.

john

Jul 22 '05 #4

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

Similar topics

7
by: Torbak | last post by:
I got some question about symbols in libraries ... In libraries, there is public symbols and "not public" symbols (private, static)... In C when we use the "static" keyword on the declaration of...
1
by: Torbak | last post by:
I got some question about symbols in libraries ... In libraries, there is public symbols and "not public" symbols (private, static)... In C when we use the "static" keyword on the declaration of...
0
by: Otis Hunter | last post by:
I have been fighting with this for days and your expert help is needed! Below is the code I am executing which results with "Object doesn't support this property or method". The error is occuring...
0
by: Niall | last post by:
I'm attempting to put a C# front end on my unmanaged C++ ray tracer code. It's still in experimental stage, as I have never done anything with exporting types from an unmanaged dll through to a...
47
by: Pierre Barbier de Reuille | last post by:
Please, note that I am entirely open for every points on this proposal (which I do not dare yet to call PEP). Abstract ======== This proposal suggests to add symbols into Python. Symbols...
1
by: mark.heyden | last post by:
Hi Frends, I am facing problems while trying to export data into pipe format. In fact I am fetching records from mysql database and then trying to create a text file ( using pipe as delimeter) ,...
3
by: Bilgehan.Balban | last post by:
Hi, My observation was that a function with `inline' qualifier has file scope in C++ and it's symbol is not exported. Contrary to this, in C an `inline' function symbol is exported, unless it...
6
by: Notre Poubelle | last post by:
Hello, I have a strange situation where I'm trying to export a function in a class, but it won't get exported. I actually have a couple of header and cpp files. Each pair of header and cpp...
12
by: 2b|!2b==? | last post by:
I want to export my C++ classes in a DLL, using ordinal # - rather than by name. Will anyone care to enumerate through the steps required to do this? I am already failiar with exporting classes...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.