Autor Tópico: Como saber qual compilador é necessário para determinado arquivo?  (Lida 4671 vezes)

Offline usifoto

  • Usuário Ubuntu
  • *
  • Mensagens: 320
    • Ver perfil
 :-\

Pessoal,

Como saber de qual compilador eu vou precisar para compilar os códigos baixados?

Eu tenho bastante espaço em disco. Se alguém puder, me passa uma lista do que eu posso instalar para não ter mais tantos problemas. Nunca consegui fazer um ./configure, make, make install bem sucedido.

Offline Lamego

  • Usuário Ubuntu
  • *
  • Mensagens: 1.943
    • Ver perfil
Re: Como saber qual compilador é necessário para determinado arquivo?
« Resposta #1 Online: 21 de Julho de 2006, 07:38 »
Olá,
o problema não é saber qual o compilador, o compiador e sempre o mesmo, o GCC.
O que costuma variar e muito são as bibliotecas que o programa utiliza.
De qualquer forma é fácil de encontrar as bibliotecas com o comando:
Código: [Selecionar]
apt-cache search nome_da_biblioteca
João Luís Marques Pinto
Mais programs e jogos para o Ubuntu

Offline usifoto

  • Usuário Ubuntu
  • *
  • Mensagens: 320
    • Ver perfil
Re: Como saber qual compilador é necessário para determinado arquivo?
« Resposta #2 Online: 21 de Julho de 2006, 09:12 »
 ???

Desculpe, não entendi.

Quando tento compilar usando ./configure, make, make install, sempre o processo pára e dá alguma mensagem de erro que eu não entendo.

Quando você diz "encontrar essas bibliotecas", refere-se às disponíveis no meu sistema ou nos repositórios habilitados, isto é, com esse comando eu vou procurar essas bibliotecas no meu próprio sistema ou elas serão baixadas?


Offline Lamego

  • Usuário Ubuntu
  • *
  • Mensagens: 1.943
    • Ver perfil
Re: Como saber qual compilador é necessário para determinado arquivo?
« Resposta #3 Online: 21 de Julho de 2006, 10:36 »
usifoto,
não deve fazer o make e make install se o configure der erro.
Presumo que a situação a que se refere é o ./configure dar erro.
O comando "apt-cache search" procura em todos os repositórios que você tenha configurado, os resultados são apresentados tanto para pacotes já instalados como para pacotes que pode instalar.
De qualquer forma no Ubuntu não se espera que obter o programa a partir do código fonte seja algo frequente, deve sermpre tentar utilizar as versões de repositório.
João Luís Marques Pinto
Mais programs e jogos para o Ubuntu

Offline usifoto

  • Usuário Ubuntu
  • *
  • Mensagens: 320
    • Ver perfil
Re: Como saber qual compilador é necessário para determinado arquivo?
« Resposta #4 Online: 21 de Julho de 2006, 11:10 »
Veja todo o processo:

