Обсуждение: Compilation problems

Поиск
Список
Период
Сортировка

Compilation problems

От
"Diego"
Дата:
Hi everyone! I'm having problems while compiling pgadmin3 1.0.2. I've
followed step
by step the compilation instructions on the web.

First of all, I compiled and installed Postgresql 7.4 without any problem.
Later I compiled and installed wxWindows 2.5 as stated on the web:

./configure --with-gtk --enable-gtk2 --enable-unicode --disable-shared --ena
ble-debug
make
make install

I also compiled and installed stc and xrc. Again, no problems.

Then, I tried to compile pgadmin. I wrote:

./configure --enable-static --enable-debug

And apparently, all went fine. But when I try to compile it, I get
*hundreds* of lines like these (the compilation log is almost 3 megs):

/temp/pgadmin3-1.0.2/src/pgAdmin3.cpp(.text+0x16): undefined reference to
`wxAppConsole::CheckBuildOptions(char const *, char const *)'
pgAdmin3.o: In function `wxGetApp(void)':
/temp/pgadmin3-1.0.2/src/pgAdmin3.cpp:66: undefined reference to
`wxAppConsole::GetInstance(void)'
pgAdmin3.o: In function `main':
/temp/pgadmin3-1.0.2/src/pgAdmin3.cpp:66: undefined reference to
`wxEntry(int &, char **)'
pgAdmin3.o: In function `pgAdmin3::OnInit(void)':
/temp/pgadmin3-1.0.2/src/pgAdmin3.cpp:75: undefined reference to
`wxString::wxString(wchar_t const *)'
/temp/pgadmin3-1.0.2/src/pgAdmin3.cpp:75: undefined reference to
`wxPathOnly(wxString const &)'

It looks like linking problems with wxWindows libraries. I know what to do
when a configure script fails, but this problem exceeds my knowledge and I
want a statically compiled version of pgadmin3 to be able to execute it on
other Linux machines without library dependencies problems.

I have tried to compile it on Debian Woody and Mandrake 9.1 and the same
problem occurs. With pgadmin3 1.0.1 the same problem arises. With 1.0.0, the
configure script complains about xrc not being installed, though it is.

What can I do to get it compiled?

Thanks a lot in advance.




Re: Compilation problems

От
Andreas Pflug
Дата:
Diego wrote:

>Hi everyone! I'm having problems while compiling pgadmin3 1.0.2. I've
>followed step
>by step the compilation instructions on the web.
>
>First of all, I compiled and installed Postgresql 7.4 without any problem.
>Later I compiled and installed wxWindows 2.5 as stated on the web:
>
>./configure --with-gtk --enable-gtk2 --enable-unicode --disable-shared --ena
>ble-debug
>make
>make install
>
>I also compiled and installed stc and xrc. Again, no problems.
>
>Then, I tried to compile pgadmin. I wrote:
>
>./configure --enable-static --enable-debug
>
>And apparently, all went fine. But when I try to compile it, I get
>*hundreds* of lines like these (the compilation log is almost 3 megs):
>
>/temp/pgadmin3-1.0.2/src/pgAdmin3.cpp(.text+0x16): undefined reference to
>`wxAppConsole::CheckBuildOptions(char const *, char const *)'
>pgAdmin3.o: In function `wxGetApp(void)':
>/temp/pgadmin3-1.0.2/src/pgAdmin3.cpp:66: undefined reference to
>`wxAppConsole::GetInstance(void)'
>pgAdmin3.o: In function `main':
>/temp/pgadmin3-1.0.2/src/pgAdmin3.cpp:66: undefined reference to
>`wxEntry(int &, char **)'
>pgAdmin3.o: In function `pgAdmin3::OnInit(void)':
>/temp/pgadmin3-1.0.2/src/pgAdmin3.cpp:75: undefined reference to
>`wxString::wxString(wchar_t const *)'
>/temp/pgadmin3-1.0.2/src/pgAdmin3.cpp:75: undefined reference to
>`wxPathOnly(wxString const &)'
>
>It looks like linking problems with wxWindows libraries.
>

Try configure's --with-wx=/usr/local/wx2.5 or wherever your wx. 
installation went.

Regards,
Andreas




Re: Compilation problems

От
"Diego"
Дата:
----- Original Message ----- 
From: "Andreas Pflug" <pgadmin@pse-consulting.de>
To: "Diego" <diegoman@usuarios.retecal.es>
Cc: <pgadmin-support@postgresql.org>
Sent: Saturday, March 20, 2004 9:49 AM
Subject: Re: [pgadmin-support] Compilation problems
[...]

> >It looks like linking problems with wxWindows libraries.
> >
>
> Try configure's --with-wx=/usr/local/wx2.5 or wherever your wx.
> installation went.
>
> Regards,
> Andreas

Hi Andreas, thanks a lot for your answer. I've tried that with no luck. I've
also compiled wxWindows in shared libraries (--enable-shared option in
configure script) but I get the same error when I try to compile pgadmin.

I've taken a look at the (big) line which generates the "undefined
reference" errors:

g++ -DDATA_DIR=\"/usr/local/pgadmin3/share/pgadmin3/\" -Wall -g -I../src/inc
lude -I -Wall -g -O0  -L/usr/local/pgsql/lib -L/usr/local/lib -o pgadmin3
pgAdmin3.o pgConn.o pgSet.o keywords.o pgAggregate.o pgCast.o pgCheck.o
pgCollection.o pgColumn.o pgConstraints.o pgConversion.o pgDatabase.o
pgDomain.o pgForeignKey.o pgFunction.o pgGroup.o pgIndex.o
pgIndexConstraint.o pgLanguage.o pgObject.o pgOperator.o pgOperatorClass.o
pgRule.o pgSchema.o pgSequence.o pgServer.o pgTable.o pgTrigger.o pgType.o
pgUser.o pgView.o pgDatatype.o ctlSQLBox.o ctlSQLResult.o frmExport.o
dlgAddTableView.o events.o frmAbout.o frmChildTableViewFrame.o frmConnect.o
frmMain.o frmOptions.o frmPassword.o frmQuery.o frmQueryBuilder.o frmHelp.o
frmQBJoin.o frmSplash.o frmMaintenance.o frmEditGrid.o dlgProperty.o
dlgUser.o dlgGroup.o dlgDatabase.o dlgLanguage.o dlgSchema.o dlgDomain.o
dlgTable.o dlgColumn.o dlgIndex.o dlgFunction.o dlgView.o dlgRule.o
dlgOperator.o dlgAggregate.o dlgCast.o dlgConversion.o dlgIndexConstraint.o
dlgForeignKey.o dlgSequence.o dlgTrigger.o dlgType.o dlgCheck.o frmStatus.o
misc.o sysLogger.o sysSettings.o xrcDialogs.o/usr/local/pgsql/lib/libpq.a -lcrypt  -lssl -lcrypto

As you can see, no wxWindows libraries are invoked. I'm not a gcc expert,
but I think there should be something like this on the line above:
"/usr/local/lib/libwx_gtk2ud_core-2.5.a" or "-llibwx_gtk2ud_core-2.5". The
static wxWindows libraries are stored in /usr/local/lib, which is included
above, (-L/usr/local/lib), but the libraries have to be invoked explicitly,
don't they? The wxWindows libraries currently present in my /usr/local/lib
dir are:

libwxexpatd.a
libwx_baseud-2.5.a
libwx_baseud_net-2.5.a
libwx_baseud_xml-2.5.a
libwx_gtk2ud_adv-2.5.a
libwx_gtk2ud_core-2.5.a
libwx_gtk2ud_html-2.5.a
libwx_gtk2ud_stc-2.5.a
libwx_gtk2ud_xrc-2.5.a

Any idea of what can I do to fix this problem?

Thanks again.



Re: Compilation problems

От
Raphaël Enrici
Дата:
Diego wrote:

>----- Original Message ----- 
>From: "Andreas Pflug" <pgadmin@pse-consulting.de>
>To: "Diego" <diegoman@usuarios.retecal.es>
>Cc: <pgadmin-support@postgresql.org>
>Sent: Saturday, March 20, 2004 9:49 AM
>Subject: Re: [pgadmin-support] Compilation problems
>[...]
>
>  
>
>>>It looks like linking problems with wxWindows libraries.
>>>
>>>      
>>>
>>Try configure's --with-wx=/usr/local/wx2.5 or wherever your wx.
>>installation went.
>>
>>Regards,
>>Andreas
>>    
>>
>
>Hi Andreas, thanks a lot for your answer. I've tried that with no luck. I've
>also compiled wxWindows in shared libraries (--enable-shared option in
>configure script) but I get the same error when I try to compile pgadmin.
>  
>

Hi Diego,
it looks like the exact same problem I had while packaging pgAdmin3 
1.0.2 for debian.
Dirk Dil reported the same problem on an LFS installation last february.
To me it's a "configure" issue. I detailed the steps to follow in a 
thread on pgadmin-support mailing list: the thread is untitled 
"compiling problem".
Please have a look here:
http://archives.postgresql.org/pgadmin-support/2004-02/msg00087.php
Download the patch I sent in that previous mail and retry a build.

If it solves this build problem, I think it's a candidate for a FAQ 
until we deliver a new corrected version.
Last but not least, why are you trying a build ? Which OS do you use ? :)

Regards,
Raphaël




Re: Compilation problems

От
"Diego"
Дата:
----- Original Message ----- 
From: "Raphaël Enrici" <blacknoz@club-internet.fr>
To: "Diego" <diegoman@usuarios.retecal.es>
Cc: "Andreas Pflug" <pgadmin@pse-consulting.de>;
<pgadmin-support@postgresql.org>
Sent: Sunday, March 21, 2004 12:02 AM
Subject: Re: [pgadmin-support] Compilation problems
[...]
> Hi Diego,
> it looks like the exact same problem I had while packaging pgAdmin3
> 1.0.2 for debian.
> Dirk Dil reported the same problem on an LFS installation last february.
> To me it's a "configure" issue. I detailed the steps to follow in a
> thread on pgadmin-support mailing list: the thread is untitled
> "compiling problem".
> Please have a look here:
> http://archives.postgresql.org/pgadmin-support/2004-02/msg00087.php
> Download the patch I sent in that previous mail and retry a build.
>
> If it solves this build problem, I think it's a candidate for a FAQ
> until we deliver a new corrected version.
> Last but not least, why are you trying a build ? Which OS do you use ? :)
>
> Regards,
> Raphaël
>

Hi, Raphaël. At last I've been able to compile pgadmin using your patch,
thank you. In my first attempt, I got an undefined reference to PQgetssl
(the same error that Dirk Dil reports on the thread you pointed), but I
solved it recompiling Postgresql with ssl support.

Just one more comment: Though the --enable-static option is selected, the
binary you get is still using shared libraries. The makefile invokes
"-lcrypt  -lssl -lcrypto", which, as far as I know, make gcc use shared
libraries when "--static" option is not used. Is this a security issue? I
edited the makefile and replaced them with their corresponding static
libraries. The compilation went fine. Did I something wrong or it's OK to do
that?

Regards



Re: Compilation problems

От
Raphaël Enrici
Дата:
Hi Diego,

Diego wrote:

>
>Hi, Raphaël. At last I've been able to compile pgadmin using your patch,
>thank you.
>
You're welcome.

> In my first attempt, I got an undefined reference to PQgetssl
>(the same error that Dirk Dil reports on the thread you pointed), but I
>solved it recompiling Postgresql with ssl support.
>
>
What is strange here is that the SSL build should not be attempted if
libpq does not handle SSL inside...

>Just one more comment: Though the --enable-static option is selected, the
>binary you get is still using shared libraries. The makefile invokes
>"-lcrypt  -lssl -lcrypto", which, as far as I know, make gcc use shared
>libraries when "--static" option is not used. Is this a security issue?
>
Which args did you pass to configure exactly ?
Don't know if it's a side effect or a real will. The fact is that it did
exactly what I wanted for my Debian purposes: link statically wx and the
rest in shared mode...

>The compilation went fine. Did I something wrong or it's OK to do
>that?
>
>
That's for sure not the best way to do this, but you got what you wanted
isn't it ? ;)
I'm CCing that mail to Adam H. Pendleton who is THE configure man for
pgAdmin3... To me there are numerous issues described here which should
be taken in consideration.

Adam: the patch I sent to the list in the previous mail is simply a
backport of what we do in 1.1.0 cvs branch. I also added a correction
you did to src/Makefile.am to solve the SSL build issue (if you
remember, it was just the '-I $(WX_HOME)' stuff which was giving a -I
-DSSL while in the build process). I had no time to overlook what was
going on exactly, but may be it would be interesting to investigate...

Diego, you didn't answer concerning the OS you try to build on... Some
kind of secret ? :)
We stay in touch, it may be a good thing that you send your
config.log.gz to pgadmin-hackers@postgresql.org

Regards,
Raphaël


Re: Compilation problems

От
"Diego"
Дата:
Hi again, Raphaël.

----- Original Message ----- 
From: "Raphaël Enrici" <blacknoz@club-internet.fr>
To: "Diego" <diegoman@usuarios.retecal.es>
Cc: <pgadmin-support@postgresql.org>; <pgadmin-hackers@postgresql.org>;
"Adam H.Pendleton" <fmonkey@fmonkey.net>
Sent: Sunday, March 21, 2004 8:10 PM
Subject: Re: [pgadmin-support] Compilation problems


> Hi Diego,
>
> Diego wrote:
>
> >
> >Hi, Raphaël. At last I've been able to compile pgadmin using your patch,
> >thank you.
> >
> You're welcome.
>
> > In my first attempt, I got an undefined reference to PQgetssl
> >(the same error that Dirk Dil reports on the thread you pointed), but I
> >solved it recompiling Postgresql with ssl support.
> >
> >
> What is strange here is that the SSL build should not be attempted if
> libpq does not handle SSL inside...
>
> >Just one more comment: Though the --enable-static option is selected, the
> >binary you get is still using shared libraries. The makefile invokes
> >"-lcrypt  -lssl -lcrypto", which, as far as I know, make gcc use shared
> >libraries when "--static" option is not used. Is this a security issue?
> >
> Which args did you pass to configure exactly ?
> Don't know if it's a side effect or a real will. The fact is that it did
> exactly what I wanted for my Debian purposes: link statically wx and the
> rest in shared mode...

The args I passed to the script were the ones that the compilation
instructions on the web suggest: --enable-static and --enable-debug

> >The compilation went fine. Did I something wrong or it's OK to do
> >that?
> >
> >
> That's for sure not the best way to do this, but you got what you wanted
> isn't it ? ;)

I'll be able to check it tomorrow, when I'll use Pgadmin intensively, but
yes, apparently it works ;)

> I'm CCing that mail to Adam H. Pendleton who is THE configure man for
> pgAdmin3... To me there are numerous issues described here which should
> be taken in consideration.
>
> Adam: the patch I sent to the list in the previous mail is simply a
> backport of what we do in 1.1.0 cvs branch. I also added a correction
> you did to src/Makefile.am to solve the SSL build issue (if you
> remember, it was just the '-I $(WX_HOME)' stuff which was giving a -I
> -DSSL while in the build process). I had no time to overlook what was
> going on exactly, but may be it would be interesting to investigate...
>
> Diego, you didn't answer concerning the OS you try to build on... Some
> kind of secret ? :)

Sorry, I forgot to answer this question, but I wrote it on my first message
here ;) My first attempt was on a Debian Woody, but because I couldn't
compile there and I had an old Postgresql version (7.1.something), I tried
it on a Mandrake 9.1 that I have on my secondary disk with Postgresql 7.4. I
got the same "undefined reference" errors on both. Finally I got it compiled
on Mandrake, using your patch.

> We stay in touch, it may be a good thing that you send your
> config.log.gz to pgadmin-hackers@postgresql.org

Ok, I'll send the log and a description of my problems.

> Regards,
> Raphaël

Regards,
Diego



Re: Compilation problems

От
Raphaël Enrici
Дата:
Diego wrote:

