Diving into gsoap, Makefile.am of examples in ubuntu pkg, - gsoap

hi
i find it quite hard to get gsoap running.
Need to mention my knowledge of C/C++ is quite limited.
In /usr/share/doc/gsoap/ i see
Makefile.c_rules
Makefile.cpp_rules
Makefile.defines
In /usr/share/doc/gsoap/examples :
the README says just make but there is only Makefile.am
So i did make -f Makefile.am
examples/ck$ make -f Makefile.am
/usr/bin/soapcpp2 -I/soapcpp2/import ck.h
and then all the source code is created.
And then??
What is the application?
For my project i just need a WS client, but i guess i better create a server too so i can test it with it.
Hope my question is clear enough.. :-/
greets, florian

The Header File ck.h contains the functions from your service. The gSoap compiler soapcpp2 creates the stubs and skeletons. To create a test-server you can view the documentation on how to create a standalone server. If you compile your standalone-server you will get undefined references because you have to implement the functions from your ck.h file. Take a look at the example from the gSoap documentation. The calc.h file represents your ck.h file. There is also a quick start guide for developing a client and server.

Related

Using rtags for indexing firefox source code

I am using rtags which is a C++ source code indexer based on clang. I have been able to play around with it and now I want to actually index the firefox source code. I am pretty new to this stuff and this tool uses cmake to generate a compile_commands.json file to pass over to the program that indexes code.
Is there a way I can generate a the compile_commands.json file for the firefox source code that provides the exact compilation line for each translation unit inside the firefox source?
You can generate compile_commands.json by
mozilla_cnetral/mach build-backend -b CompileDB
In my environment(Ubuntu 16.04), it was created at mozilla_cnetral/obj-x86_64-pc-linux-gnu/.
Reference:
https://developer.mozilla.org/en-US/docs/Developer_Guide/Editor_Configuration#rtags_(LLVMClang-based_Code_Indexing)
Not sure if I follow the part "Is there a way I can generate a the compile_commands.json file for the firefox source code that provides the exact compilation line for each translation unit inside the firefox source?". But I can offer simply that you can generate a compile_commands.json file from a make-based system using the bear utility (which I obtained from my package manager: brew). After a make clean, I do 'bear --append make' and it traces the make build process and produces the compile_commands.json. More can be learned here: https://vxlabs.com/2016/04/11/step-by-step-guide-to-c-navigation-and-completion-with-emacs-and-the-clang-based-rtags/
As the article referenced implies, my motivation was to be able to use the wonderful rtag system inside Emacs. Hope this helps a bit.

Python/C API: Statically-Linked Extensions?

I've been writing a Python extension use the Python/C API to read data out of a .ROOT file and store it in a list of custom objects. The extension itself works just fine, however when I tried to use it on a different machine I ran into some problems.
The code depends upon several libraries written for the ROOT data manipulation program. The compiler is linking these libraries dynamically, which means I cannot use my extension on a machine that does not have ROOT installed.
Is there a set of flags that I can add to my compilation commands to make these libraries statically linked? Obviously this would make the file size much larger but that isn't much of an issue providing that the code runs at the same speed.
I did think about collating all of the ROOT libraries that I need into an 'archive' file. I'm not too familiar with this so I don't know if that's a good idea or not.
Any advice would be great, I've never really dealt with the static/dynamic library issue before.
Thanks, Sean.

how to generate makefile for a C source file

I've never tried to do this before so this is actually my first time to cross compile a C program.
I have a main.c code file and need to create a makefile for it so i can cross compile this file. This c file has a dependancy curl library. When I compile it in xcode by adding a library, it builds fine. However,i still need to create a makefile for the cross compiling. Can I generate that makefile with xcode? If so, can you please provide some step to step guidance or do i need to use another tool to generate it?
Alternative approach
You can use CMake for this task. First of all take a look at this tutorial, that explains CMake basics. Then take a look at toolchain documentation.
Take a look at this post too.
Btw OpenWrt has also support for CMake based projects, just look at uci and libubox packages.

Modification of the AST-tree of the GCC compiler

It is needed to gather the necessary information about the translation unit using the plugin for GCC and to modify AST on its base.
I've already understood how to gather information. But I haven't understand yet how to modify AST before it's passed into CRT. Very little information is available on this subject.
Tell me plese what should I read on this subject? Share thoughts, links.
Thank's.
P.S.
I've already read everything on these links:
http://en.wikibooks.org/wiki/GNU_C_Compiler_Internals/Print_version
http://developer.apple.com/library/mac/#documentation/DeveloperTools/gcc-4.2.1/gccint/index.html#Top
The GCC test suite contains a basic examples of such modifications. See http://gcc.gnu.org/viewcvs/gcc/trunk/gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c and start_unit_plugin.c shows how to create a var. Unfortunately for more serious modifications the GCC source code are probably your best bet.
Are you tied to GCC for this endeavor? The ROSE compiler is built specifically for performing source-level modification, then handing the resulting code off to a backend compiler.

Converting .DLL to .SO

Can any one of you help me in converting an windows dll file in a .so file.
You might try re-compiling the source code to the dll to a shared object. This may help you get started, after ensuring the code is indeed portable.
Edit:
Here is yet another link that can help guide you through the process of creating a shared library using GCC and other parts of the GNU tool chain. This link will help you to discover pitfalls that other people had when undertaking a project similar to this.
There is only so much help that can be provided for such a specific task, especially with so many unknowns. If you elect to provide more information in your question, please leave a comment.
NB: I'm pulling these links right out of Google.
If you don't have the source, or can't recompile, you may be able to run the code under Wine.
You need to recompile again into an .so file.

Resources