Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-j.b-one.net (mx-j.one.com [91.198.169.57])
	by mail9.b-one.net (Postfix) with ESMTP id D72D5400B7B
	for <info@awaresystems.be>; Sun,  2 May 2010 04:30:08 +0200 (CEST)
Received: by mx-j.b-one.net (Postfix, from userid 106)
	id CDA71A851; Sun,  2 May 2010 04:30:08 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Spam-Score: 0.001
X-Spam-Level: 
X-Spam-Status: No, score=0.001 tagged_above=0 required=4
 tests=[HTML_MESSAGE=0.001]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-j.b-one.net (Postfix) with ESMTP id E62B4A851 for <info@awaresystems.be>;
 Sun,  2 May 2010 04:30:07 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id BD00A1D18F593; Sat,  1 May 2010
 21:27:40 -0500 (EST)
Received: from mail-ww0-f44.google.com (mail-ww0-f44.google.com
 [74.125.82.44]) by lists.maptools.org (Postfix) with ESMTP id 867261D18F470
 for <tiff@lists.maptools.org>; Sat,  1 May 2010 20:54:19 -0500 (EST)
Received: by wwb24 with SMTP id 24so991529wwb.3 for
 <tiff@lists.maptools.org>; Sat, 01 May 2010 18:54:19 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.174.21 with SMTP id w21mr5399489wel.60.1272765258992;
 Sat,  01 May 2010 18:54:18 -0700 (PDT)
Received: by 10.216.3.17 with HTTP; Sat, 1 May 2010 18:54:18 -0700 (PDT)
Date: Sat, 1 May 2010 21:54:18 -0400
Message-ID: <q2yc2fdd35e1005011854m3f7b7774x31927fa9e8caf20@mail.gmail.com>
From: Dave Sun <hotdog.sun@gmail.com>
To: tiff@lists.maptools.org
Subject: [Tiff] qmake (Qt) and libtiff "undefined symbols" problem on mac
 (snow leopard).
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0765187744=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

--===============0765187744==
Content-Type: multipart/alternative; boundary=001485f1e31a250c49048592c196

--001485f1e31a250c49048592c196
Content-Type: text/plain; charset=ISO-8859-1

Dear folks,

I have problems using qmake to compile my simplest libtiff program. Here are
the information about my system.

*computer:*  Darwin Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST
2009; root:xnu-1486.2.11~1/RELEASE_I386 i386
*Qt version*: Qt 4.6.2
*libtiff version*: 3.9.2
*operating system*: snow leopard.
Simplest program:

*#include <QtCore/QCoreApplication>*
*#include "tiff.h"*
*#include "tiffio.h"*
*#include <iostream>*
*
*
*int main(int argc, char *argv[])*
*{*
*    //QCoreApplication a(argc, argv);*
*    TIFF* tif = TIFFOpen("foo.tif", "r");*
*    if(tif == NULL)*
*       std::cout << "could not open the file";*
*    TIFFClose(tif);*
*    //return a.exec();*
* **std::cout << "hello";*
*    return 0;*
*}*

my pro file:

QT       -= gui
TARGET = libtiffSimpleTest
CONFIG   += console
CONFIG   -= app_bundle
TEMPLATE = app
LIBS += -ltiff
SOURCES += main.cpp

I used Qt creator as my IDE. When I run compiling program I got the
following error:

ld: warning: in /usr/local/lib/libtiff.dylib, file is not of required
architecture

Undefined symbols:

"_TIFFOpen", referenced from:

_main in main.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

make: *** [libtiffSimpleTest] Error 1


However, when I just use the following:

*g++ main.cpp -ltiff*


It works well. What is the problem here?



Thank you.

Dave

--001485f1e31a250c49048592c196
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Dear folks,=A0<div><br></div><div>I have problems using qmake to compile my=
 simplest libtiff program. Here are the information about my system.=A0</di=
v><div><div><br></div><div><b>computer:</b> =A0Darwin Darwin Kernel Version=
 10.2.0: Tue Nov =A03 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 =
