Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » memory.h problem

Credits go to SiegeLord for helping out!
This thread is locked; no one can reply to it. rss feed Print
memory.h problem
imdannow12
Member #16,404
June 2016

I have problem compiling a project. The error is in Allegro 5 library of the header memory.h and I cannot debug it.:'(
I'm Code::Blocks IDE in Linux OS. Some of the errors are listed below:

#SelectExpand
1||=== Build: Release in live-studio-sessions-0.1 (compiler: GNU GCC Compiler) ===| 2/usr/include/allegro5/memory.h|35|error: unknown type name al_set_memory_interface| 3/usr/include/allegro5/memory.h|35|error: expected declaration specifiers or ... before ( token| 4/usr/include/allegro5/memory.h|59|error: unknown type name al_malloc_with_context| 5/usr/include/allegro5/memory.h|59|error: expected declaration specifiers or ... before ( token| 6/usr/include/allegro5/memory.h|61|error: unknown type name al_free_with_context| 7/usr/include/allegro5/memory.h|61|error: expected declaration specifiers or ... before ( token| 8/usr/include/allegro5/memory.h|63|error: unknown type name al_realloc_with_context| 9/usr/include/allegro5/memory.h|63|error: expected declaration specifiers or ... before ( token| 10/usr/include/allegro5/memory.h|65|error: unknown type name al_calloc_with_context| 11/usr/include/allegro5/memory.h|65|error: expected declaration specifiers or ... before ( token| 12/home/imdan/Desktop/live-studio-sessions-0.1/src/rtk/midi.c||In function rtk_load_midi:| 13/home/imdan/Desktop/live-studio-sessions-0.1/src/rtk/midi.c|485|warning: ignoring return value of fread, declared with attribute warn_unused_result [-Wunused-result]| 14/home/imdan/Desktop/live-studio-sessions-0.1/src/rtk/midi.c|511|warning: ignoring return value of fread, declared with attribute warn_unused_result [-Wunused-result]| 15||=== Build failed: 10 error(s), 2 warning(s) (0 minute(s), 0 second(s)) ===|

I'll be thankful for your reply regarding this issue. I am using Allegro 5.2 as my library.

SiegeLord
Member #7,827
October 2006
avatar

Are you including memory.h directly? If so, then you shouldn't, as it's meant to be included by `allegro.h' header.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

OnlineCop
Member #7,919
October 2006
avatar

Please edit your original post. Wrap all your code in <code>...</code> tags (click "Formatting Help" to see the exact syntax). It will make reading the code easier.

I made a VR game!

imdannow12
Member #16,404
June 2016

Thanks a lot SiegeLord. As I check my code I see that it includes memory.h,it helps a lot. Sorry for my bad post about my codes. I don't know how to post a right and readable code. I am new here. Thanks a lot for the advise ;D

Go to: