Android NDK build gives make error 6 - android-ndk

Can't get Eclipse to build my NDK/JNI project. Eclipse, or ndk-build from a command prompt, both give following output:
/cygdrive/c/android-ndk-r8b/build/core/setup-app.mk:75: recipe for target `clean-installed-binaries' failed
make: *** [clean-installed-binaries] Error 6
What is "Error 6"? I can't find any doc on that anywhere. Helpfully, it doesn't say what the problem is, just giving the cryptic error code.
I found setup-app.mk and tried inserting something to echo the command it was executing, which was simply removing some files. I copied and pasted it to the command prompt and it worked fine on its own:
rm -f ./libs/armeabi/lib*.so ./libs/armeabi-v7a/lib*.so ./libs/mips/lib*.so ./libs/x86/lib*.so
Also tried inserting a "whoami" and it matched a whoami directly from the command prompt, so it's not acting as a different user with different permissions or something.
Been stuck on this for days. Can anyone help?
Rob.
PS. I'm finding Eclipse/NDK/JNI almost impossible to work with. It only seems to work for a week or two before falling in a heap again, seemingly with no change from me. This one is now unusable until I fix this error. I also have it installed on another machine, which is now also completely broken for completely different reasons. How does anyone work in this environment?

It's no miracle the actual command works: the error message comes from the make itself, which failed to generate the appropriate command!
Now what could have happened: most likely, you have some paths with spaces. Make sure that neigher eclipse, cygwin, project, workspace, nor ndk have spaces in their root paths.
Maybe, there is some problem with PATH. I refer to the environment variable in three environments: windows native, cygwin, and eclipse. Could it be that make you actually run is different from what you expect?
Note that you do not need cygwin to build with NDK 7 and higher, simply use ndk-build.cmd.

Related

llvm-sys - Didn't find usable system wide LLVM. But llvm-config is installed

I have built llvm-13.0.1 from source using Visual Studio 17 2022 on Windows 11. When attempting to build llvm-sys (through external crate llvm-ir). It fails, saying:
error: No suitable version of LLVM was found system-wide or pointed to by LLVM_SYS_130_PREFIX.
I know llvm-config exists because I can use it from the command line, and it returns the correct version. I don't understand why this doesn't work. This might be a stupid question but I am really stuck.
I was also having this problem, trying to use llvm-sys on Windows. Here are some mistakes that I did that made it fail to compile just like yours.
Installation Prefix
Make sure that your LLVM installation path doesn't have any whitespace.
Mine was -DCMAKE_INSTALL_PREFIX=C:\Program Files (x86)\LLVM, which was their default install prefix. The whitespace in the installation path causes some errors when using it with llvm-sys. Later, I changed it to C:\LLVM and it worked.
Set Environment Variable
Set Environment Variable LLVM_SYS_<version>_PREFIX to the installed LLVM folder.
From CMD For LLVM-13.0.1
setx LLVM_SYS_130_PREFIX "<PATH TO LLVM WITHOUT WHITESPACE>" /M
Make sure that the variable is registered by using echo command
echo %LLVM_SYS_130_PREFIX%
It should output your registered path, not %LLVM_SYS_130_PREFIX%.
If it doesn’t output your path, restart the computer and try again and it should be working.
Now you should be good to go .....
Hope this helps :)

'no rule to make target' with no reason

I was installing this program: THERMUS, that, as i know should install fine. I/m installing this program through ubuntu console. But when i run make all i got this message:
make: ***No rule to make target '/main/TTMParticle.h', needed by 'BQConstrainQ.o'. Stop.
I know that it could be caused by the fact that file TTMParticle.h doesn't exist in /main/, but i checked - it's there.
Your environment variable THERMUS is not properly set. The build instructions mention:
3 . Set an environment variable `THERMUS' to point at the top-level
directory containing the THERMUS code
It does not mention that you have to do export THERMUS to make that variable available to other processes, like make, so you might have forgotten that -- or not have set THERMUS at all. Without actually having tried it, I think the fastest way to get rid of this message is to run make as follows:
THERMUS=.. make all
To track down the issue, check out the file functions/makefile where you problem occurs. It mentions:
SEP_CLASSESH = $(THERMUS)/main/TTMParticle.h \
and later contains the dependency
$(FNCSO): $(FNCSS) $(SEP_CLASSESH)
which is the line that causes the actual error, because
FNCSO = BQConstrainQ.o \

How do i resolve the procedure entry point_impure_ptr error in cygwin/opencobol?

Whenever I try to run my .exe cobol file, i get this error..
fileName.exe Entry Point Not Found
The procedure entry point_impure_ptr could not be located in the dynamic link library cygwin1.dll
I am using OpenCObol and cygwin ver1.7.15.thanks
You'll need to specify the proper path for the command below, but Cygwin seems pretty persnickety with entry point addresses and updates, The system includes a rebaseall command to help fix this problem. Most times I've witnessed it is after a setup.exe pass, while the Cygwin system was still active (and perhaps only in the background and not visible).
C:\Users\btiffin\cygwin\bin\dash -c '/usr/bin/rebaseall'
Run that from a Windows CMD shell (while Cygwin isn't active, say after a clean boot and before running the Cygwin shell. Basically cygwin1.dll can't be open). You'll need to use the proper Windows path to dash for your particular install. Google Cygwin rebase for detailed articles.
I had a similar error message after upgrading from cygwin version 1.5 to 1.7. I solved it by completely removing and reinstalling 1.7 from scratch. I was told there might have been a problem with multiple versions of dlls.

