Android NDK debugging (project created with make i.e. Android.mk) - debugging

I've spent way too much time until now so I need you help friends, here's the deal:
I need to have a native debugger to debug some C files I am creating in the project which use a prebuilt C library I have.
I can do the debugging with:
the GDB right? nope! because it does not work with make files.
the GDB and use the ndk-build script, fine, I can do that, but now I cannot include a search path into the script, I tried a cFlag, different things, does not work.
What should I do? how the ... should I debug my code and have some a search paths for the prebuilt library?
I hope I am clear, please ask questions, will answer any of them! Thanks friends.

Related

How to compile srlua (or a link to the binaries)

Related:
How to compile srlua?
How do I Make an executable Lua script using srlua?
The first link is the exact question I am asking here. However, the sole answer is unsatisfactory as it assumes multiple things, namely that the OP is already using Cmake (a fact disproved by the OP's comment on the answer). The second link seems to already be most of the way through a tutorial, and while a link to precompiled binaries for both srlua.exe and srglue.exe are provided, the link no longer contains binaries but instead the source.
I have found several other threads on various websites all asking the same thing, but all of them either assume that you essentially already know how, or explain nothing (many have potentially helpful links, but they are old and no longer work).
I have already tried to compile srlua, and got a srglue.exe, but when I tried srlua.c I ended up with a list of undefined references (such as "lua_type" or "lua_getfield").
lua_getfield, lua_type, lua_settop, lua_getfield, lua_type, lua_settop, lua_pushstring, lua_pushinteger, lua_call, lua_pushfstring, lua_load, lua_tolstring, lua_tointeger, lua_touserdata, luaL_openlibs, lua_createtable, lua_pushstring, lua_rawseti, lua_setfield, luaL_checkstack, lua_pushstring, lua_call, lua_tolstring, luaL_callmeta, lua_type, lua_type, lua_typename, lua_pushfstring, luaL_newstate, lua_pushcclosure, lua_pushcclosure, lua_pushinteger, lua_pushlightuserdata, lua_pcall, lua_tolstring, lua_close
My question is this:
How does one use a C compiler (I know the basics of gcc) to compile srlua specifically? Or, if anyone has a functioning link to either precompiled binaries or a tool to compile the binaries, could they share it?
Important: I am on Windows. Thus, I cannot just use make. I must actually compile the .c files to .exe files. I am asking how. If you simply provide links to threads with the aforementioned problems, you are not helping. If you give an answer that assumes in-depth prior knowledge of a particular tool that does not have good documentation, you are not being helpful. If you tell me tools to use, but not the specific procedure for compiling srlua, you are not being helpful. If there is a better place for this, tell me and I can move it there.
I don't know any Windows pre-compiled binaries for srLua.
To compile srLua, you should first install the Mingw compiler to use GCC as a C compiler : you can install TDM-GCC (https://jmeubank.github.io/tdm-gcc) or http://winlibs.com.
You can then open a Console prompt. Enter the "gcc" command to be sure that the compiler is working (and that the PATH is correctly set).
Then go to the directory you extracted the srLua source files and type the command :
mingw32-make
Cross your fingers and it should compile everything :)
When linking, you should include the Lua libraries with the -l Switch : -llua54 for Lua 5.4 library for examples.
I found this already compiled release on webarchive, it's kinda old but works:
https://web.archive.org/web/20130721014948/http://www.soongsoft.com/lhf/lua/5.1/srlua.tgz

MinGW make file compiles but codeblocks will not build

I am trying to convert a C program to VB.NET. (I know, just accept I have my reasons and leave it at that).
Anyway, I wasn't sure if the source code I had was any good so after about a week of pulling my hair out I finally downloaded CodeBlocks, grabbed the MinGW directory and I can make working successful build from a command line using Mingw32-make. Now I want to use codeblocks to build the file because ultimately I want to be able to step through the code however when I try I just get a bunch of errors and no exe. I am not sure what I am doing wrong and just need help. For that matter is there anyway to just have MinGW create some kind of debug info that would be usefull in Visual Studio? I am not a C programmer so sorry if it seems obvious.

How to Publish/Export wxWidgets Application

newbie here.
Want to ask for any advice on how to Publish/Export, CodeBlocks Application made by using wxWidgets. After some research, i discovered that i should use DLL, or something like that, but since I am really new into it, I am missing the logic on how I should actually implement that. Since CodeBlocks offers wxWidgets and DLL as separate projects. So I am not really sure how to properly combine. Thanks in advance.
If you used wxWidgets as .dll, to get a self-standing package you have to distribute all the requested libraries. The simplest way is just to copy them from their source folder (in your case [wxWidgets root]\lib\gcc_dll) in the same folder as your executable. There could be many of them, but usually only two or three are needed. For simplicity you can copy them all, or you can try repeatedly to start the program, and add each time the library indicated in the error message.
Please note that to distribute your application you will probably want to compile it in Release mode, and consequently you should ship the Release .dlls (i.e. beginning with wx...28_ instead of wx...28d_).

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.

Getting QMake to generate a proper .app

I have a large exiting C++ project involving:
4 applications
50+ libraries
20+ third party libraries
The project uses QMake (part of Trolltech's Qt) to build the production version on Linux, but I've been playing around at building it on MacOS.
I can build in on MacOS using QMake just fine but I'm having trouble producing the final .app. It needs collecting all the third party frameworks and dynamic libraries, all the project's dynamic libraries and making sure the application finds them.
I've read online about using install_name_tool but was wondering if there's a process to automate it.
(Maybe the answer is to use XCode, see related question, but it would have issues with building uic and moc)
Thanks
I'm sure this could be of some great help for you :
deployqt
Hope this helps !
We have the same problem at Last.fm, I looked at DeployQt and it's not much use if you have third party libraries. In the end I wrote a perl script that generates a Makefile, which you can use to generate a .app and/or .dmg.
I uploaded it here: http://www.methylblue.com/detritus/QMake.dmg/
To use it add this to your application's pro file:
macx*:!macx-xcode:release {
system( QT=\'$$QT\' QMAKE_LIBDIR_QT=\'$$QMAKE_LIBDIR_QT\' $$ROOT_DIR/common/dist/mac/Makefile.dmg.pl $$DESTDIR $$VERSION $$LIBS > Makefile.dmg )
QMAKE_EXTRA_INCLUDES += Makefile.dmg
}
I'm sure it's not all yet portable, but it would be good for someone else to use and see if that is so.
This is basically the first official release of this code, so please send me bug reports, and also, improvements. Thanks.
I side-stepped this problem completely by building my Qt app statically on OS X. That might not be practical for you though.

Resources