Ubuntu Compile Errors and warnings

Forum where anything UOX3-related goes - including, but not limited to: newbie-support, ideas, general questions, comments, etc and-so-forth.
Post Reply
intodesi2
UOX3 Neophyte
Posts: 32
Joined: Wed Nov 19, 2008 9:45 am
Has thanked: 0
Been thanked: 0

Ubuntu Compile Errors and warnings

Post by intodesi2 »

Hello, I was attempting to compile the svn code on my Ubuntu test server 7.10 and following Cavileirs walk though I've run into a problem during make.

This is the console paste below. And I apologize ahead of time if this is the wrong area.

Code: Select all

intodesi@NixTestSrv:~/projects/uox3/source$ aclocal-1.9
/usr/share/aclocal/libmcrypt.m4:17: warning: underquoted definition of AM_PATH_L                                                                             IBMCRYPT
  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
intodesi@NixTestSrv:~/projects/uox3/source$ automake-1.9 --add-missing
configure.in: installing `./install-sh'
configure.in: installing `./missing'
Makefile.am: installing `./INSTALL'
Makefile.am: installing `./COPYING'
Makefile.am: installing `./depcomp'
intodesi@NixTestSrv:~/projects/uox3/source$ autoconf
intodesi@NixTestSrv:~/projects/uox3/source$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for an ANSI C-conforming const... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
intodesi@NixTestSrv:~/projects/uox3/source$ make
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA                                                                             GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"uox3\" -DVERSION=\"0.97\" -I                                                                             . -I.     -O2 -I./mozilla/js/src -MT ai.o -MD -MP -MF ".deps/ai.Tpo" -c -o ai.o                                                                              ai.cpp; \
        then mv -f ".deps/ai.Tpo" ".deps/ai.Po"; else rm -f ".deps/ai.Tpo"; exit                                                                              1; fi
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA                                                                             GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"uox3\" -DVERSION=\"0.97\" -I                                                                             . -I.     -O2 -I./mozilla/js/src -MT archive.o -MD -MP -MF ".deps/archive.Tpo" -                                                                             c -o archive.o archive.cpp; \
        then mv -f ".deps/archive.Tpo" ".deps/archive.Po"; else rm -f ".deps/arc                                                                             hive.Tpo"; exit 1; fi
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA                                                                             GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"uox3\" -DVERSION=\"0.97\" -I                                                                             . -I.     -O2 -I./mozilla/js/src -MT boats.o -MD -MP -MF ".deps/boats.Tpo" -c -o                                                                              boats.o boats.cpp; \
        then mv -f ".deps/boats.Tpo" ".deps/boats.Po"; else rm -f ".deps/boats.T                                                                             po"; exit 1; fi
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA                                                                             GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"uox3\" -DVERSION=\"0.97\" -I                                                                             . -I.     -O2 -I./mozilla/js/src -MT books.o -MD -MP -MF ".deps/books.Tpo" -c -o                                                                              books.o books.cpp; \
        then mv -f ".deps/books.Tpo" ".deps/books.Po"; else rm -f ".deps/books.T                                                                             po"; exit 1; fi
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA                                                                             GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"uox3\" -DVERSION=\"0.97\" -I                                                                             . -I.     -O2 -I./mozilla/js/src -MT cAccountClass.o -MD -MP -MF ".deps/cAccount                                                                             Class.Tpo" -c -o cAccountClass.o cAccountClass.cpp; \
        then mv -f ".deps/cAccountClass.Tpo" ".deps/cAccountClass.Po"; else rm -                                                                             f ".deps/cAccountClass.Tpo"; exit 1; fi
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA                                                                             GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"uox3\" -DVERSION=\"0.97\" -I                                                                             . -I.     -O2 -I./mozilla/js/src -MT calcfuncs.o -MD -MP -MF ".deps/calcfuncs.Tp                                                                             o" -c -o calcfuncs.o calcfuncs.cpp; \
        then mv -f ".deps/calcfuncs.Tpo" ".deps/calcfuncs.Po"; else rm -f ".deps                                                                             /calcfuncs.Tpo"; exit 1; fi
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA                                                                             GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"uox3\" -DVERSION=\"0.97\" -I                                                                             . -I.     -O2 -I./mozilla/js/src -MT cBaseobject.o -MD -MP -MF ".deps/cBaseobjec                                                                             t.Tpo" -c -o cBaseobject.o cBaseobject.cpp; \
        then mv -f ".deps/cBaseobject.Tpo" ".deps/cBaseobject.Po"; else rm -f ".                                                                             deps/cBaseobject.Tpo"; exit 1; fi
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA                                                                             GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"uox3\" -DVERSION=\"0.97\" -I                                                                             . -I.     -O2 -I./mozilla/js/src -MT cChar.o -MD -MP -MF ".deps/cChar.Tpo" -c -o                                                                              cChar.o cChar.cpp; \
        then mv -f ".deps/cChar.Tpo" ".deps/cChar.Po"; else rm -f ".deps/cChar.T                                                                             po"; exit 1; fi
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA                                                                             GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"uox3\" -DVERSION=\"0.97\" -I                                                                             . -I.     -O2 -I./mozilla/js/src -MT cConsole.o -MD -MP -MF ".deps/cConsole.Tpo"                                                                              -c -o cConsole.o cConsole.cpp; \
        then mv -f ".deps/cConsole.Tpo" ".deps/cConsole.Po"; else rm -f ".deps/c                                                                             Console.Tpo"; exit 1; fi
cConsole.cpp: In member function âUOX::CConsole& UOX::CConsole::operator<<(const                                                                              char*)â:
cConsole.cpp:112: error: âCONSOLE_SCREEN_BUFFER_INFOâ was not declared in this s                                                                             cope
cConsole.cpp:112: error: expected `;' before âScrBuffInfoâ
cConsole.cpp:113: error: âhcoâ was not declared in this scope
cConsole.cpp:113: error: âScrBuffInfoâ was not declared in this scope
cConsole.cpp:113: error: âGetConsoleScreenBufferInfoâ was not declared in this s                                                                             cope
make: *** [cConsole.o] Error 1
Cavalier
UOX3 Newbie
Posts: 18
Joined: Wed Feb 21, 2007 11:19 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by Cavalier »

