Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: kingcools on March 16, 2011, 01:54:55 am

Title: Where are the standard libraries?!(and other questions)
Post by: kingcools on March 16, 2011, 01:54:55 am
Hello, im starting to believe i didnt build codeblocks properly(running windows vista btw):

I installed this version of codeblocks "http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/codeblocks-10.05mingw-setup.exe/download", but somewhat it lacks many standard libraries(right now im missing fstream.h and vector.h).
what do i have to do to build codeblocks properly?

thank you :)

Title: Re: Where are the standard libraries?!(and other questions)
Post by: stahta01 on March 16, 2011, 02:10:54 am
Your question does NOT make sense to me.

My standard request below:
Turn on Full Compiler Logging and see if the build log has any problems/information.
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Tim S.
Title: Re: Where are the standard libraries?!(and other questions)
Post by: oBFusCATed on March 16, 2011, 08:35:50 am
Then next standard answer: migrate to c++ of today, c++98/03/0x, not the one used in the nighties (before 98)...
Also search your harddrive for the files, to see if they can be found anywhere on it (especially in your compilers subdirectories).
Title: Re: Where are the standard libraries?!(and other questions)
Post by: kingcools on March 16, 2011, 11:58:20 am
i already searched my hard drive for these files and found them, but when I use them the compiler gives out alot(!) of errors concerning these files.
The MinGW include folder does not contain most of the standard libraries(it does have stdio.h though)

as far as i know c++0x isnt even finished yet and this would be a work around and not a solution to my problem.

Here is a part of the code im working on:

Code
#ifndef PALETTE_H
#define PALETTE_H

#include <fstream>
#include <vector>
#include "D:\Programmieren\CodeBlocks\Projekte\Sffdatei\Sff2allegro\sff2_structs.h"

class palette
{
    public:
    palette(ifstream& filepointer,sff2header head);
    palheader palhead;

    bool error;
    bool loaded;

    private:
    vector<RGB> data;

    void load(ifstream&,palheader,unsigned int);
};


#endif // PALETTE_H

here the build log:
Code
D:\Programmieren\CodeBlocks\Projekte\Sff_test\include\palette.h:20: error: 'ifstream' has not been declared
D:\Programmieren\CodeBlocks\Projekte\Sff_test\src\palette.cpp:3: error: expected ')' before '&' token
D:\Programmieren\CodeBlocks\Projekte\Sff_test\src\palette.cpp:16: error: variable or field 'load' declared void
D:\Programmieren\CodeBlocks\Projekte\Sff_test\src\palette.cpp:16: error: 'ifstream' was not declared in this scope
D:\Programmieren\CodeBlocks\Projekte\Sff_test\src\palette.cpp:16: error: 'filepointer' was not declared in this scope
D:\Programmieren\CodeBlocks\Projekte\Sff_test\src\palette.cpp:16: error: expected primary-expression before 'palhead'
D:\Programmieren\CodeBlocks\Projekte\Sff_test\src\palette.cpp:16: error: expected primary-expression before 'unsigned'

I checked the include folder and it DOES NOT contain fstream.h or vector.h.
I tried using a different one but then i get even more errors.
Title: Re: Where are the standard libraries?!(and other questions)
Post by: Jenna on March 16, 2011, 12:10:12 pm
I checked the include folder and it DOES NOT contain fstream.h or vector.h.
That's because they are named fstream and vector without the extension !!

Your problem is not C::B related, not even compiler related, it's just a simple programming error:

either add "using namespace std;" or use "std::ifstream" etc.
Title: Re: Where are the standard libraries?!(and other questions)
Post by: kingcools on March 16, 2011, 01:05:56 pm
true, haha, i just started c++ again after a few months breaks and i just forgot that :D

that fixed it for now, thank you
Title: Re: Where are the standard libraries?!(and other questions)
Post by: ptDev on March 16, 2011, 08:20:03 pm
Here is a part of the code im working on:

Code
#include "D:\Programmieren\CodeBlocks\Projekte\Sffdatei\Sff2allegro\sff2_structs.h"


In addition, you might want to add ""D:\Programmieren\CodeBlocks\Projekte\Sffdatei\Sff2allegro" to your project's list of "include" directories. If you do that, you can simply write
Code
#include "sff2_structs.h"