Thanks, Axel, for your reply!
As far as the application I am concerned with does, it 'asks' Maple to redirect its output to stdout, so then it can 'capture' the output (in this case, the generated code).
In the meantime between my post and your reply, I have tried to build and run the example provided with Maple that does something similar to my application to acess Maple from C code. The source code for the example can be found at $MAPLE_ROOT/samples/OpenMaple/cmaple/omexample.c
This example provides a 'fake' Maple command prompt, and underneath, uses the EvalMapleStatement() function to ask the 'real' Maple to perform the command typed at the prompt, and return the result.
Here is the compile command line, output warnings (do not care for them) and sample session with the example program (I tried with and without -lm -lc -lgmp -lmaple within the switches, to try if there was any difference; there was not):
sancheg@mills:~/Projects/virtlab/svn/mapleclient/src$ gcc -g -Wall -Wchar-subscripts -Wpointer-arith -Wcast-align -Wsign-compare -Wno-switch -I./ -I/usr/local/maple11/extern/include -L./ -L/usr/local/maple11/bin.X86_64_LINUX -Xlinker -rpath -Xlinker /usr/local/maple11/bin.X86_64_LINUX -lmaplec -lc -lm -lgmp -lmaple omexample.c -o omexample
omexample.c: In function 'main':
omexample.c:115: warning: implicit declaration of function 'strlen'
omexample.c:115: warning: incompatible implicit declaration of built-in function 'strlen'
omexample.c:115: warning: implicit declaration of function 'isspace'
|\^/| Maple (Example Program)
._|\| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2004
\OPENMAPLE/ All rights reserved. Maple and OpenMaple are trademarks of
<____ ____> Waterloo Maple Inc.
| Type ? for help.
CodeGeneration[C](2*x^3,resultname = y)
kilobytes used=45, alloc=31, time=0.00
As you see, the simple arithmetic operation is carried out, but any other function does not. Not even the '?' can trigger the help messages. And the output from Maple is effectively being 'captured' and displayed, which you can guess by the '12' answer for the '3*4;' command.
So it seems that it is not only the CodeGeneration[C]() command that does not work.
There must be some problem with Maple itself in the system I am running it -perhaps licensing issues- that the linking process for the application is not aware of, but that at runtime impedes the execution of some Maple toolboxes or modules or whatever (I have never used Maple before, as you will have already noticed). The same commands typed at the 'real' Maple command line work OK.
I will anyway check the possibiity that the output is being misdirected. The thing that stil bothers me is that the exact same code worked perfectly OK before, and I have found no differences in the commands between Maple v9.5 and Maple v.11..