Author Topic: Where are the standard libraries?!(and other questions)  (Read 8508 times)

Offline kingcools

  • Single posting newcomer
  • *
  • Posts: 9
Where are the standard libraries?!(and other questions)
« 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 :)

« Last Edit: March 16, 2011, 02:00:41 am by kingcools »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Where are the standard libraries?!(and other questions)
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Where are the standard libraries?!(and other questions)
« Reply #2 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).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline kingcools

  • Single posting newcomer
  • *
  • Posts: 9
Re: Where are the standard libraries?!(and other questions)
« Reply #3 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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Where are the standard libraries?!(and other questions)
« Reply #4 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.

Offline kingcools

  • Single posting newcomer
  • *
  • Posts: 9
Re: Where are the standard libraries?!(and other questions)
« Reply #5 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

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: Where are the standard libraries?!(and other questions)
« Reply #6 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"