>Sorry, I forgot to answer this question, but I wrote it on my first message
>here ;) My first attempt was on a Debian Woody, but because I couldn't
>compile there and I had an old Postgresql version (7.1.something), I tried
>it on a Mandrake 9.1 that I have on my secondary disk with Postgresql 7.4. I
>got the same "undefined reference" errors on both. Finally I got it compiled
>on Mandrake, using your patch.
>  
>
Ok, so you needed it for Debian Woody and/or Mandrake.
Concerning woody, we provide packages for it, why not simply using them ?
If you need a more up to date PostgreSQL for woody, Oliver Elphick who 
is responsible of PostgreSQL for Debian provides its own backports: 
http://people.debian.org/~elphick/
pgAdmin3 has just entered Debian (see 
http://packages.debian.org/pgadmin3) and I'll backport this particular 
version for woody asap: except for the postgresql dependencies, it 
should be a simple rebuild of the source package with dpkg-buildpackage.

Concerning Mandrake 9.1, packages are also provided.

Is there a particular reason except personnal willing to learn which 
pushed you not using the packages ? I ask this because this is to me 
interesting to know why people don't use provided packages: it can 
figure out a bad communication from our side, or simply badly packaged 
things or documentation.

>>We stay in touch, it may be a good thing that you send your
>>config.log.gz to pgadmin-hackers@postgresql.org
>>    
>>
>Ok, I'll send the log and a description of my problems.
>  
>
Thanks.

Regards,
Raphaël


Re: Compilation problems

От
"Diego"
Дата:
----- Original Message ----- 
From: "Raphaël Enrici" <blacknoz@club-internet.fr>
To: "Diego" <diegoman@usuarios.retecal.es>
Cc: <pgadmin-support@postgresql.org>
Sent: Sunday, March 21, 2004 11:14 PM
Subject: Re: [pgadmin-support] Compilation problems
[...]
> Ok, so you needed it for Debian Woody and/or Mandrake.
> Concerning woody, we provide packages for it, why not simply using them ?
> If you need a more up to date PostgreSQL for woody, Oliver Elphick who
> is responsible of PostgreSQL for Debian provides its own backports:
> http://people.debian.org/~elphick/
> pgAdmin3 has just entered Debian (see
> http://packages.debian.org/pgadmin3) and I'll backport this particular
> version for woody asap: except for the postgresql dependencies, it
> should be a simple rebuild of the source package with dpkg-buildpackage.
>
> Concerning Mandrake 9.1, packages are also provided.
>
> Is there a particular reason except personnal willing to learn which
> pushed you not using the packages ?

Well, here's the explanation: we are using PostgreSQL 7.4 on SuSE 9.0 for
some projects at work, and my boss wanted pgadmin for Linux, because he was
using the Windows version but we weren't using Windows anymore. So he told
me to get the Linux version. I visited the web page but I saw there weren't
SuSE 9.0 packages. I downloaded the 8.2 package and told the system
administrator to try to install it, but apparently there was a dependency
problem (maybe something related to libssl, I think he told me). Maybe it
could have been solved by simply symlinking (I suppose pgadmin was looking
for a previous version of libssl library), but he didn't like this solution
(don't ask me why). Then I googled and found some messages where people told
that the Mandrake packages worked fine on SuSE 9, so I downloaded and asked
the administrator to install them but he told me that pgadmin didn't work
properly.

So later on friday, I told my boss: ok, no problem, I'll download the
sources and in ten minutes this weekend I'll have a statically compiled
version of pgadmin, which I'll bring on monday, and we won't have
dependencies problems anymore. How could I expect that I would have so many
problems!

As you already know, I have Debian and Mandrake installed at home, and not
SuSE, so this is the reason of why I wasn't using prebuilt packages for
these two distributions.

But anyway, I admit that after two failed attempts, it became something
personal and this is why I've been disturbing the list during the last 48
hours ;)

> I ask this because this is to me
> interesting to know why people don't use provided packages: it can
> figure out a bad communication from our side, or simply badly packaged
> things or documentation.

I'm sure that the packages are perfectly built (I just missed SuSE 9.0
packages!) and they are easily accesible, and the compilation instructions
at the web are clear and concise, the only problem I've found is that the
configure script seems to need some tuning (or maybe some extra steps on the
compilation instructions, if I've been doing something wrong).

> >>We stay in touch, it may be a good thing that you send your
> >>config.log.gz to pgadmin-hackers@postgresql.org
> >>
> >>
> >Ok, I'll send the log and a description of my problems.
> >
> >
> Thanks.
>
> Regards,
> Raphaël

I've already sent a message to pgadmin-hackers list.

Regards,
Diego.