bash.exe - entry point not found

when trying to install cygwin, I keep getting this error message:
the entry point
rl_filename_rewrite_hook could not be
located in the dynamic link library
cygreadline7.dll
Has anyone seen this before ?
Thanks
I had the same error with cygwin1.dll. I checked in c:\cygwin\bin and noticed there were two files, cygwin1.dll and cygwin1.dll.new (possibly from a failed or aborted setup run?). The ".new" version was in fact newer (and slightly larger) than the existing cygwin1.dll, so I replaced cygwin1.dll with cygwin1.dll.new, and ran setup again. It completed with no errors.
First idea is to try reinstalling libreadline7 (or similarly named package) using the cygwin installer. Use the search field to enter readline to make it easier to find the right package.
Another option is that in the cygwin installer, change form Curr to Prev in order to switch to the previous-stable release. This means lots and lots of downloading and reinstalling. I anctually did manage to provoke my error into becoming a libreadline7 error, and switching to Prev at least got rid of the error messages. (Yay! Now bash, ssh server and git is working again! Back to work here then...)
Please check your path in WINDOWS (advanced system properties) environment. I found that C:\WinAVR\bin was coming before my cygwin path, so I moved that to the end, fixed my issue.
If you have multiple CYGWIN1.DLL files in your system, it definitely causes headaches if you're not careful.

Cygwin make error : *** target pattern contains no `%'

I got this error while (re)building, using cygwin make.exe version :3.81.
Error : *** target pattern contains no `%'.
This error is due to a presence of a ":". Therefore it no longer supports windows paths.
You need to download version 3.80 and replace the make.exe in the \bin directory.
Apparently it needs cygintl12.dll too.
rollback to make 3.80 (Geant4)
cd /usr/bin
mv make.exe make_381.exe
wget http://geant4.cern.ch/support/extras/cygwin/make.exe
chmod +x make.exe
install libintl2 from cygwin setup for the required cygintl-2.dll
I got the same error when trying to build a project on Linux or OSX, that was previously built on a Windows machine and had some .o.d files hanging around in the output folder.
Once I manually deleted the .o.d files the problem was resolved. Apparently the "Clean" command of my IDE (CodeLite in this case) wasn't deleting the .o.d files.
Most likely due to the presence of a colon following a drive letter. For example consider
build : $(NativeHeaders)/*
If
NativeHeaders=../../../cpp/generated
then all is well, but
NativeHeaders=C:/dev/folder/cpp/generated
results in the error that you get.
I was getting this error because I didn't have a Tab (\t) character at the beginning of my commands. I had expandtab in my vim set so it was replacing a tab character with 4 spaces. When I turned that off and changed spaces to a tab it was fixed
I had the target pattern contains no '%' error while building with the Android NDK using cygwin.
I found the following link helpful:
Errors Generated by Make
‘missing target pattern. Stop.’
‘multiple target patterns. Stop.’
‘target pattern contains no `%'. Stop.’
‘mixed implicit and static pattern rules. Stop.’
These are generated for malformed static pattern rules. The first means there’s no pattern in the target section of the rule; the second means there are multiple patterns in the target section; the third means the target doesn’t contain a pattern character (%); and the fourth means that all three parts of the static pattern rule contain pattern characters (%)–only the first two parts should. If you see these errors and you aren’t trying to create a static pattern rule, check the value of any variables in your target and prerequisite lists to be sure they do not contain colons. See Syntax of Static Pattern Rules.
And so, my solution included changing my system variables from Windows format to Unix format like so:
Instead of C:\Android\android-ndk-r10c, I used /cygdrive/c/Android/android-ndk-r10c for the NDK path.
Similarly, I changed the NDK project path to /cygdrive/c/Android/project/src/main/jni.
In my case I was using CMake under Cygwin when I got this error. It turned out the Windows version of CMake was executed. Subsequently, Windows paths were used in the make file. I installed Cygwin's version of CMake through the setup program and got it working.
I had this problem on Linux when the build directory contained a ":" caused by doing a mercurial checkout which created a directory named "server:port".
I had to change the following in my make file to be compatible with Make_381:
before:
ARDUINO_BASE_DIR = C:\programs/arduino
now:
ARDUINO_BASE_DIR = \\programs/arduino
Try this if you're running Eclipse C/C++ and referencing files from Cygwin under Windows, make sure c:/cygwin/bin or c:/cygwin64/bin comes after your preferred compiler tools in your Windows Path environment.
Example:
Path = ;C:\yagarto\bin;C:\yagarto-tools\bin;C:\cygwin64\bin;
After making the changes, exit Eclipse and restart for it to take effect (simply restarting Eclipse without exiting won't fix the problem.
In my project, obj folder was probably corrupted and I was getting this error. Manually deleted obj folder. Then ndk-build completed fine.

Resources