Lazarus Кросскомпиляция Win->Linux

Вопросы программирования и использования среды Lazarus.

Модератор: Модераторы

Lazarus Кросскомпиляция Win->Linux

Сообщение DrSoft » 17.11.2011 11:04:59

Доброго времени суток.
Пытаюсь откомпилировать пустую форму созданную на хостовой платформе Win под целевую Linux в Lazarus-е, и к сожалению ничего пока не выходит. Простой пример типа hello world компилица без проблем, но когда пытаюсь откомпилить что-то графическое (пустую форму) ничего не получается.
Lazarus я устанавливал пользуясь CodeTyphon (стоит Lazarus for Win32 и Cross element for x86-64-Linux, FPC for Win32 и Cross element for x86-64-Linux).
FPC версия 2.7.1
Lazarus 0.9.31
Вот что пишет лазарус в момент компиляции:
Note: DWARF debug information cannot be used with smart linking on this target, switching to static linking
D:\pp\lib\\libgtk-x11-2.0.a(gtkmain.o):(.bss+0x0): multiple definition of `gtk_debug_flags'
C:\codetyphon\fpc\units\x86_64-linux\gtk2\gtk2.o:(.bss+0x0): first defined here
D:\pp\lib\\libgtk-x11-2.0.a(gtkfilesel.o): In function `attempt_homedir_completion':
(.text+0x435): warning: Using 'getpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
D:\pp\lib\\libgtk-x11-2.0.a(gtkfilesel.o): In function `open_user_dir':
(.text+0x29bc): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
D:\pp\lib\\libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
(.text+0x1164): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
D:\pp\lib\\libgtk-x11-2.0.a(gtkfilesel.o): In function `attempt_homedir_completion':
(.text+0x3b2): warning: Using 'setpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
D:\pp\lib\\libgtk-x11-2.0.a(gtkfilesel.o): In function `attempt_homedir_completion':
(.text+0x54f): warning: Using 'endpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
D:\pp\lib\\libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
(.text+0xe79): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
D:\pp\lib\\libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
(.text+0xeb8): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
D:\pp\lib\\libX11.a(xim_trans.o): In function `_XimXTransSocketUNIXConnect':
(.text+0x94d): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
C:\codetyphon\fpc\units\x86_64-linux\rtl\dynlibs.o: In function `DYNLIBS_LOADLIBRARY$ANSISTRING$$INT64':
dynlibs.pas:(.text+0x1e): undefined reference to `dlopen'
C:\codetyphon\fpc\units\x86_64-linux\rtl\dynlibs.o: In function `DYNLIBS_GETPROCEDUREADDRESS$INT64$ANSISTRING$$POINTER':
dynlibs.pas:(.text+0x41): undefined reference to `dlsym'
C:\codetyphon\fpc\units\x86_64-linux\rtl\dynlibs.o: In function `DYNLIBS_UNLOADLIBRARY$INT64$$BOOLEAN':
dynlibs.pas:(.text+0x55): undefined reference to `dlclose'
C:\codetyphon\fpc\units\x86_64-linux\rtl\dl.o: In function `DL_UNIXGETMODULEBYADDR$POINTER$POINTER$OPENSTRING':
dl.pp:(.text+0xe8): undefined reference to `dladdr'
D:\pp\lib\\libX11.a(xcb_io.o): In function `require_socket':
(.text+0x361): undefined reference to `xcb_take_socket'
D:\pp\lib\\libX11.a(xcb_io.o): In function `wait_or_poll_for_event':
(.text+0x434): undefined reference to `xcb_wait_for_event'
D:\pp\lib\\libX11.a(xcb_io.o): In function `process_responses':
(.text+0x5ac): undefined reference to `xcb_poll_for_reply'
D:\pp\lib\\libX11.a(xcb_io.o): In function `process_responses':
(.text+0x6c0): undefined reference to `xcb_connection_has_error'
D:\pp\lib\\libX11.a(xcb_io.o): In function `_XAllocIDs':
(.text+0x887): undefined reference to `xcb_generate_id'
D:\pp\lib\\libX11.a(xcb_io.o): In function `_XIDHandler':
(.text+0x914): undefined reference to `xcb_generate_id'
D:\pp\lib\\libX11.a(xcb_io.o): In function `_XSend':
(.text+0xb53): undefined reference to `xcb_writev'
D:\pp\lib\\libX11.a(xcb_io.o): In function `_XReply':
(.text+0xd40): undefined reference to `xcb_wait_for_reply'
D:\pp\lib\\libX11.a(xcb_io.o): In function `wait_or_poll_for_event':
(.text+0x4bb): undefined reference to `xcb_poll_for_event'
D:\pp\lib\\libX11.a(ClDisplay.o): In function `XCloseDisplay':
(.text+0xd5): undefined reference to `xcb_disconnect'
D:\pp\lib\\libX11.a(OpenDis.o): In function `OutOfMemory':
(.text+0x4a4): undefined reference to `xcb_disconnect'
D:\pp\lib\\libX11.a(OpenDis.o): In function `XOpenDisplay':
(.text+0x8d5): undefined reference to `xcb_get_setup'
D:\pp\lib\\libX11.a(OpenDis.o): In function `XOpenDisplay':
(.text+0xec1): undefined reference to `xcb_get_maximum_request_length'
D:\pp\lib\\libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0xb2): undefined reference to `xcb_parse_display'
......................
D:\pp\lib\\libcairo.a(cairo-xlib-screen.o): In function `_cairo_xlib_screen_info_get':
(.text+0x7e0): undefined reference to `pthread_mutex_unlock'
D:\pp\lib\\libcairo.a(cairo-xlib-screen.o): In function `_cairo_xlib_screen_info_get':
(.text+0x81e): undefined reference to `XRenderQuerySubpixelOrder'
D:\pp\lib\\libcairo.a(cairo-xlib-screen.o): In function `_cairo_xlib_screen_info_get':
(.text+0x857): undefined reference to `XRenderFindVisualFormat'
D:\pp\lib\\libcairo.a(cairo-xlib-screen.o): In function `_cairo_xlib_screen_info_get':
(.text+0x877): undefined reference to `pthread_mutex_unlock'
D:\pp\lib\\libcairo.a(cairo-xlib-screen.o): In function `_cairo_xlib_screen_info_close_display':
(.text+0x91b): undefined reference to `pthread_mutex_lock'
D:\pp\lib\\libcairo.a(cairo-xlib-screen.o): In function `_cairo_xlib_screen_info_destroy':
(.text+0x9e1): undefined reference to `pthread_mutex_lock'
D:\pp\lib\\libcairo.a(cairo-xlib-screen.o): In function `_cairo_xlib_screen_info_destroy':
(.text+0xa17): undefined reference to `pthread_mutex_unlock'
D:\pp\lib\\libcairo.a(cairo-xlib-screen.o): In function `_cairo_xlib_screen_info_destroy':
(.text+0xa3d): undefined reference to `pthread_mutex_destroy'
D:\pp\lib\\libcairo.a(cairo-xlib-screen.o): In function `_cairo_xlib_screen_info_close_display':
(.text+0x9a3): undefined reference to `pthread_mutex_unlock'
D:\pp\lib\\libcairo.a(cairo-xlib-visual.o): In function `_cairo_xlib_visual_info_create':
(.text+0x114): undefined reference to `XAllocColor'
D:\pp\lib\\libcairo.a(cairo-xlib-visual.o): In function `_cairo_xlib_visual_info_create':
(.text+0x159): undefined reference to `XQueryColors'
D:\pp\lib\\libcairo.a(cairo-xlib-visual.o): In function `_cairo_xlib_visual_info_create':
(.text+0x41e): undefined reference to `XAllocColor'
D:\pp\lib\\libc.a(elf-init.o): In function `__libc_csu_init':
(.text+0x9a): undefined reference to `_init'
D:\pp\lib\\libc.a(elf-init.o): In function `__libc_csu_irel':
(.text+0xd4): undefined reference to `__rela_iplt_end'
D:\pp\lib\\libc.a(elf-init.o): In function `__libc_csu_irel':
(.text+0xe5): undefined reference to `__rela_iplt_start'
D:\pp\lib\\libc.a(elf-init.o): In function `__libc_csu_irel':
(.text+0x100): undefined reference to `__rela_iplt_start'
D:\pp\lib\\libc.a(elf-init.o): In function `__libc_csu_irel':
(.text+0x10a): undefined reference to `__rela_iplt_start'
D:\pp\lib\\libc.a(elf-init.o): In function `__libc_csu_irel':
(.text+0x10f): undefined reference to `__rela_iplt_start'
D:\pp\lib\\libc.a(elf-init.o): In function `__libc_csu_irel':
(.text+0x114): undefined reference to `__rela_iplt_start'
D:\pp\lib\\libc.a(elf-init.o): In function `__libc_csu_fini':
(.text+0x3c): undefined reference to `_fini'
D:\pp\lib\\libc.a(isoc99_fscanf.o): In function `__isoc99_fscanf':
(.text+0x171): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(isoc99_fscanf.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(iofclose.o): In function `fclose':
(.text+0x202): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(iofclose.o):(.eh_frame+0x21b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(iofflush.o): In function `fflush':
(.text+0xf3): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(iofflush.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(iofgets.o): In function `fgets':
(.text+0x186): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(iofgets.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(iofputs.o): In function `fputs':
(.text+0x157): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(iofputs.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(iofread.o): In function `fread':
(.text+0x149): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(iofread.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(iofwrite.o): In function `fwrite':
(.text+0x186): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(iofwrite.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(iogetdelim.o): In function `getdelim':
(.text+0x298): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(iogetdelim.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(ioputs.o): In function `puts':
(.text+0x195): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(ioputs.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(iosetvbuf.o): In function `setvbuf':
(.text+0x1a3): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(iosetvbuf.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(ioungetc.o):(.eh_frame+0xe2): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(fputc.o): In function `fputc':
(.text+0xf9): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(fputc.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(freopen.o): In function `freopen':
(.text+0x25a): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(freopen.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(fseek.o): In function `fseek':
(.text+0xea): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(fseek.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(getc.o): In function `fgetc':
(.text+0xec): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(getc.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(putc.o): In function `putc':
(.text+0xf9): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(putc.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(rewind.o): In function `rewind':
(.text+0xe0): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(rewind.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(wfileops.o): In function `_IO_wfile_underflow':
(.text+0xc48): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(wfileops.o):(.eh_frame+0x14a): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(wfileops.o):(.eh_frame+0x1c3): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(fileops.o): In function `_IO_file_underflow':
(.text+0xfcb): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(fileops.o): In function `_IO_file_fopen':
(.text+0x1e85): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(fileops.o):(.eh_frame+0x14a): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(fileops.o):(.eh_frame+0x39f): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(syslog.o): In function `closelog':
(.text+0xe6): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(syslog.o): In function `openlog':
(.text+0x3c2): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(syslog.o): In function `__vsyslog_chk':
(.text+0x96e): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(syslog.o): In function `__vsyslog_chk':
(.text+0x981): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(syslog.o):(.eh_frame+0x21a): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(syslog.o):(.eh_frame+0x25f): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(vfprintf_chk.o): In function `__vfprintf_chk':
(.text+0x116): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(vfprintf_chk.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(backtrace.o): In function `backtrace':
(.text+0x24): undefined reference to `_Unwind_Backtrace'
D:\pp\lib\\libc.a(backtrace.o): In function `backtrace_helper':
(.text+0x9f): undefined reference to `_Unwind_GetIP'
D:\pp\lib\\libc.a(ioftell.o): In function `ftell':
(.text+0x134): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(ioftell.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(ioseekoff.o): In function `_IO_seekoff':
(.text+0x1d0): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(ioseekoff.o):(.eh_frame+0x14a): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(ioseekoff.o):(.eh_frame+0x183): undefined reference to `__gcc_personality_v0'
D:\pp\lib\\libc.a(ftello.o): In function `ftello64':
(.text+0x134): undefined reference to `_Unwind_Resume'
D:\pp\lib\\libc.a(ftello.o):(.eh_frame+0x14b): undefined reference to `__gcc_personality_v0'
project1.lpr(20,1) Error: Error while linking
project1.lpr(20,1) Fatal: There were 1 errors compiling module, stopping


Хотелось бы понять что его не устраивает на этот раз и возможна ли вообще такая кросскомпиляция из Win->Linux? Буду очень признателен за помощь.
DrSoft
незнакомец
 
Сообщения: 3
Зарегистрирован: 17.11.2011 10:21:53

Re: Lazarus Кросскомпиляция Win->Linux

Сообщение Сквозняк » 17.11.2011 19:15:42

Код: Выделить всё
D:\pp\lib\\libc.a(ftello.o): In function `ftello64':
(.text+0x134): undefined reference to `_Unwind_Resume'

undefined reference
Какое знакомое сообщение, почти родное. В использованной для компиляции библиотеке не находится или нужная функция или переменная или они не такие как надо. При сборке линуксовых библиотек применяется система зависимостей, главной киллерфичей которой является выкидывание при компиляции из программы "ненужных" функций и переменных для облегчения проги и просто чтобы она хоть как-то собиралась. В результате правильно собрать библиотеки gdb для использования в сборке fp почти нереально, постоянно вылезают эти самые undefined reference. Если ты на них нарвался, то отключай в своей программе всё что их вызывает, оконный интерфейс, например :), или ищи другие библиотеки, в которых есть все нужные тебе функции. Также может быть не та версия библиотек, попробуй более древний лазарус или более новую libc.a Чтобы с этим поменьше париться применяется компиляция в виртуальной машине. Ставишь туда линукс, лазарус и компилируешь.
Сквозняк
энтузиаст
 
Сообщения: 1129
Зарегистрирован: 29.06.2006 22:08:32


Вернуться в Lazarus

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 255

Рейтинг@Mail.ru