Including libraries oddity

support for the ARM toolchain
Post Reply
Searinox
Posts: 10
Joined: Sun Sep 26, 2010 10:23 pm

Including libraries oddity

Post by Searinox » Sun Sep 26, 2010 10:34 pm

I'm trying to put together a small app no bigger than 57 lines which basically slaps on a frame then boots in GBA mode. I got the code from the woodrpg/acekard source. Anyway, I'm having an issue with compiling the project.

The project #included an in-folder file called "bmp15.h" and this file in turn has two odd includes...

#include <memory>
#include <string>

When I try to compile this package I am told that memory and string cannot be found. And indeed they are not in devkitarm\arm-eabi\include instead they are in devkitarm\arm-eabi\include\c++\4.5.0. I tried to copy them into the include folder and they pointed to yet even more files from the bits folder. I copied that aswell and in turn was asked for more files which were found in the c++\4.5.0\arm-eabi\bits folder.

Upon furfilling all these requests I am bombarded with some 100 compile errors, not from the sourcecode, but the libraries themselves. What's more projects that would compile in the past now also give errors and it's all looking like I just screwed up my toolchain. Not to worry, I had a backup made before I started moving libraries!

But the point remains... I can't satisfy the #include <memory> #include <string> requests by default without tampering with the library. You'd think it should be able to find them by default... So what do I do? How do I deal with these includes?

StevenH
Posts: 133
Joined: Sun Feb 22, 2009 7:59 pm

Re: Including libraries oddity

Post by StevenH » Sun Sep 26, 2010 11:20 pm

Short answer:

Those two include files are for C++ only, are you compiling a .c file or a .cpp file?

Your source files will have to be .cpp to include <memory> and <string>

Searinox
Posts: 10
Joined: Sun Sep 26, 2010 10:23 pm

Re: Including libraries oddity

Post by Searinox » Sun Sep 26, 2010 11:34 pm

Thank you! That did indeed fix it!

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests