I have installed GTK, following the instructions here: http://www.gtk.org/download/win32_tutorial.php
Now I am trying to build a GTK hello world program from here: https://developer.gnome.org/gtk-tutorial/stable/c39.html#SEC-HELLOWORLD
I hit this error:
In file included from C:/gtk/include/gtk-3.0/gdk/gdkcairo.h:28:0,
from C:/gtk/include/gtk-3.0/gdk/gdk.h:33,
from C:/gtk/include/gtk-3.0/gtk/gtk.h:30,
from gtk_hello_world.c:1:
C:/gtk/include/gtk-3.0/gdk/gdkpixbuf.h:34:35: fatal error: gdk-pixbuf/gdk-pixbuf
.h: No such file or directory
#include <gdk-pixbuf/gdk-pixbuf.h>
^
This seems to be the same problem as How to repair "error: gdk-pixbuf/gdk-pixdata.h: No such file or directory?" but I do not understand the answer to that question.
Here is the command line to the compiler
C:\Users\James\code\smartone>gcc -o hello.exe gtk_hello_world.c -m32 -mms-bitfie
lds -IC:/gtk/include/gtk-3.0 -IC:/gtk/include/cairo -IC:/gtk/include/pango-1.0 -
IC:/tk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pixman-1 -IC:/gtk
/inlude -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/include/libpng15 -I
C:/gtk/include/libpng15 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include
-LC:/gtk/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshel32 -lole32 -Wl,-luuid -lpango
cairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lpangowin32-1.0 -lgdi32 -lpang
o-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lgdkpixbuf-2.0 -lgio-2.0 -lgobject-
2.0 -lglib-2.0
This was mostly generated using
pkg-config --cflags --libs gtk+-3.0
-mms-bitfields -IC:/gtk/include/gtk-3.0 -IC:/gtk/include/cairo -IC:/gtk/include/
pango-1.0 -IC:/gtk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pixma
n-1 -IC:/gtk/include -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/includ
e/libpng15 -IC:/gtk/include/gdk-pixbuf-2.0 -IC:/gtk/include/libpng15 -IC:/gtk/in
clude/glib-2.0 -IC:/gtk/lib/glib-2.0/include -LC:/gtk/lib -lgtk-3 -lgdk-3 -lgdi3
2 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetyp
e -lfontconfig -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobjec
t -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
I know this question is extremely old, but I ran into this error while compiling xscreensaver from source on Debian Stretch and found that the missing package was libglade2-dev, despite all intuition that might suggest it is libgdk-pixbuf2.0-dev
Hope this might help the next guy looking for an answer to this one.
We need the exact gcc command line that caused the error. If the file is not found, it's because pkg-config couldn't pass to gcc the right location of your gdk-pixbuf installation.
First run pkg-config --list-all | grep gdk-pixbuf to get the exact name of the gdk-pixbuf module on you machine (for me it's gdk-pixbuf-2.0). The use that name, to check what directory pkg-config thinks gdk-pixbuf is installed:
pkg-config --cflags gdk-pixbuf-2.0
returns for me:
-pthread -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng15 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
The -I tells here to gcc to include directory /usr/include/gdk-pixbuf-2.0. And this is where your file are not.
Related
I'm linking an app against lflutter_linux_glfw. nm tools shows it has glad_glTexImage2D:
nm libflutter_linux_glfw.so | grep glTexImage2D
00000000034e87a0 b glad_glTexImage2D
00000000034e87a8 b glad_glTexImage2DMultisample
So I included lflutter_linux_glfw.so before flutter_video_renderer.o, and I get this:
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
Candidate multilib: .;#m64
Selected multilib: .;#m64
"/usr/bin/ld" -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /home/dev/orwell/orwell_flutter/linux/../build/linux/debug/flutter_desktop_example
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../x86_64-linux-gnu/crt1.o /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/crtbegin.o
-L/home/dev/orwell/orwell_flutter/linux/../build/linux/debug/lib -L/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu
-L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../.. -L/usr/lib/llvm-6.0/bin/../lib -L/lib -L/usr/lib -lflutter_linux_glfw
/home/dev/orwell/orwell_flutter/linux/../build/linux/obj/main.o /home/dev/orwell/orwell_flutter/linux/../build/linux/obj/flutter/generated_plugin_registrant.o
/home/dev/orwell/orwell_flutter/linux/../build/linux/obj//home/dev/orwell/orwell_flutter/linux/flutter/ephemeral/cpp_client_wrapper_glfw/flutter_window_controller.o
/home/dev/orwell/orwell_flutter/linux/../build/linux/obj//home/dev/orwell/orwell_flutter/linux/flutter/ephemeral/cpp_client_wrapper_glfw/plugin_registrar.o
/home/dev/orwell/orwell_flutter/linux/../build/linux/obj//home/dev/orwell/orwell_flutter/linux/flutter/ephemeral/cpp_client_wrapper_glfw/engine_method_result.o
/home/dev/orwell/orwell_flutter/linux/../build/linux/obj//home/dev/orwell/orwell_flutter/linux/flutter/ephemeral/cpp_client_wrapper_glfw/standard_codec.o
/home/dev/orwell/orwell_flutter/linux/../build/linux/obj//home/dev/orwell/orwell_flutter/common/src/flutter_video_renderer.o
/home/dev/orwell/orwell_flutter/linux/../build/linux/obj//home/dev/orwell/orwell_flutter/common/src/flutter_texture_video_renderer.o
/home/dev/orwell/orwell_flutter/linux/../build/linux/obj//home/dev/orwell/orwell_flutter/common/src/flutter_orwell_plugin.o "-rpath=\$ORIGIN/lib" -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/crtend.o /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../x86_64-linux-gnu/crtn.o
/home/dev/orwell/orwell_flutter/linux/../build/linux/obj//home/dev/orwell/orwell_flutter/common/src/flutter_texture_video_renderer.o: In function
`flutter_orwell_plugin::FlutterTextureVideoRenderer::renderToTexture(unsigned long, unsigned long, unsigned int)':
flutter_texture_video_renderer.cc:(.text+0x1b6): undefined reference to `glad_glTexImage2D'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/home/dev/orwell/orwell_flutter/linux/../build/linux/debug/flutter_desktop_example] Error 1
In other words, it complains there's no reference to glad_glTexImage2D even though it it indeed in
flutter_linux_glfw.so. I also tried adding flutter_linux_glfw.so after the flutter_texture_video_renderer.o but I get the same error
nm libflutter_linux_glfw.so | grep glTexImage2D
00000000034e87a0 b glad_glTexImage2D
00000000034e87a8 b glad_glTexImage2DMultisample
These symbols are local to the library (not exported from it).
You can see the list of exported symbols with:
nm -D libflutter_linux_glfw.so
You will observe that glad_glTexImage2D is not listed there.
P.S.
I included lflutter_linux_glfw.so before flutter_video_renderer.o
This is the opposite order of what you are supposed to do: libraries should follow the objects that refer to them (though this doesn't really matter for shared libraries).
Tried to run Inline::C on windows 7 (using active perl 5.14), got some errors. Not sure where to install the library "bufferoverflowU". Is it really needed?
perl te.pl
Set up gcc environment - 4.8.2
C:\Perl64\bin\perl.exe C:\Perl64\lib\ExtUtils\xsubpp -typemap "C:\Perl64\lib\ExtUtils\typemap" te1_pl_1114.xs > te1_pl_1114.xsc && C:\Perl64\bin\perl.exe -MExtUtils::Command -e "mv" -- te1_pl_1114.xsc te1_pl_1114.c
c:/WINBUI~1/bin/gcc.exe -c -I"C:/winbuild64/test" -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" "-IC:\Perl64\lib\CORE" te1_pl_1114.c
Running Mkbootstrap for te1_pl_1114 ()
C:\Perl64\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 te1_pl_1114.bs
C:\Perl64\bin\perl.exe -MExtUtils::Mksymlists \
-e "Mksymlists('NAME'=>\"te1_pl_1114\", 'DLBASE' => 'te1_pl_1114', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);"
Set up gcc environment - 4.8.2
dlltool --def te1_pl_1114.def --output-exp dll.exp
c:\WINBUI~1\bin\g++.exe -o blib\arch\auto\te1_pl_1114\te1_pl_1114.dll -Wl,--base-file -Wl,dll.base -mdll -L"C:\Perl64\lib\CORE" te1_pl_1114.o C:\Perl64\lib\CORE\perl514.lib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -lbufferoverflowU -lmsvcrt dll.exp
c:/winbui~1/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lbufferoverflowU
collect2.exe: error: ld returned 1 exit status
dmake.exe: Error code 129, while making 'blib\arch\auto\te1_pl_1114\te1_pl_1114.dll'
A problem was encountered while attempting to compile and install your Inline
C code. The command that failed was:
C:\Perl64\site\bin\dmake.exe > out.make 2>&1
The build directory was:
C:\winbuild64\test\_Inline\build\te1_pl_1114
To debug the problem, cd to the build directory, and inspect the output files.
at te1.pl line 6
...propagated at C:/Perl64/site/lib/Inline/C.pm line 798.
BEGIN failed--compilation aborted at te1.pl line 6.
The perl file is very simple
use Inline C => <<'END_C';
void greet() {
printf("Hello, world\n");
}
END_C
greet;
bufferoverflowU is not a Perl library. It's part of the Windows SDK, though is not included in recent versions. At a guess, you're using ActivePerl, and installed Inline::C using their PPM. Their copy of Inline::C will have been built against whatever version of the Windows SDK they have on their build machines. But you seem to have a newer SDK on your machine.
You could try downloading the latest Inline::C tarball and building it on your own machine. This will hopefully replace your old copy of Inline::C, and hopefully work.
I have an installation of minGW which works well for building straightfowrd C++ programs.
Now I am installing GTK, following the instructions here: http://www.gtk.org/download/win32_tutorial.php
I have grabbed a GTK hellow world program from here: https://developer.gnome.org/gtk-tutorial/stable/c39.html#SEC-HELLOWORLD
but when I try to build it, using this command
C:\Users\James\code\smartone>gcc -o hello.exe gtk_hello_world.c -mms-bitfields
IC:/gtk/include/gtk-3.0 -IC:/gtk/include/cairo -IC:/gtk/include/pango-1.0 -IC:/
tk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pixman-1 -IC:/gtk/in
lude -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/include/libpng15 -IC:
gtk/include/gdk-pixbuf-2.0 -IC:/gtk/include/libpng15 -IC:/gtk/include/glib-2.0
IC:/gtk/lib/glib-2.0/include -LC:/gtk/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshe
l32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig
lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lgdk
pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
I get these errors
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: skipping incompatible C:/gtk/lib/libgtk-3.dll.a when searching
for -lgtk-3
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: skipping incompatible C:/gtk/lib/libgtk-3.dll.a when searching
for -lgtk-3
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: cannot find -lgtk-3
... etc, etc, etc
What have I missed?
You are using a 64 bits compiler. Build with your 64 bits compiler in 32 bits mode with gcc's -m32 option.
i tried installing the perl module XML::LibXSLT but it fails. googled for it for hours now but nothing help so i am posting this. Maybe someone can help!
Thanks in advance!
cpan XML::LibXSLT
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
Database was generated on Mon, 28 Oct 2013 11:08:37 GMT
Running install for module 'XML::LibXSLT'
CPAN: YAML loaded ok (v0.84)
Running make for S/SH/SHLOMIF/XML-LibXSLT-1.81.tar.gz
CPAN: Digest::SHA loaded ok (v5.47)
CPAN: Compress::Zlib loaded ok (v2.062)
Checksum for /root/.cpan/sources/authors/id/S/SH/SHLOMIF/XML-LibXSLT-1.81.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.58)
XML-LibXSLT-1.81/
XML-LibXSLT-1.81/perl-libxml-mm.h
XML-LibXSLT-1.81/benchmark/
XML-LibXSLT-1.81/benchmark/Driver/
XML-LibXSLT-1.81/benchmark/Driver/Sablotron.pm
XML-LibXSLT-1.81/benchmark/Driver/LibXSLT.pm
XML-LibXSLT-1.81/benchmark/Driver/BaseClass.pm
XML-LibXSLT-1.81/benchmark/benchmark.pl
XML-LibXSLT-1.81/Changes
XML-LibXSLT-1.81/LibXSLT.pm
XML-LibXSLT-1.81/MANIFEST
XML-LibXSLT-1.81/testcases/
XML-LibXSLT-1.81/testcases/default.conf
XML-LibXSLT-1.81/example/
XML-LibXSLT-1.81/example/fatal.xsl
XML-LibXSLT-1.81/example/2.xml
XML-LibXSLT-1.81/example/bad3.xsl
XML-LibXSLT-1.81/example/nonfatal.xsl
XML-LibXSLT-1.81/example/1.xml
XML-LibXSLT-1.81/example/bad2.xsl
XML-LibXSLT-1.81/example/1.xsl
XML-LibXSLT-1.81/example/2.xsl
XML-LibXSLT-1.81/example/bad1.xsl
XML-LibXSLT-1.81/Makefile.PL
XML-LibXSLT-1.81/META.yml
XML-LibXSLT-1.81/META.json
XML-LibXSLT-1.81/README
XML-LibXSLT-1.81/t/
XML-LibXSLT-1.81/t/04params.t
XML-LibXSLT-1.81/t/rt71345_a.t
XML-LibXSLT-1.81/t/09exslt.t
XML-LibXSLT-1.81/t/06output.t
XML-LibXSLT-1.81/t/03input.t
XML-LibXSLT-1.81/t/08literal.t
XML-LibXSLT-1.81/t/02dromeds.t
XML-LibXSLT-1.81/t/06entities.t
XML-LibXSLT-1.81/t/11utf8.t
XML-LibXSLT-1.81/t/10functions.t
XML-LibXSLT-1.81/t/05quick.t
XML-LibXSLT-1.81/t/07blankdoc.t
XML-LibXSLT-1.81/t/13error.t
XML-LibXSLT-1.81/t/01basic.t
XML-LibXSLT-1.81/t/14security.t
XML-LibXSLT-1.81/t/12import.t
XML-LibXSLT-1.81/t/15misc.t
XML-LibXSLT-1.81/t/rt71345_b.t
XML-LibXSLT-1.81/typemap
XML-LibXSLT-1.81/LibXSLT.xs
XML-LibXSLT-1.81/ppport.h
XML-LibXSLT-1.81/perl-libxml-mm.c
CPAN: File::Temp loaded ok (v0.22)
CPAN.pm: Going to build S/SH/SHLOMIF/XML-LibXSLT-1.81.tar.gz
running xslt-config... failed
using fallback values for LIBS and INC
options:
LIBS='-L/usr/local/lib -L/usr/lib -lxslt -lxml2 -lz -lm'
INC='-I/usr/local/include -I/usr/include'
If this is wrong, Re-run as:
$ /usr/bin/perl Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include'
looking for -lxslt... yes
looking for -lexslt... yes
running pkg-config libexslt... ok
Checking if your kit is complete...
Looks good
Generating a GNU-style Makefile
Writing Makefile for XML::LibXSLT
Writing MYMETA.yml and MYMETA.json
cp LibXSLT.pm blib/lib/XML/LibXSLT.pm
/usr/bin/perl /usr/share/perl5/ExtUtils/xsubpp -typemap /usr/share/perl5/ExtUtils/typemap -typemap typemap LibXSLT.xs > LibXSLT.xsc && mv LibXSLT.xsc LibXSLT.c
gcc -c -I/usr/local/include -I/usr/include -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I/usr/lib64/perl5/CORE" -DHAVE_BLANK -DHAVE_BLANK -DHAVE_EXSLT LibXSLT.c
LibXSLT.xs: In function ‘LibXSLT__function’:
LibXSLT.xs:252: warning: pointer targets in passing argument 1 of ‘xmlNewDoc’ differ in signedness
/usr/include/libxml2/libxml/tree.h:735: note: expected ‘const xmlChar *’ but argument is of type ‘char *’
LibXSLT.xs: In function ‘LibXSLT_context_element’:
LibXSLT.xs:518: warning: unused variable ‘ent’
LibXSLT.xs: In function ‘LibXSLT_init_functions’:
LibXSLT.xs:916: warning: suggest parentheses around assignment used as truth value
LibXSLT.xs: In function ‘LibXSLT_init_elements’:
LibXSLT.xs:948: warning: suggest parentheses around assignment used as truth value
gcc -c -I/usr/local/include -I/usr/include -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I/usr/lib64/perl5/CORE" -DHAVE_BLANK -DHAVE_BLANK -DHAVE_EXSLT perl-libxml-mm.c
rm -f blib/arch/auto/XML/LibXSLT/LibXSLT.so
LD_RUN_PATH="/usr/lib64:/lib64" gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic LibXSLT.o perl-libxml-mm.o -o blib/arch/auto/XML/LibXSLT/LibXSLT.so \
-L/usr/local/lib -L/usr/lib -lxslt -lxml2 -lz -lm -lexslt -lgcrypt -ldl -lgpg-error -lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc \
/usr/bin/ld: cannot find -lgdbm
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/XML/LibXSLT/LibXSLT.so] Error 1
SHLOMIF/XML-LibXSLT-1.81.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
'
Any help is highly appreciated!
The error is /usr/bin/ld: cannot find -lgdbm. do you find gdbm library on your system?
run:
# updatedb
# locate gdbm
The output of locate command should list libgdbm.so. If it is not then try installing the same using your Distro's package manager:
Here is output on my ubuntu:
# locate gdbm
/usr/lib/libgdbm.so.3
/usr/lib/libgdbm.so.3.0.0
/usr/lib/libgdbm_compat.so.3
/usr/lib/libgdbm_compat.so.3.0.0
and here is the output from my RHEL 6.4:
# locate gdbm
/usr/lib64/libgdbm.so.2
/usr/lib64/libgdbm.so.2.0.0
To install gdbm, run these commands:
on ubuntu: apt-get install libgdbm3
On centos/RHEL: yum install gdbm
hope this helps.
/usr/bin/ld: cannot find -lgdbm
Looks like you don't have the gdbm library installed. I can't see which Linux (or, perhaps, Unix) distribution you're using, but gdbm is almost certainly per-packaged for it, so you just need to work out what the package is called and use apt or yum (or whatever is appropriate) to install it.
I'm attempting to cross compile the perl interpreter for an ARM architecture (FriendlyARM Micro2440). I'm using the ARM-Linux GCC 4.4.3 cross-compiler provided by the manufacturer. The board is running Linux 2.6.
I was able to cross-compile a basic "Hello World" application successfully, and it ran on the target machine.
I've downloaded the perl v5.12.3 source. I was able to do a normal compilation of perl for Ubuntu. I'm now attempting to do a cross-compilation for the ARM board. I'm working out of the perl-5.12.3/Cross folder in the source download.
make patch succeeded, but when I run make perl it fails with this
LD_LIBRARY_PATH=/home/reed022/.local/share/Trash/files/perl-5.2.12.3 arm-linux-gcc -o miniperl \
gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o \
miniperlmain.o opmini.o perlmini.o -lnsl -ldl -lm -lcrypt -lutil -lc
LD_LIBRARY_PATH=/home/reed022/.local/share/Trash/files/perl-5.2.12.3 ./miniperl -w -Ilib -MExporter -e '<?>' || make minitest
./miniperl: 1: Syntax error: word unexpected (expecting ")")
I think the relevant part of the output is the ./miniperl -w -Ilib -MExporter -e '<?>' || make minitest part. Though I'm not sure. It seems confusing to me that the cross-compilation environment would try to run tests, since it's targeting a different system than the one it's being built on.
I'm completely lost as where to go from here. The people I've talked to haven't had much experience with cross-compiling programs.
UPDATE
I decided to delete the perl source folder and re-extract it, thinking that the previous compilation of perl for the Ubuntu host machine might have been messing with the current cross-compilation. I'm now getting a different but similar error.
`sh cflags "optimize='-O2'" generate_uudmap.o` -fexpensive-optimizations -fomit-frame-pointer -O2 -march=armv4 -mtune=strongarm1100 generate_uudmap.c
CCCMD = arm-linux-gcc -DPERL_CORE -c -fexpensive-optimizations -fomit-frame-pointer -O2 -march=armv4 -mtune=strongarm1100 -O2 -Wall
arm-linux-gcc -o generate_uudmap generate_uudmap.o -lnsl -ldl -lm -lcrypt -lutil -lc
./generate_uudmap uudmap.h bitcount.h
./generate_uudmap: 1: Syntax error: word unexpected (expecting ")")
make[1]: *** [bitcount.h] Error 2
make[1]: Leaving directory `/home/reed022/Downloads/perl-5.12.3'
make[1]: Entering directory `/home/reed022/Downloads/perl-5.12.3'
make[1]: *** No rule to make target `more'. Stop.
make[1]: Leaving directory `/home/reed022/Downloads/perl-5.12.3'
make: *** [perl] Error 2
Apparently the way to cross compile perl is not to do it under the Cross directory. I needed to pass flags to Configure to set it up. I also needed to setup the ARM computer with an SSH server (I used dropbear). The flags I used are
sh ./Configure
-Dusecrosscompile
-Dtargethost=<IP of ARM computer>
-Dtargetuser=<user name>
-Dtargetarch=arm-linux
-Dcc=arm-linux-gcc
-Dusrinc=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/include/
-Dincpth=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/include/
-Dlibpth=/opt/FriendlyARM/toolschain/4.4.3/lib
-Dtargetdir=/sdcard/perl
The easiest way to cross-compile perl for arm is to use perl-cross.
Alex Suykov developed a set of patches for perl that works around the requirement to have a target machine available. Part of the solution is avoiding make test since the host can't run cross-compiled code anyway.
I used arm-unknown-linux-uclibcgnueabi as my target (to match my buildroot toolchain), but otherwise the directions for perl 5.18.0 worked just fine.
Alex last updated the github repository on April 23, 2014, so this project is still relatively active.