Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Database/World Building

Development::Database/World Building World Building forum, dedicated to the EQEmu MySQL Database. Post partial/complete databases for spawns, items, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2009, 03:46 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Awwe, compile error:
Code:
entity.cpp: In member function ‘Object* EntityList::FindNearbyObject(float, float, float, float)’:
entity.cpp:774: error: call of overloaded ‘abs(float)’ is ambiguous
/usr/include/stdlib.h:778: note: candidates are: int abs(int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:172: note:                 long long int __gnu_cxx::abs(long long int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:142: note:                 long int std::abs(long int)
entity.cpp:774: error: call of overloaded ‘abs(float)’ is ambiguous
/usr/include/stdlib.h:778: note: candidates are: int abs(int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:172: note:                 long long int __gnu_cxx::abs(long long int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:142: note:                 long int std::abs(long int)
entity.cpp:774: error: call of overloaded ‘abs(float)’ is ambiguous
/usr/include/stdlib.h:778: note: candidates are: int abs(int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:172: note:                 long long int __gnu_cxx::abs(long long int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:142: note:                 long int std::abs(long int)
Maybe I missed something or messed something up while adjusting the formatting. All I really did was change the double spaces to tabs to make it uniform with the source code. I am going to check it over again and see if I can figure it out. Seems like it should work, since the doors code right above it is almost the exact same thing. BTW, that command in command.cpp is massive!

Here is the bit of code it is referring to:
Code:
	while(iterator.MoreElements())
	{
		Object* object=iterator.GetData();

		object->GetLocation(&ox, &oy, &oz);

		if ((abs(ox - x) <= radius) && (abs(oy - y) <= radius) && (abs(oz - z) <= radius))
		{
			return object;
		}
		iterator.Advance();
	}
Maybe it is just an issue with my libraries or gcc or kernel or something. I don't really know.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 07-16-2009 at 12:02 PM..
Reply With Quote
  #2  
Old 07-16-2009, 04:11 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Commented that while out for now to try to get around it and now getting these compile errors:

Code:
command.cpp:13397: error: ‘_strlwr’ was not declared in this scope
command.cpp:13447: error: ‘sprintf_s’ was not declared in this scope
command.cpp:13458: error: ‘sprintf_s’ was not declared in this scope
command.cpp:13472: error: ‘_TRUNCATE’ was not declared in this scope
command.cpp:13472: error: ‘strncpy_s’ was not declared in this scope
command.cpp:13595: error: ‘sprintf_s’ was not declared in this scope
command.cpp:13600: warning: suggest parentheses around assignment used as truth value
command.cpp:13644: error: ‘sprintf_s’ was not declared in this scope
command.cpp:13649: warning: suggest parentheses around assignment used as truth value
command.cpp:13674: error: ‘_TRUNCATE’ was not declared in this scope
command.cpp:13674: error: ‘strncpy_s’ was not declared in this scope
command.cpp:13676: warning: comparison between signed and unsigned integer expressions
command.cpp:13688: error: ‘_strupr’ was not declared in this scope
command.cpp:13703: error: ‘strcpy_s’ was not declared in this scope
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 07-16-2009, 06:03 AM
Kobaz
Hill Giant
 
Join Date: Nov 2008
Location: Gold Coast, Oz
Posts: 119
Default

I've hit this in my "trying to learn C++ adventure". The *_s functions are Microsoft only. For sprintf_s you might try the POSIX snprintf:

Code:
int snprintf(char *str, size_t size, const char *format, ...);

   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

       snprintf(), vsnprintf(): _BSD_SOURCE || _XOPEN_SOURCE >= 500 ||
       _ISOC99_SOURCE; or cc -std=c99

 The  functions  snprintf()  and  vsnprintf()  write  at most size bytes
       (including the trailing null byte ('\0')) to str.
This is from the man pages with glibc version 2.2
Reply With Quote
  #4  
Old 07-16-2009, 08:11 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Note that I moved the code related portion of this thread into the Server Code Submissions section here:

http://www.eqemulator.net/forums/showthread.php?t=28916

Code related discussion should go there and any other comments on it should go here to keep the code thread as clean as possible.

P.S. I can't wait to try this command out once it compiles properly in Linux!
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 08-16-2010, 05:04 PM
Bellos
Hill Giant
 
Join Date: Jul 2007
Posts: 111
Default

hey guys can you only use objects from .eqg files or can you use em from .s3d files also. If so how do you add from an s3d file as they never show up do you add the whole line like CAMPFIRE_DMSPRITEDEF in the doors table

or do you just add CAMPFIRE or do you skip the DM and do CAMPFIRE_SPRITEDEF
Reply With Quote
  #6  
Old 08-17-2010, 12:28 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

For most objects (maybe all of them), you need to add _ACTORDEF to the end of the name for them to work. So, "CAMPFIRE" becomes "CAMPFIRE_ACTORDEF".

Also, you might want to use s3dspy or the global model viewer to find your models for objects. The .mod files are the ones you want. Another thing is to make sure you always add the name in all capitals or they won't work.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 08-17-2010, 12:54 AM
Bellos
Hill Giant
 
Join Date: Jul 2007
Posts: 111
Default

so for CAMPFIRE its CAMPFIRE_ACTORDEF not SPRITEDEF right and only .mod files can be used?


And you can use objects from s3d and eqg right not just eqg?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:55 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3