Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make #73

Open
comword opened this issue Apr 6, 2014 · 5 comments
Open

Can't make #73

comword opened this issue Apr 6, 2014 · 5 comments

Comments

@comword
Copy link

comword commented Apr 6, 2014

g++ -O3 -c item.cpp -o obj/item.o
item.cpp: In member function ‘std::string item::info(bool)’:
item.cpp:282:43: error: ‘struct it_comest’ has no member named ‘health’
"\n Healthiness: " << int(food->health);
^

make: *** [obj/item.o] Error 1

this is what i get.How to solve it?

@Whales
Copy link
Owner

Whales commented Apr 6, 2014

Unfortunately, since I was replacing my old hard drive with a new one, I
had to do one last commit of Cataclysm - in a non-working state. I'd try
pulling one or two commits before the latest one. One of those should
compile!

On Sun, Apr 6, 2014 at 2:10 PM, Henorvell Ge [email protected]:

g++ -O3 -c item.cpp -o obj/item.o
item.cpp: In member function 'std::string item::info(bool)':
item.cpp:282:43: error: 'struct it_comest' has no member named 'health'
"\n Healthiness: " << int(food->health);
^
make: *** [obj/item.o] Error 1

this is what i get.How to solve it?

Reply to this email directly or view it on GitHubhttps://github.com//issues/73
.

@vitruvianjew
Copy link

I got it to work.

First bug: line 282 of item.cpp. Add the letter y to the end of the world health.

Here's the relevant compilation message, not sure how to put it in a code tag on github:
item.cpp: In member function ‘std::string item::info(bool)’:
item.cpp:282:43: error: ‘struct it_comest’ has no member named ‘health’
"\n Healthiness: " << int(food->health);
^
make: *** [obj/item.o] Error 1

To fix the second bug, I commented out line 314 of iuse.cpp.

g++ -O3 -c iuse.cpp -o obj/iuse.o
iuse.cpp: In member function ‘void iuse::vitamins(game_, player_, item_, bool)’:
iuse.cpp:314:77: error: ‘add_msg’ was not declared in this scope
add_msg("You have the feeling that these vitamins won't do you any good.");
^
make: *_* [obj/iuse.o] Error 1

Third bug is a set of bugs with map.cpp.

g++ -O3 -c map.cpp -o obj/map.o
map.cpp: In member function ‘bool map::sees(int, int, int, int, int, int&)’:
map.cpp:1923:15: error: ‘x’ was not declared in this scope
if (!trans(x, y))
^
map.cpp:1935:1: error: expected primary-expression before ‘bool’
bool map::sees(int Fx, int Fy, int Tx, int Ty, int range, int &tc)
^
map.cpp:2432:1: error: expected ‘,’ or ‘;’ at end of input
}
^
map.cpp:2432:1: error: expected ‘}’ at end of input
map.cpp:2432:1: error: expected ‘}’ at end of input
make: *** [obj/map.o] Error 1

@wolfen351
Copy link

wolfen351 commented Feb 16, 2018

So how did you fix the 3rd set of bugs? - looking at the code i guess you could just comment that whole function?

@derpkerk
Copy link

derpkerk commented Sep 20, 2018

im working on it and it's not the whole last block from 1935 as id hoped. literally the functions where the errors happen. is what the previousposters meant I believe.
Edit:
Solved the Wreturn errors that happened by inserting "return 0;"
I'm left with backwards compat issues. I'm new to compiling so will update this.

@flitvious
Copy link

My take on the compilation errors. I'll leave it here for anyone trying to compile Cataclysm.

Error 1: iuse.cpp:314:77: error: ‘add_msg’ was not declared in this scope
Solution: iuse.cpp, line 314, replace add_msg with g->add_msg.

Error 2: item.cpp:282:43: error: ‘struct it_comest’ has no member named ‘health’; did you mean ‘healthy’?
Solution: item.cpp, line 282, replace health with healthy.

Error 3: game.h:56:8: error: invalid initialization of non-const reference of type ‘calendar&’ from an rvalue of type ‘calendar’
Solution: Comment-out or delete the whole operator thing because it's not used anywhere else. Maybe it can be fixed some other way, but this seems to work fine.
calendar.h, line 55, comment it: // calendar& operator = (calendar &rhs);
calendar.cpp, line 55 to 86, comment all /* ... */

Error 4: map.cpp:1923:15: error: ‘x’ was not declared in this scope
Reason is map::sees is unfinished, like //WIP: faster map::sees comment suggests.
Solution: delete the unfinished implementation, because it is followed by an old one.
map.cpp, line 1915, delete lines from 1915 to 1929.

Segfault: Then I get a segfault on game start that is related to the unarmed styles macro. The problem is this line: setvector((static_cast<it_style*>(itypes[index]))->moves, __VA_ARGS__, NULL); which apparently writes moves for each style. Commenting this line fixes the segfault but breaks unarmed styles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants