Closed Drakonas closed 13 years ago
The bug is in your code, not mine. You need to resolve the ambiguity on line pigmap.cpp:382 by explicitly casting your time_t to either int or int64_t.
Here are some good resources for learning C++: http://www.cplusplus.com/
P.S. Github has a useful tool called "blame" for determining which code is yours and which comes from upstream. If you view a source file, there's a "blame" button at the top-right of the file, on the same line as the file size/line count; clicking this will show you which commit every line of code came from.
Uh, just realized that the code you're compiling isn't even in your repo, so that last comment isn't useful. Git itself also has "blame", of course, so you can use it on your working copy. Here are the instructions:
http://www.kernel.org/pub/software/scm/git/docs/git-blame.html
Hmm.. Ok, I forgot I had some changes with my pigmap. I apologize for that.
Thanks for the help. I can take care of it then.
I stashed my changes to try and fix it (first post), and returned to where I was with the error on compiling. I explicitely casted the returned time_t value to int, with luck on compiling, but I still get the same error when running pigmap. I'm going to contact Billiam, and see if I can figure out what's wrong. He is the one I got the other pieces of code from.
bad_alloc is thrown when new (or new[]) can't allocate the requested amount of memory. The most likely causes are:
Server output: g++ -c pigmap.cpp -O3 In file included from blockimages.h:23, from pigmap.cpp:45: rgba.h:91:17: warning: no newline at end of file In file included from pigmap.cpp:45: blockimages.h:189:24: warning: no newline at end of file In file included from pigmap.cpp:47: map.h:331:16: warning: no newline at end of file In file included from pigmap.cpp:49: tables.h:376:19: warning: no newline at end of file In file included from chunk.h:28, from pigmap.cpp:50: region.h:100:19: warning: no newline at end of file In file included from pigmap.cpp:50: chunk.h:154:18: warning: no newline at end of file In file included from pigmap.cpp:51: render.h:210:19: warning: no newline at end of file In file included from pigmap.cpp:52: world.h:69:18: warning: no newline at end of file pigmap.cpp: In function âvoid writeHTML(const RenderJob&, const std::string&)â: pigmap.cpp:382: error: call of overloaded âtostring(time_t)â is ambiguous utils.h:71: note: candidates are: std::string tostring(int) utils.h:72: note: std::string tostring(int64_t) make: *\ [pigmap.o] Error 1
I was able to get it to compile by commenting out line 72 of utils.h, except it has a runtime error when trying to generate tiles: [*]/pigmap/terrain/blocks-6.png is missing some blocks; will try to fill them in from terrain.png region-format world detected processing regionlist... rendering tiles... single thread will render 776 base tiles terminate called after throwing an instance of 'std::bad_alloc' what(): St9bad_alloc
This needs to be fixed. I don't think anybody is able to use pigmap at this point, but I'm not sure why I haven't heard anything about it.
Thanks in advance, Drakonas