Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Risolto] Mi serve gcc 4: averlo solo per un utente?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
AlbertoSSj
Tux's lil' helper
Tux's lil' helper


Joined: 21 Nov 2004
Posts: 135

PostPosted: Fri Dec 02, 2005 5:27 pm    Post subject: [Risolto] Mi serve gcc 4: averlo solo per un utente? Reply with quote

Devo lavorare su un'applicazione con gcc 4 per forza :|

Quello che però non voglio, e mettere gcc4 per l'emerge

posso averli entrambi?


Last edited by AlbertoSSj on Sun Dec 04, 2005 12:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Fri Dec 02, 2005 5:30 pm    Post subject: Re: Mi serve gcc 4: è possibile averlo solo per un utente? Reply with quote

Quote:
Devo lavorare su un'applicazione con gcc 4 per forza :|

auguri
Quote:
Quello che però non voglio, e mettere gcc4 per l'emerge
posso averli entrambi?

ma certo. i compilatori sono "slotted"
puoi installarne diversi senza che i vecchi vengano sovrascritti
poi scegli quello che vuoi con gcc-config
Back to top
View user's profile Send private message
AlbertoSSj
Tux's lil' helper
Tux's lil' helper


Joined: 21 Nov 2004
Posts: 135

PostPosted: Fri Dec 02, 2005 5:45 pm    Post subject: Reply with quote

Quote:
auguri

eh eh eh
in realtà ci sono solo due motivi ^^''
1) è quello usato dal resto del gruppo
2) la versione di gentoo non capisce questa riga di codice
Code:
std::pair<double,double>(0.,0.)

Ovvero non posso specificare il template nella funzione...
Il resto del codice compila in entrambi (le qt meglio sul 3.3.6)

Quote:
ma certo. i compilatori sono "slotted"
puoi installarne diversi senza che i vecchi vengano sovrascritti
poi scegli quello che vuoi con gcc-config

:oops: Non ho mai fatto una cosa simile
Ora cerco come farla da qualche parte

Grazie della dritta :D
Back to top
View user's profile Send private message
xbb
Tux's lil' helper
Tux's lil' helper


Joined: 26 Nov 2005
Posts: 85

PostPosted: Fri Dec 02, 2005 6:07 pm    Post subject: Reply with quote

basta che emergi gcc 4 poi:

Code:
gcc-config -l


oppure

Code:
gcc -v


e controlli che il profilo di default non sia gcc 4 :)

Se devi cambiare profilo basta che digiti:

Code:

gcc-config <profilo>

source /etc/profile


dove ad esempio <profilo> è 'i686-pc-linux-gnu-3.4.4'

buona fortuna :)
Back to top
View user's profile Send private message
AlbertoSSj
Tux's lil' helper
Tux's lil' helper


Joined: 21 Nov 2004
Posts: 135

PostPosted: Fri Dec 02, 2005 8:32 pm    Post subject: Reply with quote

ero in dubbio sulla flag
Code:
-multislot


alla fine mi son messo e ho fatto il porting di tutto il codice ^^''

non me la son sentita di fare casini :oops:
Back to top
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Sat Dec 03, 2005 12:22 pm    Post subject: Reply with quote

non fai nessun casino. fidati
Back to top
View user's profile Send private message
Dr.Dran
l33t
l33t


Joined: 08 Oct 2004
Posts: 766
Location: Imola - Italy

PostPosted: Sat Dec 03, 2005 5:11 pm    Post subject: Reply with quote

Ciao come ti hanno suggerito è possibile grazie a gcc-config (guarda nel wiki ci sono un sacco di esempio oppure cerca l'Howto del Jackass team qui nel forum, anche lì c'è un esempio di come installare un 2 compilatori e switchare fra l'uno e l'altro senza problemi, io per esempio lo faccio per un discorso di cross-compilng), ma per cortesia metti il flag RISOLTO nell'oggetto del post :wink:

Ciauz e in bocca al Lupo :D
_________________
:: [Dr.Dran] Details ::
- Linux User # 286282
- IT FreeLance Consultant
- President of ImoLUG [Imola & Faenza Linux User Group]
Back to top
View user's profile Send private message
AlbertoSSj
Tux's lil' helper
Tux's lil' helper


