Archive for the 'English' Category

Is it possible to build a completely static app using Qt 4 on Linux

After successfully statically compile Qt 4.6.3 under Unbuntu 10.04 Server, I tried to build static version fancybrowser, after some study, I got a static execute, but when ran it, it suspended before load url, I do not know why, after some search I got the following answer,

> Is it possible to build a completely static app using Qt 4 on Linux?

Completely static? No.

Almost completely static? Yes. The GNU Libc library’s NSS subsystem still
requires dynamic loading of some modules in order to fullfil your requests,
especially when it comes to DNS resolution. If you don’t use QTcpSocket or
QHostInfo, you probably will get a fully static binary though.

Make sure you have static libs for all Qt dependencies. They will be linked
into your executable, which will be several megabytes in size.

Better than that is to have Qt as a static library, but nothing else. That
will link Qt into your program, but will dynamically load the libraries it
needs from the system.

I believe that’s the approach that Skype uses on their static binaries.

> My problem is I’m trying to build an application that will run on a
> variety of recent (2.6.x kernel) distros. My first attempt (using shared
> libraries) results in “Floating point exceptions” when run on Debian. So
> now I’m looking at building statically.

My suggestion is to try the linux-lsb-g++ mkspec if you intend to deploy a Qt
application in several different Linux systems.

But I don’t see how floating point exceptions can have anything to do with the
Qt build. Maybe if you post a code sample and/or a backtrace of the crash, we
can help with that instead.

Be sure that you build your application on the “lowest common denominator”
platform of yours, since libc and libstdc++ are not forwards compatible
(i.e., you have to link to the lowest version you intend to deploy on).

This applies even if you replace the headers of those libraries with older
headers. (There’s a link-time dependency, whereas Qt is only compile-time)

> I was able to add a -static flag to my link flags in my .pro file, and
> I’m linking against static Qt libs, but when it gets to linking in
> libSM, it only finds the dynamic version and stops. I’m sure this is
> also the case for most of the X11 libraries.

Like I said above, you need to have the static library for all dependencies if
you want to have a fully static build.

> Can this be made to work? Or am I stuck building dynamically on a
> multitude of distros?

There’s always LSB.

The recently-announced LSB 3.2 contains Qt 4.2 as part of the required
standard. Any Linux distribution conforming to LSB 3.2 will have that. Most
recent Linux distributions already ship Qt 4.2 or even 4.3 (thanks to the KDE
4 release).

The previous LSB 3.1 standard contained Qt 4.1 but only as an optional module.
It has been out for close to 2 years now, though, so you may have a wider
variety of distribution targets.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • DotNetKicks
  • Fark
  • Fleck
  • Gwar
  • Haohao
  • IndianPad
  • Internetmedia
  • LinkaGoGo
  • MyShare
  • Netscape
  • NewsVine
  • Rec6
  • Reddit
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Webride

The First Month My Google Adsense Revenue Is Over 100 Dollars

Last Month, I got USD115.90 from Google Adsense, It’s a great news for me, because it is the first month my Google Adsense revenue is over USD100.

BTW, I bought the domain rubypdf.com on Sept 17th, 2006(I just notice it is a very special day, because my son was born on Sept 17th, 2007) from Dreamhost, I used WordPress to build my blog, then applied Google Adsense. after 8 months I got my first and the last check(because Google used Western Union Quick Cash from my second payment), USD113.4, I have forgotten if I have taken a shot of that check or not.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • DotNetKicks
  • Fark
  • Fleck
  • Gwar
  • Haohao
  • IndianPad
  • Internetmedia
  • LinkaGoGo
  • MyShare
  • Netscape
  • NewsVine
  • Rec6
  • Reddit
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Webride

How to Install XSP and Integrate XSP With Apache 2 Under CentOS 5

In the last article, I have introduced How to Install Mono 2.4.2.3 on CentOS 5 , forgot telling you, why I want to install Mono on CentOS, I want to try to run ASP.NET under Linux.

Mono has an implementation of ASP.NET 2.0 and ASP.NET AJAX, and to run your ASP.NET applications with Mono, you have three classes of options:

  • Apache hosting: use mod_mono, a module that allows Apache to serve ASP.NET applications.
  • FastCGI hosting: use the FastCGI hosting if you have a web server that supports the FastCGI protocol for extending the server. You also may use a web server that only has support for CGI using cgi-fcgi.
  • XSP: this is a simple way to get started, a lightweight and simple webserver written in C#.

XSP is a standalone web server written in C# that can be used to run your ASP.NET applications with minimal effort.
The mod_mono Apache module is used to run ASP.NET applications within the Apache (http://httpd.apache.org) web server.

Let’s continue install XSP and mod_mono now.
1.Go to this page and download xsp-2.4.2.tar.bz2,
#wget http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.4.2.tar.bz2

2. Extract the download file,
# tar jxvf xsp-2.4.2.tar.bz2

3. In to the xsp-2.4.2 folder,
#cd xsp-2.4.2

4.configure, build and install XSP,
# ./configure –prefix=/opt/mono; make; make install
because I installed mono in /opt/mono, so the same treat to XSP

5.go to the parent folder,
#cd ..

6.by default, Apache 2 has been installed, make sure you have installed httpd-devel, or you will get error message like”**** apxs was not found,” when you build mod_mono,
#yum -y install httpd-devel

7.Go to this page and download mod_mono-2.4.2.tar.bz2

8. Extract the download file,
# tar jxvf mod_mono-2.4.2.tar.bz2

9. In to the mod_mono-2.4.2 folder,
#cd mod_mono-2.4.2

10.configure, build and install mod_mono,
# ./configure –prefix=/opt/mono; make; make install

11.You may want to verify a few thigns to make sure the configuration is ready to rock. In my case, I am keeping the mono configuration in a separate file for sanity sake. You can do that or put it all in your httpd.conf, it’s up to you,

<IfModule !mod_mono.c>
LoadModule mono_module /usr/lib/httpd/modules/mod_mono.so
AddType application/x-asp-net .aspx
AddType application/x-asp-net .asmx
AddType application/x-asp-net .ashx
AddType application/x-asp-net .asax
AddType application/x-asp-net .ascx
AddType application/x-asp-net .soap
AddType application/x-asp-net .rem
AddType application/x-asp-net .axd
AddType application/x-asp-net .cs
AddType application/x-asp-net .config
AddType application/x-asp-net .Config
AddType application/x-asp-net .dll
DirectoryIndex index.aspx
DirectoryIndex Default.aspx
DirectoryIndex default.aspx
</IfModule>

<VirtualHost *:80>
DocumentRoot /home/httpd/aspx/html
ServerName aspx.yoursite.com
Alias /demo /opt/mono/lib/xsp/test
MonoApplications "/demo:/opt/mono/lib/xsp/test"
MonoServerPath /opt/mono/bin/mod-mono-server2
<Directory /opt/mono/lib/xps/test>
SetHandler mono
</Directory>
</VirtualHost>

12.restart httpd service,
#service httpd restart

13.Test it,
visit http://aspx.yoursite.com/demo in your browser, and if you get the page with the title “Welcome to Mono XSP!”, congratulation!

references,
ASP.NET and Mono
My Adventures Installing mono 2.0 on CentOS 4 to work with Apache via mod_mono

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • DotNetKicks
  • Fark
  • Fleck
  • Gwar
  • Haohao
  • IndianPad
  • Internetmedia
  • LinkaGoGo
  • MyShare
  • Netscape
  • NewsVine
  • Rec6
  • Reddit
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Webride