On Tue, Sep 13, 2011 at 06:10:45AM -0700, Michael Rubinstein wrote:
> Example 2
> ----------------
> 
> Next thing I tried to do was to embed sage in a c program, by
> following
> http://docs.python.org/extending/embedding.html
> but that gave me errors at runtime.
> 
> For example, the following embed.c progam produced the output/errors at the
> bottom of this post. Any ideas what's wrong? Any ideas of better ways to call
> sage from within c or c++?

Some quick googling suggests you may have to call PySys_SetArgv[Ex] (
http://docs.python.org/c-api/init.html#PySys_SetArgvEx ) to set up sys.argv
after calling Py_Initialize(). I haven't actually tried it, though.


-Willem Jan

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to