Aug 29, 2017 at 3:38pm Aug 29, 2017 at 3:38pm UTC
Undefined reference means the linker cannot find the function you're trying to call. Not the compiler. The linker.
When trying to use functions from an external library (as you are), it means you haven't told it what libraries to link against.
You need to tell your linker what allegro libraries to link against. I'm guessing you're using windows. How are you building your code?
Aug 29, 2017 at 3:46pm Aug 29, 2017 at 3:46pm UTC
I'm using windows indeed. I'm using DevC++ and I just hit the compile button. In the compiler options I have added the allegro/bin to "binaries", allegro/lib to "libraries", and allegro/include to "C++ includes". I guess I have to add other directories too, but I have no clue which ones.
Last edited on Aug 29, 2017 at 3:57pm Aug 29, 2017 at 3:57pm UTC
Aug 29, 2017 at 4:29pm Aug 29, 2017 at 4:29pm UTC
It's not enough to tell it which directory the libraries are in. You also have to tell it which specific library files to link against.
Aug 29, 2017 at 5:05pm Aug 29, 2017 at 5:05pm UTC
So if I get this correct, I need to add all the files in my allegro/lib folder to the linker command?
Sorry for asking so many questions, but this is my first time using a 3rd party library and I'm having alot of trouble getting it to work.
Last edited on Aug 29, 2017 at 5:09pm Aug 29, 2017 at 5:09pm UTC