当前位置:首页>Linux>delphi跨平台Linux,MacOS 回忆录

delphi跨平台Linux,MacOS 回忆录

  • 2026-10-11 08:33:12
delphi跨平台Linux,MacOS 回忆录
这是一篇使用delphi做跨PC平台(其实包括 Linux 和 MacOS)的实践记录
一、开发Linux 

注意,如果是虚拟机,要先安装 VMware Tools 

最新 Debian 安装 VMware Tools 时 出现错误 root 账号,也要加上 sudo ./程序,如上图

打开 delphi 安装目录\Studio\20.0\PAServer 下的LinuxPAServer20.0.tar.gz 文件 放Linu下 ,解压 如下图

./XXXXX

运行

选择linux,编译     另开一终端,查看IP地址,用:ip a 查看

输入IP、端口、密码

端口在linux解压出的paserver.config 里有配置

编译

如果出现以下错误

[DCC Error] E2597 C:\A\d10.3.2\Studio\20.0\bin\ld-linux.exe: error: cannot find -lgcc_s  C:\A\d10.3.2\Studio\20.0\bin\ld-linux.exe: error: cannot find -lc  C:\A\d10.3.2\Studio\20.0\bin\ld-linux.exe: error: cannot find -ldl  C:\A\d10.3.2\Studio\20.0\bin\ld-linux.exe: error: cannot find -lpthread  C:\A\d10.3.2\Studio\20.0\bin\ld-linux.exe: error: cannot find -lm  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::__malloc(NativeUInt): error: undefined reference to 'malloc'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::__free(void*): error: undefined reference to 'free'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::pthread_once(int&, void (*)()): error: undefined reference to 'pthread_once'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::pthread_key_create(unsigned int&, void (*)(void*)): error: undefined reference to 'pthread_key_create'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::dladdr(NativeUInt, dl_info&): error: undefined reference to 'dladdr'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::dlopen(char*, int): error: undefined reference to 'dlopen'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::dlclose(NativeUInt): error: undefined reference to 'dlclose'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::dlsym(NativeUInt, char*): error: undefined reference to 'dlsym'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::TlsGetValue(unsigned int): error: undefined reference to 'pthread_getspecific'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::TlsSetValue(unsigned int, void*): error: undefined reference to 'pthread_setspecific'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\SysInit.o:SysInit:function Sysinit::__dbk_fcall_wrapper(): error: undefined reference to '_Unwind_Resume'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::TObject::TObject(): error: undefined reference to '_Unwind_Resume'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::TObject::ClassNameIs(System::UnicodeString): error: undefined reference to '_Unwind_Resume'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::TObject::QualifiedClassName(): error: undefined reference to '_Unwind_Resume'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::getenv(char*): error: undefined reference to 'getenv'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::__malloc(NativeUInt): error: undefined reference to 'malloc'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::calloc(NativeUInt, NativeUInt): error: undefined reference to 'calloc'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::realloc(void*, NativeUInt): error: undefined reference to 'realloc'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::__free(void*): error: undefined reference to 'free'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::__exit(int): error: undefined reference to 'exit'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::memmove(void*, void const*, NativeUInt): error: undefined reference to 'memmove'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::memset(void*, int, NativeUInt): error: undefined reference to 'memset'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::strlen(char*): error: undefined reference to 'strlen'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::__raise(int): error: undefined reference to 'raise'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::pthread_self(): error: undefined reference to 'pthread_self'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::sched_yield(): error: undefined reference to 'sched_yield'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::dladdr(NativeUInt, dl_info&): error: undefined reference to 'dladdr'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::dlopen(char*, int): error: undefined reference to 'dlopen'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::dlclose(NativeUInt): error: undefined reference to 'dlclose'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::dlsym(NativeUInt, char*): error: undefined reference to 'dlsym'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::dlerror(): error: undefined reference to 'dlerror'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::open(char*, int): error: undefined reference to 'open'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::__chdir(char*): error: undefined reference to 'chdir'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::__close(int): error: undefined reference to 'close'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::fchdir(int): error: undefined reference to 'fchdir'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::ftruncate(int, long): error: undefined reference to 'ftruncate'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::getcwd(char*, NativeUInt): error: undefined reference to 'getcwd'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::lseek(int, long, int): error: undefined reference to 'lseek'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::__read(int, void*, NativeUInt): error: undefined reference to 'read'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::readlink(char*, char*, NativeUInt): error: undefined reference to 'readlink'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::sysconf(int): error: undefined reference to 'sysconf'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::usleep(unsigned int): error: undefined reference to 'usleep'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::__write(int, void*, NativeUInt): error: undefined reference to 'write'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::iconv(void*, char**, NativeUInt*, char**, NativeUInt*): error: undefined reference to 'iconv'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::iconv_open(char*, char*): error: undefined reference to 'iconv_open'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::iconv_close(void*): error: undefined reference to 'iconv_close'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::stat(char*, _stat&): error: undefined reference to 'stat'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::mmap(void*, NativeUInt, int, int, int, long): error: undefined reference to 'mmap'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::munmap(void*, NativeUInt): error: undefined reference to 'munmap'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::__error(): error: undefined reference to '__errno_location'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::wcscoll_l(int const*, int const*, void*): error: undefined reference to 'wcscoll_l'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::towupper_l(unsigned int, void*): error: undefined reference to 'towupper_l'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::setlocale(int, char const*): error: undefined reference to 'setlocale'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::newlocale(int, char const*, void*): error: undefined reference to 'newlocale'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::times(tms&): error: undefined reference to 'times'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::fegetexceptflag(unsigned short*, unsigned int): error: undefined reference to 'fegetexceptflag'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::fesetexceptflag(unsigned short*, unsigned int): error: undefined reference to 'fesetexceptflag'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::fegetround(): error: undefined reference to 'fegetround'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::fesetround(unsigned int): error: undefined reference to 'fesetround'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::fedisableexcept(unsigned int): error: undefined reference to 'fedisableexcept'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::libm_cosl(long double): error: undefined reference to 'cosl'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::libm_sinl(long double): error: undefined reference to 'sinl'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::libm_atanl(long double): error: undefined reference to 'atanl'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::libm_sqrtl(long double): error: undefined reference to 'sqrtl'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::llrintl(long double): error: undefined reference to 'llrintl'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::_Unwind_RaiseException(_Unwind_Exception&): error: undefined reference to '_Unwind_RaiseException'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::_Unwind_GetRegionStart(_Unwind_Context*): error: undefined reference to '_Unwind_GetRegionStart'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::_Unwind_GetLanguageSpecificData(_Unwind_Context*): error: undefined reference to '_Unwind_GetLanguageSpecificData'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::_Unwind_SetGR(_Unwind_Context*, int, NativeUInt): error: undefined reference to '_Unwind_SetGR'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::_Unwind_GetIP(_Unwind_Context*): error: undefined reference to '_Unwind_GetIP'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::_Unwind_SetIP(_Unwind_Context*, NativeUInt): error: undefined reference to '_Unwind_SetIP'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::_Halt0(): error: undefined reference to 'memcpy'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::ExitDll(System::TInitContext*): error: undefined reference to 'memcpy'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.o:System:function System::ExitDll(System::TInitContext*): error: undefined reference to 'memcpy'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Dlfcn.o:Posix.Dlfcn:function Posix::Dlfcn::dladdr(NativeUInt, dl_info&): error: undefined reference to 'dladdr'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Dlfcn.o:Posix.Dlfcn:function Posix::Dlfcn::dlopen(char*, int): error: undefined reference to 'dlopen'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Dlfcn.o:Posix.Dlfcn:function Posix::Dlfcn::dlclose(NativeUInt): error: undefined reference to 'dlclose'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Dlfcn.o:Posix.Dlfcn:function Posix::Dlfcn::dlsym(NativeUInt, char*): error: undefined reference to 'dlsym'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Fcntl.o:Posix.Fcntl:function Posix::Fcntl::__open(char*, int): error: undefined reference to 'open'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Fcntl.o:Posix.Fcntl:function Posix::Fcntl::fcntl(int, int): error: undefined reference to 'fcntl'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.SysStat.o:Posix.SysStat:function Posix::Sysstat::fstat(int, _stat&): error: undefined reference to 'fstat'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.SysStat.o:Posix.SysStat:function Posix::Sysstat::lstat(char*, _stat&): error: undefined reference to 'lstat'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.SysStat.o:Posix.SysStat:function Posix::Sysstat::stat(char*, _stat&): error: undefined reference to 'stat'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Signal.o:Posix.Signal:function Posix::Signal::sigaction(int, sigaction_t*, sigaction_t*): error: undefined reference to 'sigaction'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Signal.o:Posix.Signal:function Posix::Signal::sigaddset(sigset_t&, int): error: undefined reference to 'sigaddset'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Signal.o:Posix.Signal:function Posix::Signal::kill(int, int): error: undefined reference to 'kill'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Time.o:Posix.Time:function Posix::Time::clock_gettime(int, timespec*): error: undefined reference to 'clock_gettime'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Time.o:Posix.Time:function Posix::Time::localtime_r(long&, tm&): error: undefined reference to 'localtime_r'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.SysTime.o:Posix.SysTime:function Posix::Systime::gettimeofday(timeval&, void*): error: undefined reference to 'gettimeofday'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Locale.o:Posix.Locale:function Posix::Locale::localeconv(): error: undefined reference to 'localeconv'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Locale.o:Posix.Locale:function Posix::Locale::newlocale(int, char const*, void*): error: undefined reference to 'newlocale'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Locale.o:Posix.Locale:function Posix::Locale::freelocale(void*): error: undefined reference to 'freelocale'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Locale.o:Posix.Locale:function Posix::Locale::duplocale(void*): error: undefined reference to 'duplocale'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Locale.o:Posix.Locale:function Posix::Locale::uselocale(void*): error: undefined reference to 'uselocale'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Iconv.o:Posix.Iconv:function Posix::Iconv::iconv_open(char*, char*): error: undefined reference to 'iconv_open'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Iconv.o:Posix.Iconv:function Posix::Iconv::iconv_close(void*): error: undefined reference to 'iconv_close'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Dirent.o:Posix.Dirent:function Posix::Dirent::closedir(__dirstream*): error: undefined reference to 'closedir'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Dirent.o:Posix.Dirent:function Posix::Dirent::opendir(char*): error: undefined reference to 'opendir'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Dirent.o:Posix.Dirent:function Posix::Dirent::readdir_r(__dirstream*, dirent*, dirent*&): error: undefined reference to 'readdir_r'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Errno.o:Posix.Errno:function Posix::Errno::__error(): error: undefined reference to '__errno_location'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Fnmatch.o:Posix.Fnmatch:function Posix::Fnmatch::fnmatch(char*, char*, int): error: undefined reference to 'fnmatch'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Langinfo.o:Posix.Langinfo:function Posix::Langinfo::nl_langinfo(int): error: undefined reference to 'nl_langinfo'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Langinfo.o:Posix.Langinfo:function Posix::Langinfo::nl_langinfo_l(int, void*): error: undefined reference to 'nl_langinfo_l'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Pthread.o:Posix.Pthread:function Posix::Pthread::GetCurrentThreadID(): error: undefined reference to 'pthread_self'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Stdlib.o:Posix.Stdlib:function Posix::Stdlib::getenv(char*): error: undefined reference to 'getenv'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.String_.o:Posix.String_:function Posix::String_::memcmp(void const*, void const*, NativeUInt): error: undefined reference to 'memcmp'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.String_.o:Posix.String_:function Posix::String_::strcmp(char*, char*): error: undefined reference to 'strcmp'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.String_.o:Posix.String_:function Posix::String_::strerror_r(int, char*, NativeUInt): error: undefined reference to 'strerror_r'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Unistd.o:Posix.Unistd:function Posix::Unistd::euidaccess(char*, int): error: undefined reference to 'access'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Unistd.o:Posix.Unistd:function Posix::Unistd::__close(int): error: undefined reference to 'close'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Unistd.o:Posix.Unistd:function Posix::Unistd::getpid(): error: undefined reference to 'getpid'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Unistd.o:Posix.Unistd:function Posix::Unistd::__read(int, void*, NativeUInt): error: undefined reference to 'read'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Unistd.o:Posix.Unistd:function Posix::Unistd::__write(int, void*, NativeUInt): error: undefined reference to 'write'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Semaphore.o:Posix.Semaphore:function Posix::Semaphore::sem_destroy(sem_t&): error: undefined reference to 'sem_destroy'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Semaphore.o:Posix.Semaphore:function Posix::Semaphore::sem_getvalue(sem_t&, int&): error: undefined reference to 'sem_getvalue'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Semaphore.o:Posix.Semaphore:function Posix::Semaphore::sem_init(sem_t&, int, unsigned int): error: undefined reference to 'sem_init'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Semaphore.o:Posix.Semaphore:function Posix::Semaphore::sem_post(sem_t&): error: undefined reference to 'sem_post'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Semaphore.o:Posix.Semaphore:function Posix::Semaphore::sem_trywait(sem_t&): error: undefined reference to 'sem_trywait'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Semaphore.o:Posix.Semaphore:function Posix::Semaphore::sem_wait(sem_t&): error: undefined reference to 'sem_wait'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Semaphore.o:Posix.Semaphore:function Posix::Semaphore::sem_timedwait(sem_t&, timespec&): error: undefined reference to 'sem_timedwait'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.SysUtsname.o:Posix.SysUtsname:function Posix::Sysutsname::uname(utsname&): error: undefined reference to 'uname'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Wchar.o:Posix.Wchar:function Posix::Wchar::wcscoll_l(int const*, int const*, void*): error: undefined reference to 'wcscoll_l'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Wchar.o:Posix.Wchar:function Posix::Wchar::wcscasecmp_l(int const*, int const*, void*): error: undefined reference to 'wcscasecmp_l'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Wctype.o:Posix.Wctype:function Posix::Wctype::towupper(unsigned int): error: undefined reference to 'towupper'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Wctype.o:Posix.Wctype:function Posix::Wctype::towlower_l(unsigned int, void*): error: undefined reference to 'towlower_l'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\Posix.Wctype.o:Posix.Wctype:function Posix::Wctype::towupper_l(unsigned int, void*): error: undefined reference to 'towupper_l'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.Internal.ExcUtils.o:System.Internal.ExcUtils:function System::Internal::Excutils::TlsGetValue(int): error: undefined reference to 'pthread_getspecific'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.SysUtils.o:System.SysUtils:function System::Sysutils::TFormatSettings::Create(System::UnicodeString): error: undefined reference to 'memset'  c:\a\d10.3.2\studio\20.0\lib\Linux64\release\System.SysUtils.o:System.SysUtils:function System::Sysutils::TFormatSettings::Create(System::UnicodeString): error: undefined reference to 'memset'

