|
Setup Allegro5 on Visual Studio Code on Mac |
Onewing
Member #6,152
August 2005
|
I was going to try out Visual Studio Code on Mac. I haven't really used it before...nor have I really used Allegro 5. It'd be fun to try these things out for the upcoming TINS competition in October. Of course, I wouldn't want to spend time during the competition learning how to use these things. Has anyone done this before? I did a search on the site and the googles, but didn't find anything, albeit only after about 5 minutes of searching. Thoughts on a starting place? ------------ |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I really have no clue what I'm talking about, but it should be as simple as installing Visual Studio code and the Allegro 5 Nuget package. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
SiegeLord
Member #7,827
October 2006
|
Probably not Nuget, as that's Windows-only at the moment. I guess you just install Allegro via homebrew and then do the usual linker options thing? "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Edgar Reynaldo
Major Reynaldo
May 2007
|
xD I told you I didn't know what I was talking about My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Onewing
Member #6,152
August 2005
|
I'm a bit stuck. VS Code takes some grunt work to get it going, but I finally got it to compile allegro 5 code, yay! Unfortunately, when I run it, al_init is returning a 1. Searching the forums, this seems to be a symptom of having different versions of allegro between compilation and headers (or something like that). I went to /usr/local/lib and moved files with "5.2.2" and "5.2" off to other folders (in case I need to move them back). Still no luck. Thoughts? Not sure if it will help, but here's my code and how I'm compiling it. 1#define ALLEGRO_NO_MAGIC_MAIN
2#include <allegro5/allegro.h>
3#include <iostream>
4using namespace std;
5
6int real_main(int argc, char **argv) {
7 if(al_init() != 0) {
8 return 1;
9 }
10
11 cout << "Hello world!" << endl;
12
13 return 0;
14}
15
16int main(int argc, char **argv) {
17 return al_run_main(argc, argv, real_main);
18}
Compile flags 1g++ -g helloworld.cpp -Wall -ansi -o test20.exe -L/usr/local/lib/ -I/usr/local/include/ -lallegro
------------ |
SiegeLord
Member #7,827
October 2006
|
lolz, you know when you're an old A4 programmer when you expect it to return 0 on success . al_init returns a boolean, true when everything worked, false when there was an error. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Onewing
Member #6,152
August 2005
|
Heh, it didn't even occur to me that the problem was in the code considering how much time I spent making VS Code do my bidding. Made the code change and it worked! FYI, is it just me or is every tutorial on this page running into an Internal Error? https://wiki.allegro.cc/index.php?title=Allegro_5_API_Tutorials ------------ |
|