Ⅰ 利用arm-linux-gcc编译时出现collect2: ld returned 1 exit status 错误:具体步骤如下:
我看上面写的是 /armlinux/app/mylib这个路径,下面指定库路径的时候就成了/armlinux/ex/mylib了,是不是路径不对啊,你生成的.so文件是不是在/armlinux/app/mylib这个里面了。
Ⅱ Linux系统源码安装Mysqldb,报错error: command 'gcc' failed with exit status 1,这个是什么原因呢
我看不懂你是怎么运行的命令,我仅仅好意提示一下:
UNIX(不限于linux)下用源码安装软件,一般使用make命令。python 行与不行真不知道。
你的错误原因启动gcc编译器器启动不了。你安装一个gcc,可能解决了。
Ⅲ 用Linux编译C++代码出错了,求帮忙错误为:collect2: error: ld returned 1 exit status
这东西很烦,你是不是 .close()忘记括号了?
Ⅳ Linux使用whiptail形成对话框的方法
在Linux中可以使用命令来形成对话框,Linux命令行形成的对话框就是以代码的形式出现。whiptail就是一个Linux可以形成对话框的命令行
#!/bin/bash
trap “” 2
while true
do
OPTION=$(whiptail --title “Email Manager” --nocancel --menu “Choose your option” 15 60 4 \
“1” “Add Email User” \
“2” “Delete Email User” \
“3” “List Email User” \
“4” “EXIT” 3》&1 1》&2 2》&3)
case $OPTION in
1)
EmailAddress=$(whiptail --title “EmailAddress-form Input Box” --inputbox “What is your add EmailAddress?” 10 60 @shenxu.com 3》&1 1》&2 2》&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
grep $EmailAddress /etc/postfix/virtual_mailbox_maps》/dev/nul
exitstatus=$?
if [ $exitstatus = 0 ]; then
whiptail --msgbox “The Email Address is a existed” 10 40
elif (whiptail --title “Add Yes/No Box” --yesno “Are you sure add $EmailAddress.” 10 60) then
/etc/postfix/mailadd.sh $EmailAddress
whiptail --msgbox “The Email Address $EmailAddress is a added.” 10 40
fi
else
whiptail --msgbox “You chose Cancel.” 10 40
fi
;;
2)
EmailAddress=$(whiptail --title “EmailAddress-form Input Box” --inputbox “What is your Delete EmailAddress?” 10 60 @shenxu.com 3》&1 1》&2 2》&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
grep $EmailAddress /etc/postfix/virtual_mailbox_maps》/dev/nul
exitstatus=$?
if [ $exitstatus != 0 ]; then
whiptail --msgbox “The Email Address $EmailAddress is a not exist.” 10 40
elif (whiptail --title “Add Yes/No Box” --yesno “Are you sure delete $EmailAddress.” 10 60) then
/etc/postfix/maildel.sh $EmailAddress
whiptail --msgbox “The Email Address $EmailAddress is a deleted.” 10 40
fi
else
whiptail --msgbox “You chose Cancel.” 10 40
fi
;;
3)
EmailAddress=$(cat /etc/postfix/virtual_mailbox_maps | awk ‘{print $1}’)
whiptail --msgbox “The Email User list are $EmailAddress.” --scrolltext 20 40
;;
4)
echo “EXIT”
break
;;
esac
done
trap : 2
whiptail --title “Email Manager” --nocancel --menu “Choose your option” 15 60 4 \
“1” “Add Email User” \
“2” “Delete Email User” \
“3” “List Email User” \
“4” “EXIT” 3》&1 1》&2 2》&3
--title “Email Manager” 是标题,双引号里是自己填的提示信息
--nocancel 是在这个图文里面不显示取消,只显示OK
--menu “Choose your option” 15 60 4 是表示菜单提示,双引号里是自己填的提示信息,15是高度,60是长度,4是有个选择项目
下面的1-4是自己的提示
最后比较关键,3》&1 1》&2 2》&3是为了把选择的内容填进变量OPTION
whiptail --title “EmailAddress-form Input Box” --inputbox “What is your add EmailAddress?” 10 60 @shenxu.com 3》&1 1》&2 2》&3
--inputbox “What is your add EmailAddress?” 是可以形成一个让用户输入的提示框
@shenxu.com 是默认输入text里的值
whiptail --msgbox “You chose Cancel.” 10 40 是显示一行你的提示
其实还有--infobox,似乎和msgbox很像,其实不同,它基本上用不上,是在shell运行完后,可以往前翻页能看见的东西
--scrolltext 20 40是为了显示多行的时候可以上下滚动
另外还有--passwordbox和text一样输入,就是以***显示
whiptail --checklist “choose” 15 60 2 “1” “aa” ON “2” “bb” ON
15 60还是高和宽,2是有几个选项,和menu一样,后面多了一个ON或者OFF表示状态,就是菜单出来后默认是不是选,On是选,OFF不选,用空格键来选择。可以多选。
--radiolist,不可以多选了。ON就只能有一个,其它必须是OFF
还有一个显示进度条的--gauge,我觉得没啥用处。
#!/bin/bash
{
for n in `seq 100`
do
sleep 1
echo $n
done
} | whiptail --gauge “Please wait while installing” 6 60 0
以上就是Linux使用whiptail形成对话框的方法,把写好的代码复制到whiptail里面就可以形成对话框了。
Ⅳ linux下安装gsoap在make时报错collect2: error: ld returned 1 exit status
此类问题一般是库的问题,在你安装应用之前请确保你的应用所需要的依赖全部安装在电脑上,否则安装就会提示失败。抱歉的是,你这个软件我没有安装过,不知道缺失的是什么库文件。
Ⅵ linux中oracle服务启动都有哪些方法
手动启动:
用 oracle用户登录(或su - oracle)
lsnrctl start
sqlplus / as sysdba
startup
exit
自动启动,要编写一个启动脚本,用root用户拷到/etc/init.d下,取名叫oracle
然后, chkconfig oracle on,即可加入服务列表
/etc/init.d/oracle start #启动
/etc/init.d/oracle stop #停止
脚本的示例(里面的变量要按实际情况修改):
#!/bin/bash
#
# chkconfig: 345 99 01
# description: This is a program that is responsible for taking care of
# configuring the Oracle Database 11g Stardard/Enterprise Edition and its associated
# services.
#
# Source fuction library
if [ -f /lib/lsb/init-functions ]
then
. /lib/lsb/init-functions
elif [ -f /etc/init.d/functions ]
then
. /etc/init.d/functions
fi
# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/sbin:/etc
export PATH ;;
esac
# Save LD_LIBRARY_PATH
SAVE_LLP=$LD_LIBRARY_PATH
RETVAL=0
ORACLE_OWNER=oracle
ORACLE_OWNER_HOME=/opt/oracle
ORACLE_BASE=$ORACLE_OWNER_HOME/app/oracle
ORACLE_HOME=$ORACLE_BASE/proct/11.2.0/dbhome_1
ORACLE_SID=orcl
ORACLE_UNQNAME=$ORACLE_SID
LSNR=$ORACLE_HOME/bin/lsnrctl
SQLPLUS=$ORACLE_HOME/bin/sqlplus
STARTDB_SQL=$(mktemp /tmp/start.XXXXXX)
echo -e "startup;\nquit;\n" > $STRTDB_SQL
STOPDB_SQL=$(mktemp /tmp/stop.XXXXXX)
echo -e "shutdown immediate;\nquit;\n" > $STOPDB_SQL
SU=/bin/su
export ORACLE_HOME
export ORACLE_SID
export PATH=$ORACLE_HOME/bin:$PATH
LOG="$ORACLE_HOME_LISTNER/listener.log"
export LC_ALL=C
if [ $(id -u) != "0" ]
then
echo "You must be root to run the configure script. Login as root and then run the
configure script."
exit 1
fi
if [ -f /etc/redhat-release ]
then
. /etc/init.d/functions
init_status()
{
return 0
}
exit_status()
{
exit $?
}
success_status()
{
success
echo
}
failure_status()
{
failure $?
echo
}
elif [ -f /etc/SuSE-release ]
then
. /etc/rc.status
init_status()
{
rc_reset
}
success_status()
{
echo "OK"
return 0
}
failure_status()
{
echo "Failed"
return 1
}
exit_status()
{
exit $?
}
else
if [ -d /etc/default ]
then
CONFIGURATION="/etc/default/$CONFIG_NAME"
fi
init_status()
{
return 0
}
success_status()
{
echo "OK"
return 0
}
failure_status()
{
echo "Failed"
return 0
}
exit_status()
{
exit $?
}
fi
init_status
start() {
status=`ps -ef | grep tns | grep oracle`
if [ "$status" == "" ]
then
if [ -f $ORACLE_HOME/bin/tnslsnr ]
then
echo "Starting Oracle Net Listener."
$SU -s /bin/bash $ORACLE_OWNER -c "$LSNR start" # > /dev/null 2>&1
fi
fi
echo "Starting Oracle Database 11g Instance."
$SU -s /bin/bash $ORACLE_OWNER -c "$SQLPLUS -s /nolog @${STARTDB_SQL}" # > /dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]
then
echo
else
echo Failed to start Oracle Net Listener using $ORACLE_HOME/bin/tnslsnr\
and Oracle Database using $ORACLE_HOME/bin/sqlplus.
RETVAL=1
return $RETVAL
fi
}
startconsole() {
$SU -s /bin/bash $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole &" # > /dev/null 2>&1
RETVAL=$?
return $RETVAL
}
stop() {
# Stop Oracle 11g Database and Listener
$SU -s /bin/bash $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole &" # > /dev/null 2>&1
echo Shutting down Oracle Database 11g Instance.
$SU -s /bin/bash $ORACLE_OWNER -c "$SQLPLUS -s /nolog @${STOPDB_SQL}" # > /dev/null 2>&1
echo Stopping Oracle Net Listener.
$SU -s /bin/bash $ORACLE_OWNER -c "$LSNR stop" # > /dev/null 2>&1
RETVAL=$?
echo
if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$LSNR
then
return $RETVAL
fi
}
stopconsole() {
# Stop Oracle 11g Database and Listener
$SU -s /bin/bash $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole &" # > /dev/null 2>&1
RETVAL=$?
return $RETVAL
}
# See how we were called
case "$1" in
start)
start
;;
startconsole)
startconsole
;;
stop)
stop
;;
stopconsole)
stopconsole
;;
restart|reload|force-reload)
stop
start
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
esac
Ⅶ linux切换用户时 /usr/libexec/gconf-sanity-check exited with status 256
删除/tmp中的所有文件(包括隐藏文件),然后将/tmp目录的权限改为777,之后重启即可
# cd /tmp
# ls -A |xargs rm -rf *
# chmod 777 /tmp
Ⅷ Linux、C语言进程之间通信
B.1 正常退出。
man的解析。
WIFEXITED(status)
returns true if the child terminated normally, that is, by call‐
ing exit(3) or _exit(2), or by returning from main().
真就是1,假就是0.
Ⅸ Linux中的WEXITSTATUS是什么函数
WEXITSTATUS(status): 取子进程传送给exit或_exit参数的低8位