在linux系统上安装 gcc

转到Root用户:su root 

运行: sudo apt install gcc

运行:sudo apt-get install joe wget p7zip-full curl build-essential zlib1g-dev libcurl4-gnutls-dev

然后编译

如果有以下错误

>/home/zjp/my/PAServer-20.0/linuxgdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

运行:sudo apt-get install joe wget p7zip-full curl build-essential zlib1g-dev libcurl4-gnutls-dev libncurses5

F9 运行,

如果没有报错,则安环境搭建成功

查看Linux下的程序目录

它是根据配置文件paserver.config 设置的

图形化控件的使用:

解压:FmxLinux 1.41 Src

添加插件和路径:

HKEY_CURRENT_USER\Software\Embarcadero\BDS\20.0\Experts

添加新建->字符串值

FmxLinuxXXXXX\Bin\20.0\FmuxLib.dll

然后添加Linux的编译,注意是在工程顶层右键

添加路径到delphi

在工程上(注意是工程),会多一个编译平台

直接F9编译,会发现Linux系统下,已经运行

Delphi 

编译出的程序在当前程下

把此程序,直接复制到放到linux下,也可以运行。

当IP变化时,重复操作一次

如果编译没有错,F9运行

此处开发Linux就全部搭建完成 

以下是搭建过程可能遇到的错误记录

