crosstool config fail: panel library not found - crosstool-ng

When trying to configure crosstool-ng I run into error: panel library not found
...
...
checking for working ncursesw.h... no
checking for working ncurses.h... yes
checking for Curses Panel library with ncursesw/panel.h... no
configure: error: panel library not found
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
How do I get my hands on the 'Curses Panel Library'?

Related

How to fix 'ld: library not found for -lglib-2.0'

I have to do a compiler with flex and bison for a school project.
They give to me example of new language but I can't compile them..
The code is working fine for other people so the problem come from my Mac. The problem appears when I try to compile with make command, he say "ld: library not found for -lglib-2.0".
I installed "Glib" already but this don't solve the problem.
make
[ 20%] Linking C executable facile
ld: library not found for -lglib-2.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [facile] Error 1
make[1]: *** [CMakeFiles/facile.dir/all] Error 2
make: *** [all] Error 2
I need to compile the code to work after on the project.
Thanks you

What does this linking error mean when installing portmidi?

After I configured the cmake file for portmidi, and proceeded to use make to make the necessary files, I encountered this error during compilation:
- Build files have been written to: /home/mycomputername
/Desktop/portmedia/portmidi
[ 2%] Linking C shared library /Release/libpmjni.so
/usr/bin/x86_64-linux-gnu-ld: cannot open output file /Release/libpmjni.so: No such file or directory
collect2: error: ld returned 1 exit status
pm_common/CMakeFiles/pmjni.dir/build.make:251: recipe for target '/Release/libpmjni.so' failed
make[2]: *** [/Release/libpmjni.so] Error 1
CMakeFiles/Makefile2:87: recipe for target 'pm_common/CMakeFiles/pmjni.dir/all' failed
make[1]: *** [pm_common/CMakeFiles/pmjni.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
I'm quite confused. I've tried to insert the flags -fpic in the cxx-flags section of ccmake and change the default java install paths to no avail. Quite frankly, I think it has to do with the messing up of execution order, but I don't know where.
Any help will be greatly appreciated.
Apparently, there was some configuring to do in the directories that CMake points to in ccmake configuration. I just redownloaded the files and unzipped it into a newly made portmedia directory. Also, to make sure that you don't get any hiccups in making pm_defaults, refer to Nate's answer. To quote:
Apparently, one of the Makefiles generated by ccmake is broken. I was able to fix the issue by running
sed -i 's/pm_java\/pm_java/pm_java/' build.make
in the pm_java/CMakeFiles/pmdefaults_target.dir/ subdirectory of the
project after running ccmake . (on Ubuntu, though). (The sed
command replaces all occurrences of pm_java/pm_java by pm_java.)
Everything compiles, and I can even run pmdefaults from the
Release directory using
java -Djava.library.path=. -jar pmdefaults.jar

Using cmake with a shared (dynamic) library

I'm trying to use a simple shared library that I made with a file that just contains a main method.
I first ran cmake . which worked fine and didn't return any errors.
Then I ran make but got this error:
$ make
Scanning dependencies of target myprog
[ 50%] Building C object CMakeFiles/myprog.dir/main.c.o
[100%] Linking C executable myprog.exe
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lhello-user
collect2: error: ld returned 1 exit status
clang-3.8: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/myprog.dir/build.make:95: myprog.exe] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/myprog.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
The CMakeLists.txt file
cmake_minimum_required(VERSION 2.8.8)
project(LIB_EXAMPLE)
set(CMAKE_C_COMPILER clang)
add_executable(myprog main.c)
target_link_libraries(myprog hello-user)
The library exists inside of /usr/local/lib/ as libhello-user.dll.a
Note: Im using Cygwin for cmake and make
Turning my comment into an answer
See CMake/Tutorials/Exporting and Importing Targets.
You either have:
to name a full path for the library
CMake is not searching for it automatically
you would have to add something like find_library(_lib_path NAMES hello-user)
or - better - put those into an IMPORTED target
cmake_minimum_required(VERSION 2.8.8)
project(LIB_EXAMPLE)
add_library(hello-user SHARED IMPORTED GLOBAL)
set_target_properties(
hello-user
PROPERTIES
IMPORTED_LOCATION /usr/local/lib/libhello-user.dll
IMPORTED_IMPLIB /usr/local/lib/libhello-user.dll.a
)
add_executable(myprog main.c)
target_link_libraries(myprog hello-user)

Failed to build C code by using generated NDK toolchain

I am working on build a c library for android 5.1.1.
First I build a standalone toolchain by following the google ndk standalone toolchain guild.
<prebuilt_ndk_r12b_path>/build/tools/make-standalone-toolchain.sh --platform=android-22 --ndk-dir=<prebuilt_ndk_r12b_path> --install-dir=/home/r0ng/utilities/ndk --toolchain=x86_64-linux-android-4.9
After that, I exported CC, AR and RANLIB in ~/.bashrc
export ANDROID_NDK=/home/r0ng/utilities/ndk
SYSROOT=$ANDROID_NDK/sysroot
export CC="$ANDROID_NDK/bin/arm-linux-androideabi-gcc-4.9.x --sysroot=$SYSROOT"
export AR="$ANDROID_NDK/bin/arm-linux-androideabi-gcc-ar --sysroot=$SYSROOT"
export RANLIB="$ANDROID_NDK/bin/arm-linux-androideabi-gcc-ranlib --sysroot=$SYSROOT"
But when I tried to compile by using cmake ... I had the following errors:
-- The C compiler identification is GNU 4.9.0
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /home/r0ng/utilities/ndk/bin/arm-linux-androideabi-gcc
-- Check for working C compiler: /home/r0ng/utilities/ndk/bin/arm-linux-androideabi-gcc -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/home/r0ng/utilities/ndk/bin/arm-linux-androideabi-gcc" is
not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/r0ng/projects/relic/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_8d7ca/fast"
/usr/bin/make -f CMakeFiles/cmTC_8d7ca.dir/build.make
CMakeFiles/cmTC_8d7ca.dir/build
make[1]: Entering directory
'/home/r0ng/projects/relic/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_8d7ca.dir/testCCompiler.c.o
/home/r0ng/utilities/ndk/bin/arm-linux-androideabi-gcc
--sysroot=/home/r0ng/utilities/ndk -o
CMakeFiles/cmTC_8d7ca.dir/testCCompiler.c.o -c
/home/r0ng/projects/relic/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_8d7ca
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8d7ca.dir/link.txt
--verbose=1
/home/r0ng/utilities/ndk/bin/arm-linux-androideabi-gcc
--sysroot=/home/r0ng/utilities/ndk
CMakeFiles/cmTC_8d7ca.dir/testCCompiler.c.o -o cmTC_8d7ca -rdynamic
/home/r0ng/utilities/ndk/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld:
error: cannot open crtbegin_dynamic.o: No such file or directory
/home/r0ng/utilities/ndk/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld:
error: cannot open crtend_android.o: No such file or directory
/home/r0ng/utilities/ndk/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld:
error: cannot find -lc
/home/r0ng/utilities/ndk/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld:
error: cannot find -ldl
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_8d7ca.dir/build.make:97: recipe for target 'cmTC_8d7ca'
failed
make[1]: *** [cmTC_8d7ca] Error 1
make[1]: Leaving directory
'/home/r0ng/projects/relic/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_8d7ca/fast' failed
make: *** [cmTC_8d7ca/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:6 (project)
-- Configuring incomplete, errors occurred!
See also "/home/r0ng/projects/relic/build/CMakeFiles/CMakeOutput.log".
See also "/home/r0ng/projects/relic/build/CMakeFiles/CMakeError.log".
It seems that the compiler is unable to find "crtbegin_dynamic.o", "crtend_android.o", "libc" neither "libdl". But when I checked, those files are all in the folder $HOME/utilities/ndk/sysroot/usr/lib. And I already set the --sysroot in CC, AR and RANLIB.
Update 1 :
After changed the toolchain generation command based on Dan Albert's comment, The command cmake .. is able to be run successfully. But when I run make . I got following error:
arm-linux-androideabi-gcc-4.9.x: error: unrecognized command line option '-m64'
src/CMakeFiles/relic.dir/build.make:62: recipe for target 'src/CMakeFiles/relic.dir/relic_err.c.o' failed
make[2]: *** [src/CMakeFiles/relic.dir/relic_err.c.o] Error 1
CMakeFiles/Makefile2:120: recipe for target 'src/CMakeFiles/relic.dir/all' failed
make[1]: *** [src/CMakeFiles/relic.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Thanks,
Environment:
OS: Ubuntu 16.04 LTS
gcc / g++: 4.9.3
AOSP: 5.1.1_r30
NDK: android-ndk-r12b
cmake: 3.5.1
If you want to use cmake, you don't need a standalone toolchain. Android Studio natively supports cmake now: http://tools.android.com/tech-docs/external-c-builds
NDK r13 (not released yet) will also ship a cmake toolchain file for using cmake directly (the method shown in https://stackoverflow.com/a/5099229/632035).
You shouldn't add --sysroot= explicitly. Standalone toolchain already knows about proper one.

Linking static lib (potracelib) with another lib, what to write in Makefile.am?

I need to link libpotrace and compile it into libgerbv. What should I write in Makefile.am? I tried various things like LDADD, LIBDIR, LDFLAGS etc., but I was not successful.
How my structure look like:
gerbv/gerbv-test -> files from git, master brach
gerbv/libs/potrace/potrace-test -> potrace -> files from sourceforge.com, latest release
I use Debian Jessie, I can compile both programs separately, both I did not figured out, how can I link potrace to gerbv and compile it. The header file (.h) is included properly, but I haven't had any success with linking .so or .a/la lib. Even no success with installed potrace in /usr/local/lib or /usr/lib.
Can anyone direct me? The best will be if you can download both programs, compile it without error and then write what you put into the gerbv/src/makefile.Am.
UPDATED
I dowloaded clean releases and did this ONLY this modifies:
/root/NBP/gerbv/gerbv-test/src/Makefile.am
added
libgerbv_la_LIBADD = libpotrace.la # src/Makefile.am:84: error: use 'libgerbv_la_LIBADD', not 'libgerbv_la_LDADD'
libgerbv_la_LIBDIR = /root/NBP/gerbv/libs/potrace/potrace-old/src/.libs
#libgerbv_la_DEPENDENCIES = libpotrace.la
/root/NBP/gerbv/gerbv-test/src/exportimage.c
added at the top
#include "../../libs/potrace/potrace-test/src/potracelib.h"
added into void exportimage_render_to_surface_and_destroy(...), this will test, if the shared lib is properly linked. exportimage.c is part of libgerbv where I need to include libpotrace.
char *v = potrace_version();
After doing this modifications I build it via:
libpotrace
root:~/NBP/gerbv/libs/potrace/potrace-test# autoreconf && ./configure --with-libpotrace && make
runs without a problem...
gerbv/libgerbv
root:~/NBP/gerbv/gerbv-test# autoreconf && ./configure && make
This results with:
...
make[3]: Entering directory '/root/NBP/gerbv/gerbv-test/src'
make[3]: *** No rule to make target 'libpotrace.la', needed by 'libgerbv.la'. Stop.
make[3]: Leaving directory '/root/NBP/gerbv/gerbv-test/src'
Makefile:498: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/root/NBP/gerbv/gerbv-test/src'
Makefile:472: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/NBP/gerbv/gerbv-test'
Makefile:401: recipe for target 'all' failed
make: *** [all] Error 2
Solved with this Makefile.am addition:
libgerbv_la_LIBADD = ../../libs/potrace/potrace/src/libpotrace.la
libgerbv_la_DEPENDENCIES = ../../libs/potrace/potrace/src/libpotrace.la

Resources