Localhost Posted November 30, 2009 at 09:47 PM Report Share #298129 Posted November 30, 2009 at 09:47 PM Olá pessoal, como alguns já sabem eu mudei para ubuntu, ora bem comecei então a programar lá com o gcc na console ehehe. Surgiu-me uma dúvida que é, como é que eu faço para os ficheiros ficarem executáveis atráves de dois simples cliques? Já vi uma cena do chmod mas já tentei e nada... Alguém me pode dar uma luz? :smoke: EDIT: p.s. Ainda sou muito noob em Linux 🙂 here since 2009 Link to comment Share on other sites More sharing options...
softklin Posted November 30, 2009 at 09:56 PM Report Share #298131 Posted November 30, 2009 at 09:56 PM Acho que basta fazer chmod u+x teuFicheiro Basicamente é dar (+) permissões de execução ao utilizador/dono. Se a aplicação contiver uma interface gráfica, deve ser visível. Caso seja uma aplicação de consola, deves corrê-la pelo terminal, senão não vais ver nada (embora sejam executadas as acções). Nick antigo: softclean | Tens um projeto? | Wiki P@P Ajuda a comunidade! Se encontrares algo de errado, usa a opção "Denunciar" por baixo de cada post. Link to comment Share on other sites More sharing options...
Baderous Posted November 30, 2009 at 10:10 PM Report Share #298141 Posted November 30, 2009 at 10:10 PM Tens a certeza que é preciso isso? Nunca precisei de alterar as permissões de execução para poder executar programas em C. Link to comment Share on other sites More sharing options...
Localhost Posted November 30, 2009 at 10:27 PM Author Report Share #298150 Posted November 30, 2009 at 10:27 PM Pois, eram mesmo programas na consola, então não há maneira? here since 2009 Link to comment Share on other sites More sharing options...
Baderous Posted November 30, 2009 at 10:34 PM Report Share #298154 Posted November 30, 2009 at 10:34 PM Quando disse "executar programas", estava a falar em executá-los via consola. Link to comment Share on other sites More sharing options...
Localhost Posted November 30, 2009 at 10:47 PM Author Report Share #298159 Posted November 30, 2009 at 10:47 PM Lol, já percebi o problema, agora a dúvida é: qual o comando em Linux que espera por uma tecla tipo o system("pause") em windows? here since 2009 Link to comment Share on other sites More sharing options...
Baderous Posted November 30, 2009 at 10:52 PM Report Share #298161 Posted November 30, 2009 at 10:52 PM Por fim, deves retirar o system("PAUSE") e substituir por getchar() (em C) ou cin.get() (em C++), uma vez que essa instrução torna o teu código dependente do SO onde executa. Link to comment Share on other sites More sharing options...
Localhost Posted November 30, 2009 at 10:56 PM Author Report Share #298164 Posted November 30, 2009 at 10:56 PM Pois, já tentei! Só que o meu gcc não reconhece, não deve ter a biblioteca conio.h 🙂 here since 2009 Link to comment Share on other sites More sharing options...
Baderous Posted November 30, 2009 at 10:58 PM Report Share #298165 Posted November 30, 2009 at 10:58 PM Hein? Conio não é para aqui chamada. Dá algum erro? Link to comment Share on other sites More sharing options...
Localhost Posted November 30, 2009 at 11:02 PM Author Report Share #298166 Posted November 30, 2009 at 11:02 PM Conio não é chamada, não é essa a biblioteca que contêm as funções getch(), getche() e por aí em diante? Sim dá erro: /tmp/cco9uNgI.o: In function `main': test.c:(.text+0x17): undefined reference to `getch' collect2: ld returned 1 exit status here since 2009 Link to comment Share on other sites More sharing options...
Baderous Posted November 30, 2009 at 11:03 PM Report Share #298167 Posted November 30, 2009 at 11:03 PM Ah, nesse caso sim, pensei que estavas a falar da dica do system("PAUSE"). A Conio não existe nos sistemas *nix, podes tentar usar uma biblioteca que fornece serviços semelhantes: ncurses. Link to comment Share on other sites More sharing options...
Localhost Posted November 30, 2009 at 11:06 PM Author Report Share #298168 Posted November 30, 2009 at 11:06 PM E utilizo na mesma a função getch()? here since 2009 Link to comment Share on other sites More sharing options...
Baderous Posted November 30, 2009 at 11:08 PM Report Share #298169 Posted November 30, 2009 at 11:08 PM Penso que a ncurses fornece uma função com esse mesmo nome, é questão de investigares. Link to comment Share on other sites More sharing options...
Localhost Posted November 30, 2009 at 11:10 PM Author Report Share #298170 Posted November 30, 2009 at 11:10 PM Ok, vou ver isso... here since 2009 Link to comment Share on other sites More sharing options...
Localhost Posted November 30, 2009 at 11:45 PM Author Report Share #298173 Posted November 30, 2009 at 11:45 PM test.c:2:21: error: ncurses.h: No such file or directory Eu acho é que de bibliotecas só tem mesmo a stdio ehehhe, alguém me podia ajudar? here since 2009 Link to comment Share on other sites More sharing options...
edsousa Posted December 1, 2009 at 12:14 AM Report Share #298177 Posted December 1, 2009 at 12:14 AM bom, para simplificar podes usar a função getc() e não getch(). getc() está disponível na stdio. agora serviço público. Em Linux, podes fazer man getch e ver o manual para a função getch. diz lá que tens que fazer #include <curses.h> (e não ncurses como estavas a fazer) Tharis Fan ClubMay Tharis bless you Link to comment Share on other sites More sharing options...
Localhost Posted December 1, 2009 at 10:20 AM Author Report Share #298186 Posted December 1, 2009 at 10:20 AM Ah, curses, vou testar com todas as opções que me deste, depois digo alguma coisa mas obrigado desde já a todos 🙂 here since 2009 Link to comment Share on other sites More sharing options...
Localhost Posted December 1, 2009 at 10:23 AM Author Report Share #298187 Posted December 1, 2009 at 10:23 AM Olha, acabei de testar... Quanto ao curses.h não deu, eu acho que isto tem muitas poucas bibliotecas 🙂 here since 2009 Link to comment Share on other sites More sharing options...
edsousa Posted December 1, 2009 at 06:44 PM Report Share #298268 Posted December 1, 2009 at 06:44 PM Vai ao Synaptic, e procura por "ncurses". Deves ter um libncurses instalado. Instala o que tem o mesmo nome + "-dev". Este é quase sempre o procedimento quando falta os .h de alguma biblioteca. Tharis Fan ClubMay Tharis bless you Link to comment Share on other sites More sharing options...
Localhost Posted December 4, 2009 at 10:19 PM Author Report Share #298742 Posted December 4, 2009 at 10:19 PM Eu já fiz isso, não aparece lá nada... Desculpa lá a minha 'nobice' here since 2009 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now