Código: [Selecionar]
root@marscop:/home/marscop# cd '/root'
root@marscop:~# cd '/home'
root@marscop:/home# cd '/home/marscop'
root@marscop:/home/marscop# cd '/home/marscop/Programas'
root@marscop:/home/marscop/Programas# cd '/home/marscop/Programas/kbilliards-0.8.7'
root@marscop:/home/marscop/Programas/kbilliards-0.8.7# ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for -p flag to install... yes
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether g++ supports -Wmissing-format-attribute... yes
checking whether g++ supports -Wundef... yes
checking whether g++ supports -Wno-long-long... yes
checking whether g++ supports -Wnon-virtual-dtor... yes
checking whether g++ supports -fno-exceptions... yes
checking whether g++ supports -fno-check-new... yes
checking whether g++ supports -fno-common... yes
checking whether g++ supports -fexceptions... yes
checking how to run the C++ preprocessor... g++ -E
checking whether g++ supports -O0... yes
checking whether g++ supports -Wl,--no-undefined... yes
checking whether g++ supports -Wl,--allow-shlib-undefined... yes
not using lib directory suffix
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for shl_load... (cached) no
checking for shl_load in -ldld... (cached) no
checking for dlopen... (cached) no
checking for dlopen in -ldl... (cached) yes
checking whether a program can dlopen itself... (cached) yes
checking whether a statically linked program can dlopen itself... (cached) yes
appending configuration tag "F77" to libtool
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking if C++ programs can be compiled... yes
checking for strlcat... no
checking if strlcat needs custom prototype... yes - in libkdefakes
checking for strlcpy... no
checking if strlcpy needs custom prototype... yes - in libkdefakes
checking for main in -lutil... yes
checking for main in -lcompat... no
checking for crypt in -lcrypt... yes
checking for socklen_t... socklen_t
checking for dnet_ntoa in -ldnet... no
checking for dnet_ntoa in -ldnet_stub... no
checking for inet_ntoa... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for sys/types.h... (cached) yes
checking for stdint.h... (cached) yes
checking for poll in -lpoll... no
checking CoreAudio/CoreAudio.h usability... no
checking CoreAudio/CoreAudio.h presence... no
checking for CoreAudio/CoreAudio.h... no
checking if res_init needs -lresolv... yes
checking if res_init is available... yes
checking for killpg in -lucb... no
checking for int... yes
checking size of int... 4
checking for short... yes
checking size of short... 2
checking for long... yes
checking size of long... 4
checking for char *... yes
checking size of char *... 4
checking for dlopen in -ldl... (cached) yes
checking for shl_unload in -ldld... no
checking for size_t... yes
checking size of size_t... 4
checking for unsigned long... yes
checking size of unsigned long... 4
checking sizeof size_t == sizeof unsigned long... yes
checking crt_externs.h usability... no
checking crt_externs.h presence... no
checking for crt_externs.h... no
checking for _NSGetEnviron... no
checking for vsnprintf... yes
checking for snprintf... yes
checking for X... libraries /usr/X11R6/lib, headers .
checking for IceConnectionNumber in -lICE... yes
checking for libXext... yes
checking for pthread_create in -lpthread... yes
checking for extra includes... no
checking for extra libs... no
checking for libz... -lz
checking for libpng... -lpng -lz -lm
checking for libjpeg6b... no
checking for libjpeg... -ljpeg
checking for perl... /usr/bin/perl
checking for Qt... libraries /usr/share/qt3/lib, headers /usr/share/qt3/include using -mt
checking for moc... /usr/share/qt3/bin/moc
checking for uic... /usr/share/qt3/bin/uic
checking whether uic supports -L ... yes
checking whether uic supports -nounload ... yes
checking if Qt needs -ljpeg... no
checking for rpath... yes
checking for KDE... libraries /usr/lib, headers /usr/include/kde
checking if UIC has KDE plugins available... yes
checking for KDE paths... defaults
checking for dcopidl... /usr/bin/dcopidl
checking for dcopidl2cpp... /usr/bin/dcopidl2cpp
checking for mcopidl... /usr/bin/mcopidl
checking for artsc-config... /usr/bin/artsc-config
checking for kde-config... /usr/bin/kde-config
checking for meinproc... /usr/bin/meinproc
checking for xmllint... /usr/bin/xmllint
checking whether byte ordering is bigendian... no
checking for MAXPATHLEN... 4096
checking if doc should be compiled... yes
checking if media should be compiled... yes
checking if po should be compiled... yes
checking if src should be compiled... yes
configure: creating ./config.status
fast creating Makefile
fast creating doc/Makefile
fast creating doc/en/Makefile
fast creating media/Makefile
fast creating media/balls/Makefile
fast creating media/maps/Makefile
fast creating media/other/Makefile
fast creating media/sound/Makefile
fast creating po/Makefile
fast creating src/Makefile
config.pl: fast created 10 file(s).
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

Good - your configure finished. Start make now
root@marscop:/home/marscop/Programas/kbilliards-0.8.7# make
cd . && make -f admin/Makefile.common configure.in ;
make  all-recursive
make[1]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7'
cd . && make -f admin/Makefile.common configure.in ;
Making all in doc
make[2]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7/doc'
make[3]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7/doc'
make[3]: Nada a ser feito para `all-am'.
make[3]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7/doc'
make[2]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7/doc'
Making all in media
make[2]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7/media'
Making all in sound
make[3]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7/media/sound'
make[3]: Nada a ser feito para `all'.
make[3]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7/media/sound'
Making all in balls
make[3]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7/media/balls'
make[3]: Nada a ser feito para `all'.
make[3]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7/media/balls'
Making all in other
make[3]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7/media/other'
make[3]: Nada a ser feito para `all'.
make[3]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7/media/other'
Making all in maps
make[3]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7/media/maps'
make[3]: Nada a ser feito para `all'.
make[3]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7/media/maps'
make[3]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7/media'
make[3]: Nada a ser feito para `all-am'.
make[3]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7/media'
make[2]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7/media'
Making all in po
make[2]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7/po'
make[2]: Nada a ser feito para `all'.
make[2]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7/po'
Making all in src
make[2]: Entrando no diretório `/home/marscop/Programas/kbilliards-0.8.7/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/kde -I/usr/share/qt3/include -I.   -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common  -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.cpp; \
        then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi
In file included from main.cpp:22:
kbilliards.h:31:19: error: qlist.h: No such file or directory
/usr/include/kde/arts/notification.h:54: warning: ‘class Arts::NotificationClient’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/iomanager.h:93: warning: ‘class Arts::IONotify’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/iomanager.h:112: warning: ‘class Arts::TimeNotify’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/startupmanager.h:42: warning: ‘class Arts::StartupClass’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/factory.h:45: warning: ‘class Arts::Factory’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/idlfilereg.h:41: warning: ‘class Arts::IDLFileReg’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/datapacket.h:43: warning: ‘class Arts::GenericDataChannel’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/asyncstream.h:44: warning: ‘class Arts::GenericAsyncStream’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/asyncstream.h: In instantiation of ‘Arts::AsyncStream<float>’:
/usr/include/kde/arts/asyncstream.h:87:   instantiated from here
/usr/include/kde/arts/asyncstream.h:63: warning: ‘class Arts::AsyncStream<float>’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/asyncstream.h:88: warning: ‘class Arts::FloatAsyncStream’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/asyncstream.h: In instantiation of ‘Arts::AsyncStream<unsigned char>’:
/usr/include/kde/arts/asyncstream.h:94:   instantiated from here
/usr/include/kde/arts/asyncstream.h:63: warning: ‘class Arts::AsyncStream<unsigned char>’ has virtual functions but non-virtual destructor
/usr/include/kde/arts/asyncstream.h:95: warning: ‘class Arts::ByteAsyncStream’ has virtual functions but non-virtual destructor
make[2]: ** [main.o] Erro 1
make[2]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7/src'
make[1]: ** [all-recursive] Erro 1
make[1]: Saindo do diretório `/home/marscop/Programas/kbilliards-0.8.7'
make: ** [all] Erro 2
root@marscop:/home/marscop/Programas/kbilliards-0.8.7#

Eu não achei esse programa em forma de pacote já compilado.

Offline Lamego

  • Usuário Ubuntu
  • *
  • Mensagens: 1.943
    • Ver perfil
Re: Como saber qual compilador é necessário para determinado arquivo?
« Resposta #5 Online: 21 de Julho de 2006, 11:20 »
usifoto,
no caso que tá mostrando o problema só pode ser 1 de 2 casos:
1 - O código tá mesmo quebrado (por vezes os desenvolvedores colocam os .tar.gz e esquece malguns arquivos)
2 - O configurador não detecta correctamente a versão das bibliotecas necessáris ou o código foi feito para versões de bibliotecas mais antigas do que as que estão instaladas no Ubuntu.
Eu aconselharia a tentar utilizar o suporte do proprio programa relatando o erro.
João Luís Marques Pinto
Mais programs e jogos para o Ubuntu

Offline Lamego

  • Usuário Ubuntu
  • *
  • Mensagens: 1.943
    • Ver perfil
Re: Como saber qual compilador é necessário para determinado arquivo?
« Resposta #6 Online: 22 de Julho de 2006, 07:32 »
usifoto,
decidir investir mais algum tempo no problema.
Para compilar esse programa é necessário:
Código: [Selecionar]
sudo apt-get install  qt3-dev-tools qt3-apps-dev libqt3-mt-dev libqt3-compat-headers
sudo apt-get install kde-devel

Atenção:
Com é um programa que utiliza funções de KDE vai instalar uma grande quantidade de bibliotecas adicionais.

Para facilitar o seu trabalho criei um pacote para ubuntu, está com a versão mais recente:
ftp://ftp.sunsite.dk/projects/ptlink/ubuntu/debs/kbilliards-0.8.7_0.8.7-1_i386.deb
João Luís Marques Pinto
Mais programs e jogos para o Ubuntu

Offline usifoto

  • Usuário Ubuntu
  • *
  • Mensagens: 320
    • Ver perfil
Re: Como saber qual compilador é necessário para determinado arquivo?
« Resposta #7 Online: 24 de Julho de 2006, 21:42 »
usifoto,
decidir investir mais algum tempo no problema.
Para compilar esse programa é necessário:
Código: [Selecionar]
sudo apt-get install  qt3-dev-tools qt3-apps-dev libqt3-mt-dev libqt3-compat-headers
sudo apt-get install kde-devel

Atenção:
Com é um programa que utiliza funções de KDE vai instalar uma grande quantidade de bibliotecas adicionais.

Para facilitar o seu trabalho criei um pacote para ubuntu, está com a versão mais recente:
ftp://ftp.sunsite.dk/projects/ptlink/ubuntu/debs/kbilliards-0.8.7_0.8.7-1_i386.deb

Muitíssimo obrigado, Lamego.

Instalou perfeitamente e está funcionando sem problemas.

Eu uso mesmo o KDE.

Mais uma vez, muito grato.  :)