Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ Running the server
➜ DBSaga Compiling Issues
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
Posted by
| Ohlookadime
(12 posts) Bio
|
Date
| Reply #15 on Thu 15 Oct 2020 04:14 AM (UTC) |
Message
|
Nick Gammon said:
Perhaps post the link to where it is?
https://ufile.io/28mdf53d
Thanks for all the help, I apologize for the delay in my response. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #17 on Thu 22 Oct 2020 02:34 AM (UTC) |
Message
|
Quote:
I'm new to coding and found this old DBSaga codebase ...
You found it on ufile.io?
I meant, where is the download link of the codebase that you found? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Ohlookadime
(12 posts) Bio
|
Date
| Reply #18 on Thu 22 Oct 2020 01:26 PM (UTC) Amended on Thu 22 Oct 2020 01:27 PM (UTC) by Ohlookadime
|
Message
| No, that is mine with all the files that I'm using now that I uploaded for ya to look at. I originally found it here
https://sourceforge.net/projects/dbsaga/ | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #19 on Sat 24 Oct 2020 11:22 PM (UTC) Amended on Sat 24 Oct 2020 11:25 PM (UTC) by Nick Gammon
|
Message
|
o/act_info.o:.../mud.h:1158: multiple definition of `MOBtrigger'; o/act_comm.o:/home/OhLoo/dbs/src/mud.h:1158: first defined here
o/act_info.o:.../mud.h:5601: multiple definition of `note_free'; o/act_comm.o:/home/OhLoo/dbs/src/mud.h:5601: first defined here
o/act_info.o:.../mud.h:364: multiple definition of `top_mob_serial'; o/act_comm.o:/home/OhLoo/dbs/src/mud.h:364: first defined here
...
OK, what is happening here is that the author defined variables in the mud.h file, for example:
...
bool MOBtrigger;
...
NOTE_DATA *note_free;
...
int top_mob_serial;
And so on. You can't do that, because each compilation unit (the .c files) then adds that declaration into the object file, and then the linker (not the compiler) finds multiple instances of them.
What you need to do is find all those variables in mud.h (the variable names will be in the error message, as shown above) and then change them to extern <the variable> for example:
...
extern bool MOBtrigger;
...
extern NOTE_DATA *note_free;
...
extern int top_mob_serial;
That tells the compiler to not set memory aside for them because they will be declared elsewhere (externally).
Then you have to declare them once, so you choose a file (eg. comm.c) and put them all inside there, ie. (after all the #include lines):
bool MOBtrigger;
NOTE_DATA *note_free;
int top_mob_serial;
...
So that declares the one (and only) copy of those variables. Now all the other files will be redirected to the single instance of them.
I can't say that will get rid of all the errors, but it should help. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Ohlookadime
(12 posts) Bio
|
Date
| Reply #20 on Sun 25 Oct 2020 09:27 AM (UTC) Amended on Sun 25 Oct 2020 09:29 AM (UTC) by Ohlookadime
|
Message
| Thank you very much, I will try this tomorrow.
Also, I have another version from a friend that's been trying to get this codebase to work also. Not getting any duplicate errors instead I receive this;
$ make
Makefile:94: warning: ignoring prerequisites on suffix rule definition
make dbs
make[1]: Entering directory '/home/OhLoo/dbs/src'
Makefile:94: warning: ignoring prerequisites on suffix rule definition
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG -DTIMEFORMAT -DNOCRYPT act_move.c
In file included from act_move.c:23:
act_move.c: In function ‘grab_word’:
act_move.c:170:18: warning: array subscript has type ‘char’ [-Wchar-subscripts]
170 | while ( isspace(*argument) )
| ^~~~~~~~~
act_move.c:188:18: warning: array subscript has type ‘char’ [-Wchar-subscripts]
188 | while ( isspace(*argument) )
| ^~~~~~~~~
act_move.c: In function ‘decorate_room’:
act_move.c:293:32: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
293 | switch ( number_range(1, 2 * (iRand == nRand - 1) ? 1 : 2) )
| ~~^~~~~~~~~~~~~~~~~~~~~~
act_move.c: In function ‘generate_exit’:
act_move.c:653:22: error: lvalue required as left operand of assignment
653 | (EXIT_DATA *) pexit = xit;
| ^
act_move.c: In function ‘do_climb’:
act_move.c:2401:7: warning: variable ‘found’ set but not used [-Wunused-but-set-variable]
2401 | bool found;
| ^~~~~
act_move.c: In function ‘do_enter’:
act_move.c:2432:7: warning: variable ‘found’ set but not used [-Wunused-but-set-variable]
2432 | bool found;
| ^~~~~
act_move.c: In function ‘do_leave’:
act_move.c:2471:7: warning: variable ‘found’ set but not used [-Wunused-but-set-variable]
2471 | bool found;
| ^~~~~
make[1]: *** [Makefile:94: act_move.o] Error 1
make[1]: Leaving directory '/home/OhLoo/dbs/src'
make: *** [Makefile:70: all] Error 2
Thank you very much for your continued help! | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #21 on Sun 25 Oct 2020 10:21 AM (UTC) Amended on Sun 25 Oct 2020 10:38 AM (UTC) by Nick Gammon
|
Message
| You only have one error there (the rest are warnings):
act_move.c:653:22: error: lvalue required as left operand of assignment
You may want to search what that means.
As an example, this simple program gives the same error message:
int main ()
{
unsigned char c;
(char) c = 'a';
}
However this does not:
int main ()
{
unsigned char c;
c = (unsigned char) 'a';
}
In other words, you cast the source of an assignment (the rvalue), not the destination (the lvalue). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
50,185 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top