Joined: 21 Nov 2004
Posts: 135

PostPosted: Sat Dec 03, 2005 5:20 pm    Post subject: Reply with quote

Ok metto risolto ^^''

Ma quando faccio gcc-config mi dice

you must be root ^^''
Back to top
View user's profile Send private message
Dr.Dran
l33t
l33t


Joined: 08 Oct 2004
Posts: 766
Location: Imola - Italy

PostPosted: Sat Dec 03, 2005 5:32 pm    Post subject: Reply with quote

Chiaramente devi avere i diritti di root per fare lo switch, oppure se non vuoi tutte le volte fare "su root" puoi risolvere il tutto con sudo :wink:
_________________
:: [Dr.Dran] Details ::
- Linux User # 286282
- IT FreeLance Consultant
- President of ImoLUG [Imola & Faenza Linux User Group]
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Sat Dec 03, 2005 5:47 pm    Post subject: Reply with quote

AlbertoSSj wrote:
Ok metto risolto ^^''

Ma quando faccio gcc-config mi dice

you must be root ^^''


Secondo me la cosa migliore da fare è non usare gcc-config nel tuo caso dal momento che ogni volta che devi emergere qualcosa devi cambiare profilo e magari non puoi perchè stai lavorando al tuo progetto.
Secondo me la cosa migliore da fare è:

Passi alla versione 4.X di gcc:

Code:
gcc-config i686-pc-linux-gnu-4.X


usando il contenuto di /etc/env.d/05gcc modifichi il tuo .bashrc (quello dell'utente che userai per il tuo progetto).

ritorni alla versione precedente:
Code:
gcc-config i686-pc-linux-gnu-3.X


Spero di essere stato chiaro.
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
AlbertoSSj
Tux's lil' helper
Tux's lil' helper


Joined: 21 Nov 2004
Posts: 135

PostPosted: Sun Dec 04, 2005 12:33 pm    Post subject: Reply with quote

Fatto ^^

Pare funzionare :D

Grazie a tutti
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Sun Dec 04, 2005 2:36 pm    Post subject: Reply with quote

AlbertoSSj wrote:
Pare funzionare :D


Scusate, ma non basta che l'utente che ha bisogno del gcc 4 scriva:
Code:
alias gcc="/usr/bin/gcc-4.0.1'

lasciando cosí in pace le utenze di sistema?
_________________
Ciao da me!
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Sun Dec 04, 2005 4:21 pm    Post subject: Reply with quote

Quali lib vengono usate?
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
comio
Advocate
Advocate


Joined: 03 Jul 2003
Posts: 2191
Location: Taranto

PostPosted: Sun Dec 04, 2005 4:53 pm    Post subject: Reply with quote

AlbertoSSj wrote:

2) la versione di gentoo non capisce questa riga di codice
Code:
std::pair<double,double>(0.,0.)

Ovvero non posso specificare il template nella funzione...

comunque pair è una struct. sicuro che sia lì il problema?
puoi andare a vedere qui: http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/stl__pair_8h-source.html alla riga 68.

non so il resto del codice come sia fatto, comunque in quel modo dovresti richiamare il costrutture e dovrebbe risolvere dal tipo dei parametri (aggiungi magari una l per forzare i double), senza specificare esplicitamente il tipo di template. Se è solo quello il problema, ti consiglio di patchare il codice... secondo me fai prima.

ciao
_________________
RTFM!!!!

e

http://www.comio.it
:)
Back to top
View user's profile Send private message
AlbertoSSj
Tux's lil' helper
Tux's lil' helper


Joined: 21 Nov 2004
Posts: 135

PostPosted: Sun Dec 04, 2005 5:05 pm    Post subject: Reply with quote

Ho modificato il codice ^^''

Alcuni costrutti coi template e le funzioni non vengono lette, c'era tutta una libreria con

read<double>, read<int>, read<std::list<int> >

e cosi via.
La soluzione è stata

double a;
read(a);

cosi carica bene ^^''

però ho fatto prove col 3.4

e sembra funzionare il codice non patchato.
Quando finisce l'emerge -e world faccio test più approfonditi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum