Ubuntu编译的程序在Unix webserver上运行

caw*_*caw 1 apache ubuntu gcc glibc ada

我使用GNAT在Ubuntu上编译了一个Ada程序.

之后,我尝试了一些使用该程序的测试,并且它运行正常.

但是,当我将其上传到我的Apache(UNIX)网络服务器并尝试运行该程序时,没有输出.为什么会这样?

可能是在Ubuntu上编译的程序在UNIX服务器上不起作用吗?

(抱歉这个愚蠢的问题!)

我用于编译的系统的Linux版本(uname -a):

Linux ubuntu 3.0.0-12-generic #20-Ubuntu x86-64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

系统的Linux版本我想稍后运行该程序(uname -a):

Linux 2.6.37-he-xeon-64gb+1 i686 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

为了在Ubuntu机器上进行编译,我使用:

gnatmake -O3 myprogram -bargs -static
Run Code Online (Sandbox Code Playgroud)

Sim*_*ght 7

当您构建GNAT程序(gnatmake my_program)时,默认情况下它会链接到动态库(libgnat.so,libgnarl.so).这些库是GNAT系统的一部分,不太可能在您的Web服务器上可用.

如果你说它ldd my_program会显示你使用的共享库.

您可以通过说明强制构建使用静态GNAT库

gnatmake my_program -bargs -static
Run Code Online (Sandbox Code Playgroud)

(-bargs -static必须在常规标志之后-O2).

编辑:更多信息-bargs和朋友.