Error: E0003 TDBXError: Remote error: Authentication manager rejected user credentials. This may due to invalid combination of DS user name and password

转到root 权限用户 ,在启动paserver 程序如果出现以下错误[DCC Error] E2597 C:\Program Files (x86)\Embarcadero\20.0\bin\ld-linux.exe: error: cannot find -lcurl  C:\Program Files (x86)\Embarcadero\20.0\bin\ld-linux.exe: error: cannot find -lz  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\Linuxapi.Curl.o:Linuxapi.Curl:function Linuxapi::Curl::curl_global_init(int): error: undefined reference to 'curl_global_init'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\Linuxapi.Curl.o:Linuxapi.Curl:function Linuxapi::Curl::curl_global_cleanup(): error: undefined reference to 'curl_global_cleanup'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\Linuxapi.Curl.o:Linuxapi.Curl:function Linuxapi::Curl::curl_slist_append(curl_slist*, char*): error: undefined reference to 'curl_slist_append'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\Linuxapi.Curl.o:Linuxapi.Curl:function Linuxapi::Curl::curl_slist_free_all(curl_slist*): error: undefined reference to 'curl_slist_free_all'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\Linuxapi.Curl.o:Linuxapi.Curl:function Linuxapi::Curl::curl_easy_strerror(CURLcode): error: undefined reference to 'curl_easy_strerror'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\Linuxapi.Curl.o:Linuxapi.Curl:function Linuxapi::Curl::curl_easy_init(): error: undefined reference to 'curl_easy_init'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\Linuxapi.Curl.o:Linuxapi.Curl:function Linuxapi::Curl::curl_easy_setopt(void*, CURLoption): error: undefined reference to 'curl_easy_setopt'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\Linuxapi.Curl.o:Linuxapi.Curl:function Linuxapi::Curl::curl_easy_perform(void*): error: undefined reference to 'curl_easy_perform'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\Linuxapi.Curl.o:Linuxapi.Curl:function Linuxapi::Curl::curl_easy_cleanup(void*): error: undefined reference to 'curl_easy_cleanup'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\Linuxapi.Curl.o:Linuxapi.Curl:function Linuxapi::Curl::curl_easy_getinfo(void*, CURLINFO): error: undefined reference to 'curl_easy_getinfo'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\System.ZLib.o:System.ZLib:function System::Zlib::deflate(System::Zlib::z_stream&, int): error: undefined reference to 'deflate'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\System.ZLib.o:System.ZLib:function System::Zlib::deflateEnd(System::Zlib::z_stream&): error: undefined reference to 'deflateEnd'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\System.ZLib.o:System.ZLib:function System::Zlib::inflate(System::Zlib::z_stream&, int): error: undefined reference to 'inflate'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\System.ZLib.o:System.ZLib:function System::Zlib::inflateEnd(System::Zlib::z_stream&): error: undefined reference to 'inflateEnd'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\System.ZLib.o:System.ZLib:function System::Zlib::inflateReset(System::Zlib::z_stream&): error: undefined reference to 'inflateReset'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\System.ZLib.o:System.ZLib:function System::Zlib::deflateInit2_(System::Zlib::z_stream&, int, int, int, int, int, char*, int): error: undefined reference to 'deflateInit2_'  c:\program files (x86)\embarcadero\20.0\lib\Linux64\release\System.ZLib.o:System.ZLib:function System::Zlib::inflateInit2_(System::Zlib::z_stream&, int, char*, int): error: undefined reference to 'inflateInit2_'执行:sudo apt-get install joe wget p7zip-full curl build-essential zlib1g-dev libcurl4-gnutls-dev或:yum install joe wget p7zip-full curl build-essential zlib1g-dev libcurl4-gnutls-devyum install zlib-develyum install gcc gcc-c++yum install libcurlyum install libcurl-devel 
二、开发Mac平台程序 

本人没有平果机,所以只能搭建虚拟机,因为Delphi fmx 本身支持mac,所以MacOS系统安装步骤比delphi环境搭建还多,如果你有真机,可以跳过虚拟机安装的部分,直接拉到下面看

安装好虚拟机软件,然后去下  unlocker

https://github.com/DrDonk/unlocker

然后开干

注意:如果提示镜像过期、出现问题啥的,说明你的镜像不完整,请更换或者重新制作镜像!

查看是否64位系统

查看ip:ifconfig en0

然后64位,失败

转向32位编译

程序位置

如果要编译64位,要做如下操作

至此,delphi 开发跨Linux , MacOS 平台,已全部搭建完全
三、我用 Lazarus 过后,在也不想用Delphi开发跨PC平台了,Lazarus跨平台https://mp.weixin.qq.com/s/mMA6psROF1LGziOCZzFiOg  真好用。delphi 还是适合win平台开发

最新文章

随机文章