Accesing static functions/vars from other file

J

Javier M Mora

I'm working with nesc and tossim. nesc is a variant of C. And tossim is
a C++ library to simulate motes with TinyOs. When I try to simulate a
mote, I have my nesc source, it's compiled to a C++ and is linked to
tossim library and to my C++ simulation source code.

In nesc compilation, I get a C++ source (lets call .nc.cpp) code but is
only to debug, the toolchain automatically generate the .o file to link
with other sources. So, it's useless to modify than C++ debug file.

The problem is all functions and vars of .nc.cpp are defined static. So
I can't access freely to that contents (and I want access).

If I run my program with dbg, I can access thats functions but I can't
inside my program...

Are there some trick to access that variables?

Is it possible manipulate .o file to make public the vars?

PS: I'm linux and use gcc toolchain

Javier M Mora
 
R

red floyd

Javier said:
I'm working with nesc and tossim. nesc is a variant of C. And tossim is
a C++ library to simulate motes with TinyOs. When I try to simulate a
mote, I have my nesc source, it's compiled to a C++ and is linked to
tossim library and to my C++ simulation source code.

In nesc compilation, I get a C++ source (lets call .nc.cpp) code but is
only to debug, the toolchain automatically generate the .o file to link
with other sources. So, it's useless to modify than C++ debug file.

The problem is all functions and vars of .nc.cpp are defined static. So
I can't access freely to that contents (and I want access).

If I run my program with dbg, I can access thats functions but I can't
inside my program...

Are there some trick to access that variables?

Is it possible manipulate .o file to make public the vars?

PS: I'm linux and use gcc toolchain

I'm afraid you're in the wrong group. Nothing in your question relates
to the C++ language proper. You need a group for either Linux
programming, or the GNU toolset.

Try either comp.unix.programmer or gnu.g++.help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,369
Latest member
Carmen32T6

Latest Threads

Top