I have C++ source for an IFM plugin that I developed with MS Visual C++ 2010 Express which I'd like to use for FEFLOW 6.1 under Linux (CentOS via RPMs) for some batch runs. How can this module be compiled? Here is what I've tried, using the older HelloWorld example from outdated documentation for the Motif interface ([url=http://www.feflow.info/fileadmin/FEFLOW/download/other_docs/ifm_example.pdf]http://www.feflow.info/fileadmin/FEFLOW/download/other_docs/ifm_example.pdf[/url]):
In the directory with the various source files HelloWorld.cpp/.h/.def, here are my shell commands:
[code]
g++ -fPIC -I/opt/wasy/sdk/ifm/include -c -o HelloWorld.o HelloWorld.cpp
g++ -fPIC -shared HelloWorld.o -o HelloWorld.so
[/code]
There are no errors from any of the commands. The problem is that the objects are not linked up, so when I try to register this module in the feflow61q GUI, I can browse to the HellowWorld.so file, but I have a FEFLOW ERROR dialog:
[quote]
Cannot load "/path/to/HelloWorld.so": /path/to/HelloWorld.so: undefined symbol: IfmRegisterModule
[/quote]
Obviously there is some kind of library linking error. Note when I compiled the module, I specified the include directory, but not a library, since I don't know where this is. It was not provided by wasy-feflow_ifm_devel-6.1-10.noarch.rpm, as the /opt/wasy/sdk/ifm/lib directory is empty. What am I missing?
[hr]
[b]Some progress[/b]: It appears that libifm.a can be built somewhat following /opt/wasy/sdk/ifm/src/Imakefile (I don't have imake, or root access, thus I do my work in a different directory with copies of the source files):
[code]
cd /path/to/wasy/sdk/ifm/src
gcc -fPIC -I../include -I../include/xdk -c *.c
ar rcs ../lib/libifm.a *.o
[/code]
Then libifm.a can be copied into the same directory as HelloWorld to recompile with the new bits:
[code]
cp /path/to/wasy/sdk/ifm/lib/libifm.a .
g++ -fPIC -I/opt/wasy/sdk/ifm/include -I/opt/wasy/sdk/ifm/include/xdk -c -o HelloWorld.o HelloWorld.cpp
g++ -fPIC -shared HelloWorld.o libifm.a -o HelloWorld.so
[/code]
And following the same registration procedure as above, I now get an error dialog with "undefined symbol: XtDisplay". I feel like I'm getting closer, but I can't say I know much about the X11 library, nor do I care. I don't require graphics for my objective. Dropping -lX11 in at various places didn't seem to do anything.