I created a .so file with G++ and I wrote the file in C++. I put the file in my arm64-v8a files for my decompiled apk and it never booted on start.
I don’t know what the problem was but I think there might be something wrong with my .so. The file was called libhelloo.so. Can someone tell me how to properly compile into an .so file and then where to place the file so that it can run with the app?
Related
I created a simple program that shows an image (bmp) file but now I would like to load a jpg file and I found the "SDL_image" library that seems to do what I need, the dmg file I have mounted, contains a file SDL2_image.framework and a readme.txt reading the readme.txt I see:
To Install: Copy the SDL2_image.framework to /Library/Frameworks
You may alternatively install it in <your home
directory>/Library/Frameworks if your access privileges are not high
enough. (Be aware that the Xcode templates we provide in the SDL
Developer Extras package may require some adjustment for your system
if you do this.)
My questions are:
is g++ searching in "/Library/Frameworks" and "MYHOME/Library/Framework" inside all the frameworks files in order to find the libraries I include in my cpp files?
ones the g++ has built the executable file, do I still need those frameworks/libraries in order to execute it?
if instead of the framework file I use the sources of SDL2_Image library what is going to change to the process?
I am trying to write code in C++ to get content from a url. I have found this url: https://curl.haxx.se/docs/install.html
I tried to:
export MACOSX_DEPLOYMENT_TARGET="10.6"
./configure --with-darwinssl
make
make install
But not sure what it is the new file created? What is the output of running these commands?
After unzipping the files from the zip downloaded I see a file curl.h, I guess I can use that one on my C++ program?
Any help will be appreciated.
UPDATE 1
I have found: "make install" just copies compiled files into appropriate locations.
Which are these locations?
UPDATE 2
Making all in lib
/Applications/Xcode.app/Contents/Developer/usr/bin/make
I understand now that "makefile" is the one setting where to copy files, etc.
You should use Homebrew. It is a package manager for OS X, and has tons of packages you can install from, including curl.
I am writing a c++ program from the windows cmd prompt, and compiling with mingw (g++). This program needs a non-linear optimiser and NLOpt looks like a good choice. I learnt c++ for a uni course, so the environment I was using was already set up, I have no experience in setting up libraries etc.
So far my steps have been;
Download the precompiled DLLs for 64-bit windows (which is what I'm running) from here.
Run the command dlltool --input-def libnlopt-0.def --dllname libnlopt-0.dll --output-lib libnlopt-0.lib (from the same page), which ran without errors.
This creates an .hpp file, however, when I try to #include the file I get
In file included from optimiseDogs.cc:9:0:
C:\Files|Development\NLOpt2.4.2\nlopt.hpp:29:19: fatal error: nlopt.h: Nosuch file or directory
#include <nlopt.h>
nlopt.h and nlopt.hpp are in the same directory as each other. My program is in a different folder.
This is probably really basic, sorry to trouble you with it. Perhaps I am not completely alone in my ignorance and this will help someone else too. Also, I have seen this question, but it deals with installing on visual basic, and I'm not using a GUI, just notepad++ and the cmd prompt.
Thank you for your help.
If you are in windows and using mingw: downloaded zip archive already contains .dll and .lib files. So you dont need to run dlltool which creates these .lib,.dll from .def. I think your problem is compiling command using g++ adding include and library path directives.
C:\Files\Development\NLOpt2.4.2>g++ <path_of_source>.cc -o program.exe -L. -lnlopt -lm -I. -I<path_of_your_headers>
I encounted in the past that order of -I and -L may matter so try changing if not working.
Please see this tut and that tut to understand the concept.
So I want to install the dxflibn (it allows for the program to read and write .dxf files). You can find the files here. I found, on there site, this Programmer's guide. If you go to page 3, it says how to install the library. It says to use cygwin and MinGW32. I have not used this tools before so need some help.
From what I read (when I was researching these tools), the MinGW32 is used to install the compiler needed and the Cygwin can emulate the Unix system. I do have some experience with Unix command line but limited.
Back to the instruction on page 3, it says to run two commands. The first command is for executable but from the file I downloaded (the dxflib zip) there is no "configure" file to execute. While searching even more, I found the the .pro file that is in the folder of the library can produce a make file but not sure how.
Questions:
What exactly do I need to do to install the dxflib?
After I install it, for me to run it from my C++ code, what do I need to do? I read here that I need to:
A) put the header files in a location which your compiler is aware of
B) put the dll files in a location which your linker is aware of.
Any help would be amazing, tnx :)
I was able to find a solution after all.
For question 1:
I first went and installed qmake (from the Qt website).
After that, I needed to include in my "system parameters" the qmake.exe so I can run it from the Command Prompt line (like it says here).
And finally, I opened cmd, navigated to the library directory and run the command qmake -spec win32-g++ dxflib.pro (as suggested here). This created the make file.
Now run the command MinGW32-make. This will create a "release" folder with with a static library (that will be needed a the next step) and come .o files.
For question 2:
I used the Dev-C++ IDE. After I had created a project, I went to "project>project options".
Under "Directories>Include Directories" I added the path of the source code of the library (path_of_where_you_unziped_the_library\dxflib-3.7.5-src\src).
Also, under "Parameters>Linker" I added the .a file that is under the "release" folder (path_of_where_you_unziped_the_library\dxflib-3.7.5-src\release)
This worked for me :)
So I have created a piece of software which I wanna package and post to Arch Linux User Repositories, AUR, -should note, that I have never packaged anything for any distro before - and I have also got it packaged and installed on my own machine via Arch's package manager Pacman successfully, but now I am wondering how on earth am I gonna structure the folders and files?
Normally when I wrote software, I use this structure:
build/ | src/ | makefile
As a minimum, and in the case of this piece of software, the makefile does nothing more than compile a .cpp file from src/ to build/.
To make the Arch package, I also had to create a .rc file, to use the program properly as a daemon and the PKGBUILD file, which is the file that tells the makepkg program how to build the installer-package - these two files, though, are specific to Arch.
If I wanna package the program for say debian, I would need another set of files to do this too, but these files only work for debian. Now, I can't just put the .rc file and the PKGBUILD file in to the programs root folder, since that would "be a mess" especially if I also had files to build a package for debian, but where do I put the distro-specific files? I need to have it in the programs root folder -at-least- to be able to keep track of it, and my initial thought was to go with a structure like distro/arch/ for Arch Linux specific files, and then the PKGBUILD file would just run the makefile in the programs root folder and copy the compiled file from build/ to distro/arch/ before it did anything else, but I discovered that I couldnt get PKGBUILD to work that way, and people on #archlinux on Freenode also said it was not a smart idea.
So where do I put the distro specific files? If I knew I only had to provide this program for Arch, it would be easy to just structure it only for Makepkg, but I dont like to imprison the softwarelike that, and I could also imagine providing packages for other mayor distros like debian, so how do I achieve this while keeping a sane file structure?
Regards,
Chris Buchholz
Very often you find in tarballs a directory called 'debian' which has the debian specific files in it. I would go the same route and create a directory 'archlinux' and put the files there.
Then I would go on and put a file README in the archlinux directory that explains how to use the PKGBUILD properly.
One solution could be to write a rule into your Makefile 'package-arch' that copies the PKGBUILD into the root directory, runs makepkg, then deletes the redundant PKGBUILD.
It's hackish, so I would also write a bug report for the Arch people to fix this limitation. However, did you try makepkg -p archlinux/PKGBUILD?