Hmm. Character encoding issues?

I havn't tried building UOX3 for a while, might have a whack at it later tonight or tomorrow to see if something else is going on.
intodesi2
UOX3 Neophyte
Posts: 32
Joined: Wed Nov 19, 2008 9:45 am
Has thanked: 0
Been thanked: 0

Post by intodesi2 »

Thank you Cavalier
Cavalier
UOX3 Newbie
Posts: 18
Joined: Wed Feb 21, 2007 11:19 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by Cavalier »

Ok, tried building it. It choked, but not on what yours did.

The error in aclocal shouldn't have happened. I run gentoo and not ubuntu, so things could differ in our versions. Why they would I'm not sure.

The error I got is:

Code: Select all

In file included from regions.h:9,
                 from ai.cpp:21:
mapstuff.h: In constructor 'UOX::CMulHandler::MultiItemsIndex_st::MultiItemsIndex_st()':
mapstuff.h:101: error: 'SHRT_MAX' was not declared in this scope
mapstuff.h:101: error: 'SHRT_MIN' was not declared in this scope
mapstuff.h:102: error: 'SCHAR_MAX' was not declared in this scope
mapstuff.h:102: error: 'SCHAR_MIN' was not declared in this scope
make: *** [ai.o] Error 1
However it doesn't look like this file has been updated since I last built UOX3, so something else has changed somewhere.

