By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,418 Members | 1,104 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,418 IT Pros & Developers. It's quick & easy.

Loading dynamic code into C++?

P: n/a
BCC
Hi,

Is there any way in c++ to load and execute code from a file,
integrating it into the original application?

I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Thanks,
B
Jul 23 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
[answering in comp.lang.c++]

BCC wrote:
Is there any way in c++ to load and execute code from a file,
integrating it into the original application?
No, not portably. However, if you are asking, you must have heard of it,
so there is probably a way on your platform. You need to ask in
a newsgroup for your OS or compiler.
I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.


Are you talking about *interpreters*? Then there are those on the market.
Just google for them.

V
Jul 23 '05 #2

P: n/a
BCC
Victor Bazarov wrote:
I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Are you talking about *interpreters*? Then there are those on the market.
Just google for them.

V


Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.

B
Jul 23 '05 #3

P: n/a
BCC
Victor Bazarov wrote:
I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Are you talking about *interpreters*? Then there are those on the market.
Just google for them.

V


Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.

B
Jul 23 '05 #4

P: n/a
BCC
Victor Bazarov wrote:
I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Are you talking about *interpreters*? Then there are those on the market.
Just google for them.

V


Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.

B
Jul 23 '05 #5

P: n/a
BCC
BCC wrote:
Victor Bazarov wrote:
I suppose this might be like dynamic classes, except that I would
want to be able to load in flow control statements, commands,
variables, etc.


Are you talking about *interpreters*? Then there are those on the
market.
Just google for them.

V

Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.

B


Lame. Sorry about the multi reply...
Jul 23 '05 #6

P: n/a
BCC wrote:
Hi,

Is there any way in c++ to load and execute code from a file,
integrating it into the original application?

I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Are you asking about something like Windows dlls?

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #7

P: n/a
"BCC" <bc*@abcz.com> wrote in message
news:Dz******************@newssvr13.news.prodigy.c om...
BCC wrote:
Victor Bazarov wrote:

I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables,
etc.

Are you talking about *interpreters*? Then there are those on the
market.
Just google for them.

V

Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.

B


Lame. Sorry about the multi reply...


I know this suggestion doesn't quite meet your stated requirements, but
Python can be embedded in a C++ program. Of course then you would be
interpreting Python rather than C++ but they are at least superficially
similar and Python was made to be interpreted.

--
Cy
http://home.rochester.rr.com/cyhome/
Jul 23 '05 #8

P: n/a
BCC wrote:
Victor Bazarov wrote:
I suppose this might be like dynamic classes, except that I would
want to be able to load in flow control statements, commands,
variables, etc.
Are you talking about *interpreters*? Then there are those on the
market.
Just google for them.

V

Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.


There is a C/C++ interperter Ch, it is embeddable. You can load C/C++
code/scripts dynamically.

You can check it at:

http://www.softintegration.com/support/faq/embed.html


B

Jul 23 '05 #9

P: n/a
BCC a écrit :
Hi,

Is there any way in c++ to load and execute code from a file,
integrating it into the original application?

I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Thanks,
B


You need to make a dynamically loaded library (dl). Here is the link you
can browse in order to do the following :
http://www.faqs.org/docs/Linux-HOWTO...ary-HOWTO.html

--
Salutations,

Joachim Naulet

06 14 90 06 21
http://jnaulet.no-ip.com
Jul 23 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.