std::ifstream eclipse and Win32

Hi,

I'm using eclipse + boost + mode -std = c ++ 11, but the compiler gives me error, this program works properly on linux but I need to compile it on Windows XP.

I appreciate your help.

vector<Buffer> desempaquetar (Path const& fname, Path const& dname) {
std::ifstream f(fname.c_str(), std::ios::binary);
ifbuf wr(f);
auto parts = get_fabs(wr);
int i = 0;
for (auto & p: parts) {
------

Error:
void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]

Greetings.
Please copy and paste the exact error message in full and indicate which line it is on.

Thanks for your reply, the error is in the lines.

std :: ifstream f (fname.c_str (), std :: ios :: binary);
std :: ofstream f (save_to.c_str (), std :: ios :: binary);


vector<Buffer> desempaquetar(Path const& fname, Path const& dname) {

std::ifstream f(fname.c_str(), std::ios::binary);
ifbuf wr(f);
auto parts = get_descomprimir(wr);

int i = 0;
for (auto & p: parts) {
Path save_to = dname/Path(format("part%||.b", i));
std::ofstream f(save_to.c_str(), std::ios::binary);
f.write(reinterpret_cast<char*>(&p[0]), p.size());
f.close();

++i;
}

return parts;
}

..\src\unmadspack.cpp:455:45: note: candidates are:
In file included from ..\src\unmadspack.cpp:3:0:
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:486:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const std::string& __s,
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:486:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const string& {aka const std::basic_string<char>&}'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:470:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:470:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const char*'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:456:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]
basic_ifstream() : __istream_type(), _M_filebuf()
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:456:7: note: candidate expects 0 arguments, 1 provided
..\src\unmadspack.cpp: In function 'std::vector<std::vector<unsigned char> > desempaquetar(const Path&, const Path&)':
..\src\unmadspack.cpp:601:49: error: no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(const value_type*, const openmode&)'
std::ifstream f(fname.c_str(), std::ios::binary);
^
..\src\unmadspack.cpp:601:49: note: candidates are:
In file included from ..\src\unmadspack.cpp:3:0:
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:486:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const std::string& __s,
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:486:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const string& {aka const std::basic_string<char>&}'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:470:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:470:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const char*'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:456:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]
basic_ifstream() : __istream_type(), _M_filebuf()
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:456:7: note: candidate expects 0 arguments, 2 provided
..\src\unmadspack.cpp:610:53: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(const value_type*, const openmode&)'
std::ofstream f(save_to.c_str(), std::ios::binary);
^
..\src\unmadspack.cpp:610:53: note: candidates are:
In file included from ..\src\unmadspack.cpp:3:0:
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:661:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ofstream(const std::string& __s,
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:661:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const string& {aka const std::basic_string<char>&}'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:643:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ofstream(const char* __s,
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:643:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const char*'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:628:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]
basic_ofstream(): __ostream_type(), _M_filebuf()
Last edited on
You are still only pasting the end of the error, copy and paste from the very beginning.
Sorry but the forum will not let me copy all of eclipse console:

Part 1:


**** Build of configuration Default for project cc94-cc94 ****

**** Internal Builder is used for build ****
**** WARNING: The "Default" Configuration may not build ****
**** because it uses the "cdt.managedbuild.toolchain.gnu.mingw.base" ****
**** tool-chain that is unsupported on this system. ****

**** Attempting to build... ****

g++ -std=c++11 -IC:\cc94-cc94\inc -IC:\cc94-cc94\src\lodepng -IC:\Sofware\SFML-2.2\include\SFML -O2 -g -Wall -c -fmessage-length=0 -osrc\unmadspack.o ..\src\unmadspack.cpp
..\src\unmadspack.cpp: In function 'std::vector<std::vector<unsigned char> > get_fabs(ifbuf&)':
..\src\unmadspack.cpp:360:8: warning: unused variable 'hash_' [-Wunused-variable]
auto hash_ = read_uint16(read<2>(iheader));
^
..\src\unmadspack.cpp: In function 'void save_png(const Path&, Image&, uint, uint, bool)':
..\src\unmadspack.cpp:397:115: error: no matching function for call to 'encode(const value_type*, const uint8*, uint&, uint&)'
unsigned error = lodepng::encode(filename.c_str(), reinterpret_cast<uint8 const*>(&image.data[0]), width, height);
^
..\src\unmadspack.cpp:397:115: note: candidates are:
In file included from ..\src\unmadspack.cpp:12:0:
C:\cc94-cc94\src\lodepng/lodepng.h:220:10: note: unsigned int lodepng::encode(std::vector<unsigned char>&, const unsigned char*, unsigned int, unsigned int, LodePNGColorType, unsigned int)
unsigned encode(std::vector<unsigned char>& out,
^
C:\cc94-cc94\src\lodepng/lodepng.h:220:10: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'std::vector<unsigned char>&'
C:\cc94-cc94\src\lodepng/lodepng.h:223:10: note: unsigned int lodepng::encode(std::vector<unsigned char>&, const std::vector<unsigned char>&, unsigned int, unsigned int, LodePNGColorType, unsigned int)
unsigned encode(std::vector<unsigned char>& out,
^
C:\cc94-cc94\src\lodepng/lodepng.h:223:10: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'std::vector<unsigned char>&'
C:\cc94-cc94\src\lodepng/lodepng.h:232:10: note: unsigned int lodepng::encode(const string&, const unsigned char*, unsigned int, unsigned int, LodePNGColorType, unsigned int)
unsigned encode(const std::string& filename,
^
C:\cc94-cc94\src\lodepng/lodepng.h:232:10: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const string& {aka const std::basic_string<char>&}'
C:\cc94-cc94\src\lodepng/lodepng.h:235:10: note: unsigned int lodepng::encode(const string&, const std::vector<unsigned char>&, unsigned int, unsigned int, LodePNGColorType, unsigned int)
unsigned encode(const std::string& filename,
^
C:\cc94-cc94\src\lodepng/lodepng.h:235:10: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const string& {aka const std::basic_string<char>&}'
C:\cc94-cc94\src\lodepng/lodepng.h:833:10: note: unsigned int lodepng::encode(std::vector<unsigned char>&, const unsigned char*, unsigned int, unsigned int, lodepng::State&)
unsigned encode(std::vector<unsigned char>& out,
^
C:\cc94-cc94\src\lodepng/lodepng.h:833:10: note: candidate expects 5 arguments, 4 provided
C:\cc94-cc94\src\lodepng/lodepng.h:836:10: note: unsigned int lodepng::encode(std::vector<unsigned char>&, const std::vector<unsigned char>&, unsigned int, unsigned int, lodepng::State&)
unsigned encode(std::vector<unsigned char>& out,
^
C:\cc94-cc94\src\lodepng/lodepng.h:836:10: note: candidate expects 5 arguments, 4 provided
..\src\unmadspack.cpp: In function 'Pallete get_default_pallete(const Path&)':
..\src\unmadspack.cpp:455:45: error: no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(const value_type*)'
std::ifstream f((dir/"VICEROY.PAL").c_str());
Part 2:

..\src\unmadspack.cpp:455:45: note: candidates are:
In file included from ..\src\unmadspack.cpp:3:0:
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:486:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const std::string& __s,
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:486:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const string& {aka const std::basic_string<char>&}'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:470:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:470:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const char*'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:456:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]
basic_ifstream() : __istream_type(), _M_filebuf()
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:456:7: note: candidate expects 0 arguments, 1 provided
..\src\unmadspack.cpp: In function 'std::vector<std::vector<unsigned char> > desempaquetar(const Path&, const Path&)':
..\src\unmadspack.cpp:601:49: error: no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(const value_type*, const openmode&)'
std::ifstream f(fname.c_str(), std::ios::binary);
^
..\src\unmadspack.cpp:601:49: note: candidates are:
In file included from ..\src\unmadspack.cpp:3:0:
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:486:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const std::string& __s,
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:486:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const string& {aka const std::basic_string<char>&}'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:470:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:470:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const char*'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:456:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]
basic_ifstream() : __istream_type(), _M_filebuf()
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:456:7: note: candidate expects 0 arguments, 2 provided
..\src\unmadspack.cpp:610:53: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(const value_type*, const openmode&)'
std::ofstream f(save_to.c_str(), std::ios::binary);
^
..\src\unmadspack.cpp:610:53: note: candidates are:
In file included from ..\src\unmadspack.cpp:3:0:
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:661:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ofstream(const std::string& __s,
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:661:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const string& {aka const std::basic_string<char>&}'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:643:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ofstream(const char* __s,
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:643:7: note: no known conversion for argument 1 from 'const value_type* {aka const wchar_t*}' to 'const char*'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:628:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]
basic_ofstream(): __ostream_type(), _M_filebuf()
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:628:7: note: candidate expects 0 arguments, 2 provided
..\src\unmadspack.cpp: In function 'void unpack(const Path&)':
..\src\unmadspack.cpp:655:39: error: 'unpack_mads' was not declared in this scope
auto parts = unpack_mads(fname, dname);
^
Build error occurred, build is stopped
Time consumed: 4407 ms.


Well, the full log as you can see has more errors but I think they are all for the same reason.
Last edited on
raulpuro wrote:
g++ -std=c++11 -IC:\cc94-cc94\inc -IC:\cc94-cc94\src\lodepng -IC:\Sofware\SFML-2.2\include\SFML -O2 -g -Wall -c -fmessage-length=0 -osrc\unmadspack.o ..\src\unmadspack.cpp
..\src\unmadspack.cpp: In function 'std::vector<std::vector<unsigned char> > get_fabs(ifbuf&)':
..\src\unmadspack.cpp:360:8: warning: unused variable 'hash_' [-Wunused-variable]
auto hash_ = read_uint16(read<2>(iheader));
^
..\src\unmadspack.cpp: In function 'void save_png(const Path&, Image&, uint, uint, bool)':
..\src\unmadspack.cpp:397:115: error: no matching function for call to 'encode(const value_type*, const uint8*, uint&, uint&)'
unsigned error = lodepng::encode(filename.c_str(), reinterpret_cast<uint8 const*>(&image.data[0]), width, height);
^
..\src\unmadspack.cpp:397:115: note: candidates are:
Show how encode is declared.
Hi,

Well, this is not a project made for me, i'm trying to adapt him to decode a game, i deleted the file osdep.h, i did not know how to adapt the file osdep.h to windows and thought it was not important ... but in linux operating properly. The creator does not offer support.

File osdep.h original

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include <string>

inamespace os{

	inline std::string get_home_dir() {
		struct passwd *pw = getpwuid(getuid());

		const char *homedir = pw->pw_dir;

		return std::string(homedir);
	}
}


File osdep.h changed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*#include <X11/Xlib.h>  // XInitThreads
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include <string>


namespace os{

	inline std::string get_home_dir() {
		struct passwd *pw = getpwuid(getuid());

		const char *homedir = pw->pw_dir;

		return std::string(homedir);
	}

}*/


File lodepng.cpp

https://gitorious.org/cc94/cc94/source/9f326bfb598c0a36631c306e16159f380c2d606e:src/lodepng/lodepng.h#L5


1
2
3
4
5
6
7
8
9
10
11
12
void save_png(Path const& filename, Image & image, uint width, uint height, bool overwrite=false)
{

	bool exist = boost::filesystem::exists(filename);

	if (overwrite or !exist) {
		unsigned error = lodepng::encode(filename.c_str(), reinterpret_cast<uint8 const*>(&image.data[0]), width, height);
		if (error) {
			throw Error("lodepng encoder error %||: $||", error, lodepng_error_text(error));
		}
	}
}


Well, if i change the conversion to string, that part compiles but does not understand why it works on linux and xp no.

1
2
3
4
5
6
7
8
9
10
11
12
void save_png(Path const& filename, Image & image, uint width, uint height, bool overwrite=false)
{

	bool exist = boost::filesystem::exists(filename);

	if (overwrite or !exist) {
		unsigned error = lodepng::encode(filename.string(), reinterpret_cast<uint8 const*>(&image.data[0]), width, height);
		if (error) {
			throw Error("lodepng encoder error %||: $||", error, lodepng_error_text(error));
		}
	}
}



P.D. Now I get an error on line std::ifstream f((dir/"pal.PAL"));

1
2
3
4
5
6
7
8
9
10
11
12
13
Pallete get_default_pallete(Path const& fname) {

	auto dname = get_dname("pal.PAL");

	auto dir = fname.parent_path();

	std::ifstream f((dir/"pal.PAL"));
	ifbuf wr(f);

	//imbuf wr2(read_buf(wr, 256*3));

	return read_pallete(wr, dname);
}


**** Build of configuration Default for project cc94-cc94 ****

**** Internal Builder is used for build ****
**** WARNING: The "Default" Configuration may not build ****
**** because it uses the "cdt.managedbuild.toolchain.gnu.mingw.base" ****
**** tool-chain that is unsupported on this system. ****

**** Attempting to build... ****

g++ -std=c++11 -IC:\cc94-cc94\inc -IC:\cc94-cc94\src\lodepng -IC:\Sofware\SFML-2.2\include\SFML -O2 -g -Wall -c -fmessage-length=0 -osrc\unmadspack.o ..\src\unmadspack.cpp
..\src\unmadspack.cpp: In function 'std::vector<std::vector<unsigned char> > get_descomprimir(ifbuf&)':
..\src\unmadspack.cpp:360:8: warning: unused variable 'hash_' [-Wunused-variable]
auto hash_ = read_uint16(read<2>(iheader));
^
..\src\unmadspack.cpp: In function 'Pallete get_default_pallete(const Path&)':
..\src\unmadspack.cpp:454:33: error: no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(boost::filesystem::path)'
std::ifstream f((dir/"pal.PAL"));
^
..\src\unmadspack.cpp:454:33: note: candidates are:
In file included from ..\src\unmadspack.cpp:3:0:
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:486:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const std::string& __s,
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:486:7: note: no known conversion for argument 1 from 'boost::filesystem::path' to 'const string& {aka const std::basic_string<char>&}'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:470:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:470:7: note: no known conversion for argument 1 from 'boost::filesystem::path' to 'const char*'
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:456:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]
basic_ifstream() : __istream_type(), _M_filebuf()
^
C:/Archivos de programa/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/i686-w64-mingw32/include/c++/fstream:456:7: note: candidate expects 0 arguments, 1 provided
Build error occurred, build is stopped
Time consumed: 3000 ms.

Greetings.
Last edited on
I don't understand how your most recent post relates to my question?
Last edited on
Hi,

You ask me where encode is Declared? well this is the link of the class.

https://gitorious.org/cc94/cc94/source/9f326bfb598c0a36631c306e16159f380c2d606e:src/lodepng/lodepng.h#L5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
unsigned encode(std::vector<unsigned char>& out,
                const std::vector<unsigned char>& in, unsigned w, unsigned h,
                LodePNGColorType colortype, unsigned bitdepth)
{
  if(lodepng_get_raw_size_lct(w, h, colortype, bitdepth) > in.size()) return 84;
  return encode(out, in.empty() ? 0 : &in[0], w, h, colortype, bitdepth);
}

unsigned encode(std::vector<unsigned char>& out,
                const unsigned char* in, unsigned w, unsigned h,
                State& state)
{
  unsigned char* buffer;
  size_t buffersize;
  unsigned error = lodepng_encode(&buffer, &buffersize, in, w, h, &state);
  if(buffer)
  {
    out.insert(out.end(), &buffer[0], &buffer[buffersize]);
    lodepng_free(buffer);
  }
  return error;
}

unsigned encode(std::vector<unsigned char>& out,
                const std::vector<unsigned char>& in, unsigned w, unsigned h,
                State& state)
{
  if(lodepng_get_raw_size(w, h, &state.info_raw) > in.size()) return 84;
  return encode(out, in.empty() ? 0 : &in[0], w, h, state);
}

#ifdef LODEPNG_COMPILE_DISK
unsigned encode(const std::string& filename,
                const unsigned char* in, unsigned w, unsigned h,
                LodePNGColorType colortype, unsigned bitdepth)
{
  std::vector<unsigned char> buffer;
  unsigned error = encode(buffer, in, w, h, colortype, bitdepth);
  if(!error) save_file(buffer, filename);
  return error;
}

unsigned encode(const std::string& filename,
                const std::vector<unsigned char>& in, unsigned w, unsigned h,
                LodePNGColorType colortype, unsigned bitdepth)
{
  if(lodepng_get_raw_size_lct(w, h, colortype, bitdepth) > in.size()) return 84;
  return encode(filename, in.empty() ? 0 : &in[0], w, h, colortype, bitdepth);
}


But that part now works using filename.string ()

Sorry my English is very poor.

Thanks.
Last edited on
Topic archived. No new replies allowed.