August 2011 Archives

libtool的一个问题

| No Comments
    libtools生成so的时候,发现在rhel5.3和fedora15下,结果竟然不一样,Makefile.am这样写道:
dydir    = $(bindir)/pwd
dy_PROGRAMS    = libdy.so
libdy_so_SOURCES = dy.cpp dy.h
libdy_so_CXXFLAGS = -fPIC
libdy_so_LDFLAGS = -shared -fpic

在fedora15下,这里面dy.cpp里面必须包括main函数,否则编译不过,而rhel5.3则没有这个问题,查了过程发现fedora15和rhel5.3的编译过程分别如下所示:
fedora15:
/bin/sh ../../../libtool --tag=CXX   --mode=link g++ -fPIC -g -O2 -shared -fpic  -o libdy.so libdy_so-dy.o 
libtool: link: g++ -fPIC -g -O2 -fpic -o libdy.so libdy_so-dy.o
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status

rhel5.3
/bin/sh ../../../libtool --tag=CXX --mode=link g++  -g -O2   -o libdy.so -shared -fpic libdy_so-dy.o 

g++ -g -O2 -o libdy.so -shared -fpic libdy_so-dy.o
应该是libtool在fedora15上丢失了-shared参数所致,fedora15的libtool版本为2.4,而rhel5.3的libtool版本为1.5.22。

郁闷的SSH

| No Comments
    一般使用ssh -X连接到服务器,启动xclock,发现并没有窗口弹出,并提示错误信息:
Error: Can't open display:
    以为是Xserver的问题,比较环境变量DISPLAY以及Xorg的一些配置,也没有找到原因。
    后来想到以前俺博客当中应该有相关的资料,但忽略了ssh的服务器配置,其实解决的问题很简单,当想通过XServer显示服务器上的UI程序时,需要在ssh的时候加上-X参数外,还需要服务器的sshd支持远程的XServer,其/etc/ssh/ssh_config配置如下:
#    $OpenBSD: ssh_config,v 1.23 2007/06/08 04:40:40 pvalchev Exp $

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

# Host *
#   ForwardAgent no
ForwardX11 yes
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
LogLevel error

Archives

Recent Comments

  • rao.chenlin: const-c.inc和const-xs.inc这两个的写法能不能详细说说啊。perlxs的中文资料不好找~~多谢多谢 read more
  • rao.chenlin: 我是openSUSE12.1的i686,QQ群获取的群友昵称(包括自己)是乱码~其他一切OK read more
  • cnangel: 已经证明在fedora、ubuntu的i686以及x86_64平台都可以使用。 read more
  • fdcwqmst: 总算找到一点靠谱的博文了 read more
  • Cnangel: 所以说嘛,无奈~ read more
  • 贝贝: 提示你了他们怎么赚钱阿?就是要让你在不知不觉中就花了好多钱 read more
  • Cnangel: please say chinese read more
  • david: hello , i need you help , but i dont read more
  • Cnangel: 问题出错在: /root/phpdev/php-5.3.3/ext/php5cpp/php5cpp.cpp:65: error: invalid conversion from ‘const zend_function_entry*’ to ‘_zend_function_entry*’ read more
  • craboy1: 我make出现了下边的错误: g++ -I. -I/root/phpdev/php-5.3.3/ext/php5cpp -DPHP_ATOM_INC -I/root/phpdev/php-5.3.3/ext/php5cpp/include -I/root/phpdev/php-5.3.3/ext/php5cpp/main -I/root/phpdev/php-5.3.3/ext/php5cpp -I/usr/include/php5 -I/usr/include/php5/main read more

Pages

Powered by Movable Type 5.2.2

December 2012

Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Creative Commons License
This blog is licensed under a Creative Commons License.

About this Archive

This page is an archive of entries from August 2011 listed from newest to oldest.

July 2011 is the previous archive.

September 2011 is the next archive.

Find recent content on the main index or look in the archives to find all content.