And screw the bloody security restrictions on this forum :(
Cavalier
UOX3 Newbie
Posts: 18
Joined: Wed Feb 21, 2007 11:19 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by Cavalier »

You might actually want to try running autogen.sh too. It looks like a similar process to my manual one, but was written against cygwin. Just chmod +x it and ./autogen.sh
intodesi2
UOX3 Neophyte
Posts: 32
Joined: Wed Nov 19, 2008 9:45 am
Has thanked: 0
Been thanked: 0

Post by intodesi2 »

What do you mean by autogen.sh? After i chmod -x and ./autogen.sh it's giving me a command not found.
Cavalier
UOX3 Newbie
Posts: 18
Joined: Wed Feb 21, 2007 11:19 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by Cavalier »

Code: Select all

./configure: line 3969: down: command not found
That line? I get that too. Like I said, it was built against cygwin. It performs similar preparation steps to my manual walkthrough. After running the script it should still kick off the compile process when you type make after that, and then you should hit the mapstuff compilation error.

If you arn't getting to the same compile errors that I am suggests there is something going wrong in your toolchain or the local copies of your files (ie, not being download correctly, character encoding problems somewhere along the line, disk issues - /shrug).
intodesi2
UOX3 Neophyte
Posts: 32
Joined: Wed Nov 19, 2008 9:45 am
Has thanked: 0
Been thanked: 0

Post by intodesi2 »

This is what I get when I ./configure and make

Code: Select all

intodesi@NixTestSrv:~/projects/uox3/source$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for an ANSI C-conforming const... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
intodesi@NixTestSrv:~/projects/uox3/source$ ./make
-bash: ./make: No such file or directory
intodesi@NixTestSrv:~/projects/uox3/source$ make
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"uox3\" -DVERSION=\"0.97\" -I. -I.     -O2 -I./mozilla/js/src -MT cConsole.o -MD -MP -MF ".deps/cConsole.Tpo" -c -o cConsole.o cConsole.cpp; \
        then mv -f ".deps/cConsole.Tpo" ".deps/cConsole.Po"; else rm -f ".deps/cConsole.Tpo"; exit 1; fi
cConsole.cpp: In member function âUOX::CConsole& UOX::CConsole::operator<<(const char*)â:
cConsole.cpp:112: error: âCONSOLE_SCREEN_BUFFER_INFOâ was not declared in this scope
cConsole.cpp:112: error: expected `;' before âScrBuffInfoâ
cConsole.cpp:113: error: âhcoâ was not declared in this scope
cConsole.cpp:113: error: âScrBuffInfoâ was not declared in this scope
cConsole.cpp:113: error: âGetConsoleScreenBufferInfoâ was not declared in this scope
make: *** [cConsole.o] Error 1
intodesi@NixTestSrv:~/projects/uox3/source$
intodesi2
UOX3 Neophyte
Posts: 32
Joined: Wed Nov 19, 2008 9:45 am
Has thanked: 0
Been thanked: 0

Post by intodesi2 »

What does the following code do in cConsole.cpp I commented it out and make is working, I am getting warnings, but it looks like it is building.

Code: Select all

//o---------------------------------------------------------------------------o
//|   Function    -  << Overrriding
//|   Date        -  Unknown
//|   Programmer  -  Unknown
//o---------------------------------------------------------------------------o
//|   Purpose     -  Let you use <<and>>
//o---------------------------------------------------------------------------o
//CConsole& CConsole::operator<<( const SI08 *outPut )
//{
//	StartOfLineCheck();
//	(*this) << (const char *)outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<const> ScrBuffInfo.dwSize.X )
//	{
//		bool wrapDone = false;
//		while( !wrapDone )
//		{
//			GetConsoleScreenBufferInfo( hco, &ScrBuffInfo );
//			int diff = ScrBuffInfo.dwSize.X - ScrBuffInfo.dwCursorPosition.X - 1;
//			if( diff > toDisplay.length() )
//			{
//				std::cout << toDisplay;
//				wrapDone = true;
//			}
//			else
//			{
//				std::cout << toDisplay.substr( 0, diff );
//				(*this) << myendl;
//				StartOfLineCheck();
//				toDisplay = toDisplay.substr( diff );
//			}
//		}
//	}
//	else
//	{
//		std::cout << outPut;
//	}
//	return (*this);
//}
//CConsole& CConsole::operator<<( const UI08 *outPut )
//{
//	StartOfLineCheck();
//	(*this) << (const char *)outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<( const SI32 &outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<( const UI32 &outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<( const SI16 &outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<( const UI16 &outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<( const SI08 &outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<( const UI08 &outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<( const CBaseObject *outPut )
//{
//	StartOfLineCheck();
//	(*this) <<outPut>GetSerial();
//	return (*this);
//}
//CConsole& CConsole::operator<<( const std::string &outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut.c_str();
//	return (*this);
//}
//CConsole& CConsole::operator<<( const std::ostream& outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<( CBaseObject *outPut )
//{
//	StartOfLineCheck();
//	(*this) <<outPut>GetSerial();
//	return (*this);
//}
//CConsole& CConsole::operator<<( std::ostream& outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<( CEndL& myObj )
//{
//	if( curLeft == 0 )
//		PrintStartOfLine();
//	std::cout << std::endl;
//	curLeft = 0;
//	++curTop;
//	return (*this);
//}
//CConsole& CConsole::operator<<( const R32 &outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut;
//	return (*this);
//}
//CConsole& CConsole::operator<<( const R64 &outPut )
//{
//	StartOfLineCheck();
//	std::cout << outPut;
//	return (*this);
//}
//
//CConsole& CConsole::operator<<( const size_t &outPut )
//{
//	StartOfLineCheck();
//	std::cout << static_cast<UI32>(outPut);
//	return (*this);
//}

intodesi2
UOX3 Neophyte
Posts: 32
Joined: Wed Nov 19, 2008 9:45 am
Has thanked: 0
Been thanked: 0

Post by intodesi2 »

Ok.. maybe shouldnt have taken that out.. I am getting

Code: Select all

uox3.o: In function `main':
uox3.cpp:(.text+0xe06b): undefined reference to `UOX::CConsole::operator<<(UOX::CEndL&)'
uox3.cpp:(.text+0xe07b): undefined reference to `UOX::CConsole::operator<<(char const*)'
uox3.cpp:(.text+0xe0e6): undefined reference to `UOX::CConsole::operator<<(char const*)'
uox3.cpp:(.text+0xe0f6): undefined reference to `UOX::CConsole::operator<<(UOX::CEndL&)'
uox3.cpp:(.text+0xe75b): undefined reference to `UOX::CConsole::operator<<(char const*)'
worldmain.o: In function `UOX::CWorldMain::SaveNewWorld(bool)':
worldmain.cpp:(.text+0x342b): undefined reference to `UOX::CConsole::operator<<(char const*)'
worldmain.cpp:(.text+0x343b): undefined reference to `UOX::CConsole::operator<<(UOX::CEndL&)'
worldmain.cpp:(.text+0x3467): undefined reference to `UOX::CConsole::operator<<(char const*)'
worldmain.cpp:(.text+0x3575): undefined reference to `UOX::CConsole::operator<<(char const*)'
worldmain.cpp:(.text+0x3584): undefined reference to `UOX::CConsole::operator<<(unsigned short const&)'
worldmain.cpp:(.text+0x3594): undefined reference to `UOX::CConsole::operator<<(UOX::CEndL&)'
worldmain.cpp:(.text+0x35b8): undefined reference to `UOX::CConsole::operator<<(char const*)'
worldmain.cpp:(.text+0x35c8): undefined reference to `UOX::CConsole::operator<<(UOX::CEndL&)'
worldmain.cpp:(.text+0x367b): undefined reference to `UOX::CConsole::operator<<(char const*)'
worldmain.cpp:(.text+0x368b): undefined reference to `UOX::CConsole::operator<<(UOX::CEndL&)'
collect2: ld returned 1 exit status
make: *** [uox3] Error 1
intodesi2
UOX3 Neophyte
Posts: 32
Joined: Wed Nov 19, 2008 9:45 am
Has thanked: 0
Been thanked: 0

Post by intodesi2 »

I think the problem is here for me

Code: Select all

cConsole.cpp: In member function âUOX::CConsole& UOX::CConsole::operator<<(const             char*)â:
cConsole.cpp:112: error: âCONSOLE_SCREEN_BUFFER_INFOâ was not declared in this s            cope
cConsole.cpp:112: error: expected `;' before âScrBuffInfoâ
cConsole.cpp:113: error: âhcoâ was not declared in this scope
cConsole.cpp:113: error: âScrBuffInfoâ was not declared in this scope
cConsole.cpp:113: error: âGetConsoleScreenBufferInfoâ was not declared in this s            cope
make: *** [cConsole.o] Error 1
something wrong with the code.?
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

My bad, it was from a commit I did. Change the function like this:

Add this

Code: Select all

#if UOX_PLATFORM == PLATFORM_WIN32
immediately above

Code: Select all

	CONSOLE_SCREEN_BUFFER_INFO ScrBuffInfo;
and this

Code: Select all

#endif
just above

Code: Select all

	{
		std::cout << outPut;
	}
	return (*this);
intodesi2
UOX3 Neophyte
Posts: 32
Joined: Wed Nov 19, 2008 9:45 am
Has thanked: 0
Been thanked: 0

Post by intodesi2 »

thank you Maarc, looks like a successful build. :)
intodesi2
UOX3 Neophyte
Posts: 32
Joined: Wed Nov 19, 2008 9:45 am
Has thanked: 0
Been thanked: 0

Post by intodesi2 »

Ok last question, Can I use a fresh install of mondains legacy or even kingdom reborn? I have been trying to find the info myself, but I got lost.
Mindless Automaton
UOX3 Apprentice
Posts: 189
Joined: Wed May 10, 2006 3:48 am
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Mindless Automaton »

intodesi2 wrote:Ok last question, Can I use a fresh install of mondains legacy or even kingdom reborn? I have been trying to find the info myself, but I got lost.
I use Mondain's Legacy. :o
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
Post Reply