i386</div>
<div><b>Qt version</b>: Qt 4.6.2</div><div><b>libtiff version</b>: 3.9.2</d=
iv><div><b>operating system</b>: snow leopard.=A0</div><div>Simplest progra=
m:=A0</div><div><br></div><div><div><i>#include &lt;QtCore/QCoreApplication=
&gt;</i></div>
<div><i>#include &quot;tiff.h&quot;</i></div><div><i>#include &quot;tiffio.=
h&quot;</i></div><div><i>#include &lt;iostream&gt;</i></div><div><i><br></i=
></div><div><i>int main(int argc, char *argv[])</i></div><div><i>{</i></div=
>
<div><i>=A0=A0 =A0//QCoreApplication a(argc, argv);</i></div><div><i>=A0=A0=
 =A0TIFF* tif =3D TIFFOpen(&quot;foo.tif&quot;, &quot;r&quot;);</i></div><d=
iv><i>=A0=A0 =A0if(tif =3D=3D NULL)</i></div><div><i>=A0=A0 =A0 =A0 std::co=
ut &lt;&lt; &quot;could not open the file&quot;;</i></div>
<div><i>=A0=A0 =A0TIFFClose(tif);</i></div><div><i>=A0=A0 =A0//return a.exe=
c();</i></div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"=
><i>	</i></span><i>std::cout &lt;&lt; &quot;hello&quot;;</i></div><div><i>=
=A0=A0 =A0return 0;</i></div>
<div><i>}</i></div><div><br></div><div>my pro file:=A0</div><div><br></div>=
<div><div>QT =A0 =A0 =A0 -=3D gui</div><div>TARGET =3D libtiffSimpleTest</d=
iv><div>CONFIG =A0 +=3D console</div><div>CONFIG =A0 -=3D app_bundle</div><=
div>TEMPLATE =3D app</div>
<div>LIBS +=3D -ltiff</div><div>SOURCES +=3D main.cpp</div></div><div><br><=
/div><div>I used Qt creator as my IDE. When I run compiling program I got t=
he following error:=A0</div><div><br></div><div>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig=
ht:0px; -qt-block-indent:0; text-indent:0px;"><span style=3D" color:#ff0000=
;">ld: warning: in /usr/local/lib/libtiff.dylib, file is not of required ar=
chitecture</span></p>

<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig=
ht:0px; -qt-block-indent:0; text-indent:0px;"><span style=3D" color:#ff0000=
;">Undefined symbols:</span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig=
ht:0px; -qt-block-indent:0; text-indent:0px;"><span style=3D" color:#ff0000=
;">&quot;_TIFFOpen&quot;, referenced from:</span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig=
ht:0px; -qt-block-indent:0; text-indent:0px;"><span style=3D" color:#ff0000=
;">_main in main.o</span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig=
ht:0px; -qt-block-indent:0; text-indent:0px;"><span style=3D" color:#ff0000=
;">ld: symbol(s) not found</span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig=
ht:0px; -qt-block-indent:0; text-indent:0px;"><span style=3D" color:#ff0000=
;">collect2: ld returned 1 exit status</span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig=
ht:0px; -qt-block-indent:0; text-indent:0px;"><span style=3D" color:#ff0000=
;">make: *** [libtiffSimpleTest] Error 1</span></p><p style=3D" margin-top:=
0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent=
:0; text-indent:0px;">
<font class=3D"Apple-style-span" color=3D"#FF0000"><br></font></p><p style=
=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; =
-qt-block-indent:0; text-indent:0px;">However, when I just use the followin=
g:</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig=
ht:0px; -qt-block-indent:0; text-indent:0px;"><i>g++ main.cpp -ltiff</i></p=
><p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-ri=
ght:0px; -qt-block-indent:0; text-indent:0px;">
<br></p><p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; ma=
rgin-right:0px; -qt-block-indent:0; text-indent:0px;">It works well. What i=
s the problem here?<font class=3D"Apple-style-span" color=3D"#FF0000">=A0</=
font></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig=
ht:0px; -qt-block-indent:0; text-indent:0px;"><font class=3D"Apple-style-sp=
an" color=3D"#FF0000"><br></font></p><p style=3D" margin-top:0px; margin-bo=
ttom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-inden=
t:0px;">
<font class=3D"Apple-style-span" color=3D"#FF0000"><br></font></p><p style=
=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; =
-qt-block-indent:0; text-indent:0px;">Thank you.</p><p style=3D" margin-top=
:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-inden=
t:0; text-indent:0px;">
Dave</p></div></div></div>

--001485f1e31a250c49048592c196--

--===============0765187744==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
--===============0765187744==--
