Instalei o Allegro 5 no meu Imac pois o Allegro 4 parece nãp ser suportado no High Sierra.
Como faço para instalar o fblend, aastr e alfont no Imac ?
O Allegro 5 aceita todas as funções do Allegro 4 ?
Agradeço desde já !
José Antönio
"Eu instalei Allegro 5 no meu iMac porque o Allegro 4 parece ser
apoiado na alta Sierra.
Como faço para instalar o FBLEND, AASTR e ALFONT no iMac?
Allegro 5 aceita todas as funções de Allegro 4?
Obrigado antecipadamente! "
Allegro 4 não é mais suportado. Allegro 5 é suportado no mais recente OSX.
Você não precisa de fblend, AASTR ou ALFONT com Allegro 5.
Além disso, Allegro 5 é uma API totalmente diferente da Allegro 4.
Translated by translate.google.com
"I installed allegro 5 in my IMAC because allegro 4 seems to be
supported in the high sierra.
How do I install FBLEND, AASTR and Alfont in iMac?
Allegro 5 Accept all Allegro 4 functions?
Thank you in advance! "
Allegro 4 is no longer supported. Allegro 5 is supported on the latest OSX.
You do not need Fblend, AASTR or Alfont with Allegro 5.
In addition, Allegro 5 is a totally different API from Allegro 4.
Ok, o que substitui estas funçoes, não conheço o allegro 5, semente o 4 ! Estou portando para o Imac um aplicativo escrito em 2010 !
Grato pela ajuda ! Deu certo ! Porém tenho um problema ! Fiz um pequeno programa tipo Hello World para testar. Embora o Allegro 5 esteja instalado , está dano um erro na compilação estranho, ele reclama a ausência do Header <allegro5/allegro.h>, creio que isto não deveria estar acontecendo ! Em outro programa escrito no allegro 4, troquei para <allegro5/allegro> e isto não acontece ! Estranho ! Segue o programa e o Makefile :
Programa :
#include< allegro5/allegro.h >
#include< allegro5/allegro_font.h >
#include< stdbool.h >
int principal ()
{
al_init ();
al_install_keyboard ();
ALLEGRO_TIMER* temporizador = al_create_timer ( 1.0 / 30.0 );
ALLEGRO_EVENT_QUEUE* fila = al_create_event_queue ();
ALLEGRO_DISPLAY* exibição = al_create_display ( 320 , 200 );
ALLEGRO_FONT* font = al_create_builtin_font ();
al_register_event_source (fila, al_get_keyboard_event_source ());
al_register_event_source (fila, al_get_display_event_source (disp));
al_register_event_source (fila, al_get_timer_event_source (temporizador));
bool redesenho = true ;
evento ALLEGRO_EVENT;
al_start_timer (temporizador);
enquanto ( 1 )
{
al_wait_for_event (fila, &event);
if (evento. tipo == ALLEGRO_EVENT_TIMER)
redesenhar = verdadeiro ;
else if (( tipo de evento == ALLEGRO_EVENT_KEY_DOWN) || ( tipo de evento == ALLEGRO_EVENT_DISPLAY_CLOSE))
break ;
if (redesenhar && al_is_event_queue_empty (fila))
{
al_clear_to_color ( al_map_rgb ( 0 , 0 , 0 ));
al_draw_text (fonte, al_map_rgb ( 255 , 255 , 255 ), 0 , 0 , 0 , " Olá mundo! " );
al_flip_display ();
redesenhar = falso ;
}
}
al_destroy_font (fonte);
al_destroy_display (exibir);
al_destroy_timer (temporizador);
al_destroy_event_queue (fila);
retorna 0 ;
}
Makefile :
CC = gcc
CFLAGS = -g -Wall
OBJECTS = teste.o
INCFLAGS =
LDFLAGS = -Wl,-rpath,/usr/local/lib
LIBS = -allefro-5 -allegri_main-5 -allegro_font-5
all: caixa
caixa: $(OBJECTS)
$(CC) -o teste $(OBJECTS) $(LDFLAGS) $(LIBS)
.SUFFIXES:
.SUFFIXES: .c .cc .C .cpp .o
.c.o :
$(CC) -o $@ -c $(CFLAGS) $< $(INCFLAGS)
count:
wc *.c *.cc *.C *.cpp *.h *.hpp
clean:
rm -f *.o
.PHONY: all
.PHONY: count
.PHONY: clean
Thank you for help! It worked out ! But I have a problem! I made a small HELLO World program to test. Although Allegro 5 is installed, it is damage a strange compilation error, it complains the absence of the header <allegro5 / allegro.h>, I believe this should not be happening! In another program written on Allegro 4, I switched to <allegro5 / allegro> and this does not happen! Strange ! Follow the program and makefile:
You need to set the search directory for include files so that it will find <allegro5/allegro.h> properly. Usually they are in /usr/include or /usr/local/include and you include them with -I /usr/DIRECTORY
Obrigado, mas o -I /usr/DIRECTORY eu coloco no programa antes do #include ou dentro do #include ?
g++ -Wall -Wextra -g -I /usr/local/include -o prog.exe prog.cpp -lallegro_monolith-debug.dll
Obrigado mais uma vex ! Alterei que você indicou porém continua dizendo que não encontra o <allegro5/allegro5.h> !
Veja o makefie abaixo :
CC = gcc
CFLAGS = -g -Wall -Wextra -g
OBJECTS = teste.o
INCFLAGS = -I usr/local/include
LDFLAGS = -Wl,-rpath,/usr/local/lib
LIBS = -allegro-5 -allegro_main-5 -allegro_font-5
all: teste
teste : $(OBJECTS)
$(CC) -o teste $(OBJECTS) $(LDFLAGS) $(LIBS)
.SUFFIXES:
.SUFFIXES: .c .cc .C .cpp .o
.c.o :
$(CC) -o $@ -c $(CFLAGS) $< $(INCFLAGS)
count:
wc *.c *.cc *.C *.cpp *.h *.hpp
clean:
rm -f *.o
.PHONY: all
.PHONY: count
.PHONY: clean
Você tem ajudado muito ! O que preciso é de algum aplicativo ou ferramenta que permita portar o código do Allegro 4 para o Allegro 5 ? O Allegro 5 é muito diferente do 4 que conheço bem, os programas foram escritos por volta de de 2010 e estou passado para a plataforma do iMac e estou apanhando bastante com o Allegro 5. Os programas funcionam bem no Linux com o Allegro 4 porém estou tendo dificuldades na portabilidade. Quando falo da ferramenta (se é que existe) é algo que possa me indicar o que mudou do código do 4 para o 5. Estou portando para a plataforma iMAc !
Agradeço !
https://github.com/liballeg/allegro_wiki/wiki/Installing-with-homebrew
It says allegro should be in /usr/local/include . (Note the leading /)
Mais uma vez obrigado ! Eu já havia corrigido e continua reclamando allegro5/allegro5.h not found ! Interessante é que em outros ela passa neste especificamente ele reclama !
A página indicada traz algo sobre algum recurso para o Allegro 4 portado para o allegro 5 ?
Okay, so you installed Allegro 5 using Homebrew?
And changed it to -I /usr/local/include?
The includes don't have any spaces.
#include <allegro5/allegro.h>
I don't know what else is wrong.
For help porting allegro 4 programs to allegro 5, see a4_aux.c and a4_aux.h in Allegro/demos/speed.
sim homebrew, tenho uma duvida o Allegro5 funciona no High Sierra ?
vou trocar o allegro5/allegro5.h para allegro.h !
Obrigado !
Por favor me ajude ! 45 anos de de programação ! Assembler, C , C++, e outras ! To apanhando como iniciante ! O mundo Apple é novidade para mim, estou gostando muito ! Abandonei o Windows ! É outra coisa, muito intuitivo ! Mas em certas coisas ainda estou aprendendo ! Eterno Aprendiz ! o Allegro 5 funciona no High Sierra ou vou ter que atualizar, esta dando problema na compilação com x86-64 !
jamdesalles - Allegro 5 may not be supported on High Sierra, so you may need to downgrade to Allegro 4. I can't find an answer on this.
It would probably be good to invest in newer hardware for a Mac. 2010 is pretty old and won't be supported by many people.
Meu iMac é 2017 !!!
Then why are you running High Sierra? 10.13
Desculpe é 2011 !
If High Sierra and your computer are both from 2017 then you should be able to install Homebrew, and then Allegro 5, like I said before.
Após apanhar muito consegui evoluir um pouco ! Agora está dando o seguinte problema, lembrando Allegro5 iMac com High Sierra :g++ -o bicho bicho.o -Wl,-rpath,/usr/local/lib -lallegro -lallegro_font -lallegro_main -lncurses -lmysqlclient
Undefined symbols for architecture x86_64:
"_al_show_native_message_box", referenced from:
_init in bicho.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bicho] Error 1
coloquei no CLANG = -v
You have to link to the native dialog addon. -lallegro_dialog
Sorry for lack of Portuguese. I would recommend using pkg-config (you may have it already or it's on homebrew). It will know which flags to apply to specify includes and libs (for things that homebrew installed). I would also use make's features a bit more, you don't have to tell it how to compile a c file, for example. I tested this on a Mac with MacOS Catalina.
Makefile:
CFLAGS = -g -Wall -Wextra `pkg-config --cflags allegro-5 allegro_main-5 allegro_font-5 allegro_dialog-5` OBJECTS = teste.o LDFLAGS = -g LDLIBS = `pkg-config --libs allegro-5 allegro_main-5 allegro_font-5 allegro_dialog-5` all: teste teste: $(OBJECTS) $(LINK.o) -o $@ $< $(LDLIBS) count: wc *.c *.cc *.C *.cpp *.h *.hpp clean: rm -f *.o teste .PHONY: all .PHONY: count .PHONY: clean
Also your source code is very strange and, I believe, not valid C. Did you run it through a language translator
Estranho como ? Não te passei o código fonte !
usei sua indicação , o resultado :MacBook-Air-de-User:bicho maphiaimac$ make
gcc -o bicho.o -c -g -Wall -Wextra `pkg-config --cflags allegro allego_main allegro_font allego_dialog` bicho.c -I /usr/local/include
Package allegro was not found in the pkg-config search path.
Perhaps you should add the directory containing `allegro.pc'
to the PKG_CONFIG_PATH environment variable
No package 'allegro' found
Package allego_main was not found in the pkg-config search path.
Perhaps you should add the directory containing `allego_main.pc'
to the PKG_CONFIG_PATH environment variable
No package 'allego_main' found
Package allegro_font was not found in the pkg-config search path.
Perhaps you should add the directory containing `allegro_font.pc'
to the PKG_CONFIG_PATH environment variable
No package 'allegro_font' found
Package allego_dialog was not found in the pkg-config search path.
Perhaps you should add the directory containing `allego_dialog.pc'
to the PKG_CONFIG_PATH environment variable
No package 'allego_dialog' found
bicho.c:65:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char *argv[])
^
bicho.c:65:26: warning: unused parameter 'argv' [-Wunused-parameter]
int main(int argc, char *argv[])
^
2 warnings generated.
gcc -o bicho bicho.o -Wl,-rpath,/usr/local/lib -lallegro -lallegro_font -lallegro_main -lncurses -lmysqlclient
Undefined symbols for architecture x86_64:
"_al_show_native_message_box", referenced from:
_init in bicho.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bicho] Error 1
From your post on 9th April:
Segue o programa e o Makefile
And your file "programa" is strange, for example if (( tipo de evento == ALLEGRO_EVENT_KEY_DOWN) || ( tipo de evento == ALLEGRO_EVENT_DISPLAY_CLOSE)) isn't valid C - my guess is that event.type got translated to tipo de evento? Anyway it doesn't matter. I hope that Makefile helps you.
Não ! este programa foi abandonado e estava usando o Allegro 4 ! Estou fazendo tudo outra vez em outro com o Allegro 5 ! Veja o resultado do Makefile que você sugeriu ! ele não encontra as bibliotecas ! Acho que não coloquei o nome correto , tentei usando todas com o -5 para identificar o Allegro5 e também deu o mesmo erro !
"Veja o resultado do Makefile que foi sugerido por voce" tem um tradutor ou corretor que altera o que eu escrevo, muito estranho !
Veja o resultado agora ! Corrigi o Makefile com o nome das bibliotecas e deu erro no x86_64 outra vez ! :gcc -o bicho bicho.o -Wl,-rpath,/usr/local/lib -lallegro -lallegro_font -lallegro_main -lncurses -lmysqlclient
Undefined symbols for architecture x86_64:
"_al_show_native_message_box", referenced from:
_init in bicho.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bicho] Error 1
Veja o Makefile completo :
CC = gcc
CLANG = -v
CFLAGS = -g -Wall -Wextra `pkg-config --cflags lallegro lallego_main lallegro_font lallego_dialog`
OBJECTS = bicho.o
INCFLAGS = -I /usr/local/include
LDFLAGS = -Wl,-rpath,/usr/local/lib
LIBS = -lallegro -lallegro_font -lallegro_main -lncurses -lmysqlclient
all: bicho
bicho: $(OBJECTS)
$(CC) -o bicho $(OBJECTS) $(LDFLAGS) $(LIBS)
.SUFFIXES:
.SUFFIXES: .c .cc .C .cpp .o
.c.o :
$(CC) -o $@ -c $(CFLAGS) $< $(INCFLAGS)
count:
wc *.c *.cc *.C *.cpp *.h *.hpp
clean:
rm -f *.o
.PHONY: all
.PHONY: count
.PHONY: clean
Por favor me da uma luz !!!!! To parado e meu cliente me cobrando muito ! diuturnamente ! continua o problema do x86_64 ! :
MacBook-Air-de-User:bicho maphiaimac$ make
gcc -o bicho bicho.o -Wl,-rpath,/usr/local/lib -lallegro -lallegro_font -lallegro_main -lncurses -lmysqlclient
Undefined symbols for architecture x86_64:
"_al_show_native_message_box", referenced from:
_init in bicho.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bicho] Error 1
Olha consegui evoluir ! já não da mais problema com x86-64 agora o problema é outro :
Segmentation fault: 11
nos testes que fiz isto acontece no :
video = al_create_display (1280, 1024);
ALLEGRO_DISPLAY *video = NULL;
HELP !!!!!!!
Por favor alguém me ajude !!!
A coisa evolui mas sempre acontece algo novo ! o Allegro 5 é muito diferente ! Agora :
bicho.c:89:32: error: expected parameter declarator
ALLEGRO_DISPLAY *video(1280,1024);
^
bicho.c:89:32: error: expected ')'
bicho.c:89:31: note: to match this '('
ALLEGRO_DISPLAY *video(1280,1024);
Segue o fonte !
#include<allegro5/allegro_font.h>
#include<allegro5/allegro_native_dialog.h>
#include<allegro5/allegro_image.h>
#include<allegro5/allegro_opengl.h>
#include<allegro5/blender.h>
#include<allegro5/allegro_audio.h>
#include<allegro5/drawing.h>
#include<allegro5/color.h>
#include<allegro5/bitmap.h>
#include<allegro5/bitmap_draw.h>
#include<allegro5/keyboard.h>
#include<allegro5/mouse.h>
#include<allegro5/keycodes.h>
#include<allegro5/display.h>
#include<allegro5/error.h>
#include<allegro5/events.h>
#include<time.h>
#include<ctype.h>
#include<errno.h>
#include<wchar.h>
#include<stdlib.h>
#include<string.h>
#include<ncurses.h>
#define FUNDO 1
void init(void); // inicia Allegro
void grid(void); // monta tela de apresentação
void shut(void); // shutdow do bicho
void faz_aposta(void); // faz aposta
void registra_aposta(void); // registra no banco aposta
void send_aposta(void); // envia aosta por e-mal pi umprime
void customer_write(void); // cadastra no banco cliente (nome ficticio) - leva banco, ag e conta
typedef struct ALLEGRO_DISPLAY *video;
char *dsp = ".." ;
// int *video = NULL;
int main(int argc, char *argv[])
{
system("clear");
init();
grid();
return(0);
}
void init (void)
{
printf("Criando video /n");
ALLEGRO_DISPLAY *video(1280,1024);
// ALLEGRO_DISPLAY *video = NULL;
printf("Criei video /n");
if(!al_init())
{
al_show_native_message_box(NULL, "Warning", "Error : ", "Allegro
wrong Initializtion",NULL,ALLEGRO_MESSAGEBOX_ERROR);
return ;
}
// video = al_create_display (1280, 1024);
if (!*video)
{
al_show_native_message_box(NULL, "Warning", "Error : ", "Video not
created",NULL,ALLEGRO_MESSAGEBOX_ERROR);
return ;
}
al_show_native_message_box(NULL, "Message", "Ok ! : ",
"Initialized",NULL,ALLEGRO_MESSAGEBOX_WARN);
al_rest(10);
return ;
}
Lembrar que existe um tradutor que altera o conteúdo de algumas linhas, por exemplo não é retorno e sim return e outras também o código esta certo , porem este tradutor não sei por que altera ! ^