How to compile a Make file for C service

Hi All,

I am trying to run a C service in Integration Server.

I have done everything except compiling Make file.

When I run the C service, its saying “java.lang.reflect.InvocationTargetException: Link Error: cS”

I don’t know if this is because of not compiling Make file.

Can somebody help me answering the following two questions…

“How to compile a Make file for C service”

“Why am I getting the above exception ? How can I solve it ?”

Thanks in advance,
Srinivas.

Interesting. In all my years of experience with a variety of companies using IS I’ve never once had anyone try to create a C service. Noone has even asked about it. So this makes me very curious as to why you want to create one. Can you share some of the rationale and details?

As far as your specific issue, have you followed all the steps outlined in the Developer User’s Guide? The “Link Error” does indeed seem to point to an issue of some sort related to compiling and linking your C program. You do indeed need to run make using your makefile to create the .dll.

I would offer that if you’re unsure about using a makefile to compile and build an executable, then you may want to consider a solution path other than a C-based approach. C isn’t exactly mainstream anymore.

Hi,

Thanks for the response.

There is no specific reason for choosing a C language. I like C I want to implement one C service in IS and started working towards that.

I have followed all the steps. In Developer’s guide I have seen a command “make -f filename.mak” . I don’t know where should I run this command exactly. If I complete this step I can successfully run this service.

Yes, As you said C is not that good here, we have to restart the server many times, which may not be possible when used for real time use.

Thanks.
Srinivas

Did you run the make command? If not, then you didn’t “follow all the steps.” If you don’t run the make, there is no way on this earth that the C service will ever work.

Is this a statement or a question? You must compile and link the C program. While you can use various tools to do so, the most common, repeatable and error-free way is to use a makefile and the make utility.

The need to restart IS in this situation is due to misbehaved C/C++ programs. Memory leaks, stomping on memory, (all the usual bugs found in C/C++ programs) can make the JVM unstable or outright crash it.

When the use of C/C++ is required (which is fairly rare) I always recommend placing such libraries on their own IS instance. That way, a crash or other issue impacts only the interface using those libraries and not all of your integrations.

Hi,

I have not yet run make Command. I am tying to know where should I run that command :slight_smile:

"
If I complete this step I can successfully run this service." This is just a state ment.


We have to resetart the server everytime we make changes to Make file and then compiled. Please find the text from WM Developers user Guide …

[I]"[FONT=PalatinoLinotype][SIZE=2]Once your program compiles successfully, restart webMethods Integration Server to

reload the code\libs directory."

[/size][/font][/i]

Yup. All the more reason to avoid using C/C++.

For the make command, where have you tried so far?

Are Your IS running on Linux or Windows ?
On Linux gcc, make is a stnadard.
On Windows not: You can download some free compilators, but I dont know if IS *.lib files have compatibile layout with i.e. MinGW compiler http://www.mingw.org. There is a few very good free IDEs: http://upp.sf.net, http://www.parinyasoft.com, Eclipse and NetBeans have plugins for C++, but maybe use of MS VC++ is required.
You need to use JNI I think - it’s quite simple, but You may do some console application embedding Your wtitten in C++ functionality, and communitate with this console application by opened in/out streams from different Java/IS process - this approach guaranties stability of IS process - JNI not !
I have, C++, Java and WM experience but never combine them before - I may try if You really need a help in this case.