So I've created a mini personal library containing a bunch of files which have a bunch of methods relating to a specific topic (e.g. string manipulation, math, time, etc.). This is what the, for the lack of a better term, main container file looks like:
#include <iostream>
#include <fstream>
#include <conio.h> //_getch() ("Pauses" the program)
#include <stdlib.h> //atoi (Converts string to integer)
#include <io.h>
#include <stdio.h>
#include <vector>
#include <string> //I have also tried including cstring and string.h, but that didn't help
#include <sstream>
#include <windows.h>
#include <ctime>
#include <math.h>
#include <cmath>
#include <algorithm>
#include "SDL2/SDL.h"
#include "SDL2/SDL_ttf.h"
#include "numbers.cpp"
#include "strings.cpp"
#include "time.cpp"
#include "SDL.cpp"
#include "console.cpp"
#include "files.cpp"
In case anyone's unable to tell, all of the files I made is everything below and including numbers.cpp. The rest are C++ libraries or the 2 SDL files in the middle.
std::string works in all of the files up to console.cpp. There any std::string, whether it be an argument, variable of function declaration, gives me the 'string is not a member of std' error. If I exclude console.cpp from my build targets and project, files.cpp has the same error whenever I try to use std::string. But if I put SDL.cpp, for example, after console.cpp and before files.cpp, its std::strings work fine.
None of the files have any #include in them except SDL.cpp, which only includes some header files which also don't have any include files
I guess it might be important that I do have the following in my compiler linker options:
-lmingw32 -lSDL2main -lSDL2 -lSDL2_ttf
I also have a search directory to the SDL2 include folder, but I don't think that that is the issue. The build type is Static Library (That may be the problem, but it also has the same issues when I build as GUI application, dynamic library or native. I don't know much about build types, fairly new to C++) and I'm using the Code Blocks IDE.
I've already searched for a solution in other similar questions, but all those just forgot to either include string or put it in the wrong place... Thanks in advance for your help, and apologies for the lengthy question and if I've left out any important information.