Oh what fun it would be: a compiler with useful error messages

the code:

#include "common.hpp"


template<typename ACHAR>
class GameException
: public std::exception
{
public:
GameException() throw();
GameException(const ACHAR*) throw();
GameException(const basic_string<ACHAR>&) throw();
virtual ~GameException() throw();
virtual const ACHAR* what() const throw();
protected:
const ACHAR *why;
};

the error:

s:visual studio 2008projectstacfpsgameprojectnamesourceincludegameexceptions.hpp(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

the solution:

fully qualify basic_string<> as std::basic_string<ACHAR>, or add ‘using std::basic_string’ to common.hpp along side std::string and std::wstring, like I thought I did last week !!!

simple fact: compiler errors usually suck, and C++ templates don’t help any.

Ahh I feel refreshed!

One of our clients was out of town for a few days, so we had to watch their dog over here; he just went home tonight. After ~6 hours of C++ this afternoon, I was kind of glad to be shifting out to a lit’ work.

Came home to a long hot shower and a close shave; threw everything in the wash and plopped down back in front of the computer lol. One nice thing about a C++ compiler, it doesn’t care if your favourite t-shirt probably has more holes in it then a slice of swiss cheese :-P.

I’ve been working on a file system library and a command console for my present project; comparing the Windows and POSIX APIs for file system operations, I’m in the mood to paste a comparison later… haha. Present prioriteres are mapping data into both the source and release trees, hooking up the game console, and maturing the file system interface. Really the prototype will have a few quake like qualities in that regard, but that is only because ID Tech engines kick ass hehe. What I really would like is to load data out of ZIP archives and use a mixture of XML and Python script to extend things. We’ll see where the future goes.

Maybe I’m just tired, or now I’m ready for a nap

compiler is pissed off:

1>pathsourcegameconsole.cpp(53) : error C2039: 'setPostiion' : is not a member of 'Ogre::OverlayElement'
1> pathsourceogreogremainincludeogreoverlayelement.h(104) : see declaration of 'Ogre::OverlayElement'

ogreoverlayelement.h

class _OgreExport OverlayElement : public StringInterface, public Renderable, public OverlayAlloc
{
// ...
public:
/** Sets the position of the top-left corner of the element, relative to the screen size (1.0 = screen width / height) */
void setPosition(Real left, Real top);


// ...
};

The header file and the API documentation both agree, the Ogre::OverlayElement class has a public member named setPosition. The compiler however seems to assert, that the header is wrong?

No, the compiler, the header, and the API docs are all right: I’ve just been sitting here for about 5 1/2 hours without break…. and can no longer tell the difference between ‘void setPosition(Real, Real);’ and ‘void setPostiion(Real, Real);’

!!! TIME TO TAKE A WALK !!!

Mating Vi IMproved with Visual C++, part I

Maybe it’s because it is an Integrated Development Environment, but Visual C++ seems to be a little lacking in its handling of external editors (at least in the express edition I have avail). It seems the best way to get MSVC to work with Vi IMproved for editing files, is to right click on a file in the solution explorer docklet, and click “Open with”. From there one can specify a program to open the file with and force it as the default editor; the down side is the bloody thing seems to reject the concept of command line arguments.

As such, I created a new win32 application in the IDE, and stripped the fundamental code down to the following

#define GVIM_EXE    _T("P:/Editors/Vim/vim-personal/gvim.exe")
#define GVIM_ARGS _T("--servername"), _T("MSVC"), _T("--remote-tab-silent")

int APIENTRY
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(nCmdShow);

_texecl(GVIM_EXE, _T("gvim"), GVIM_ARGS, lpCmdLine, NULL);

return 0;
}

Which means I get one instance of Vim running and double clicking files in the solution explorer, will open a new tab in the GVim window; gotta love an editor with a client-server feature hehe.

I have Michael Graz’s visual_studio.vim installed along with the required python for windows extensions. The plugin loads and appears to be exactly the *first* vim plugin that I can actually find a purpose for using! Except for one small problem…. the plugin can’t seem to chatter with the running instance of Visual C++ 2008 Express Edition!

Of course, I could likely jerry rig vim’s :make command to invoke vcbuild for me without much trouble.

Heh, and just for the heck of it, I wonder if a similar plugin could be written for other IDEs, like Code::Blocks, XCode, and KDevelop?

The road I’m on

She said life’s a lot to think about sometimes
When you’re living in between the lines
And all the stars they sparkle and shine everyday

He said life’s so hard to move in sometimes
When it feels like I’m towin’ the line
And no one even cares to ask me why I feel this way

I know you feel helpless now and I know you feel alone
That’s the same road, the same road that I am on

He said life’s a lot to think about sometimes
When you keep it all between the lines
Of everything I want and I want to find, one of these days

What you thought was real in life somehow steered you wrong
Now you just keep drivin’ tryin’ to find out where you belong

I know you feel helpless now and I know you feel alone
That’s the same road, that same road that I am on

What you thought was real in life somehow steered you wrong
Now you just keep drivin’ tryin’ to find out where you belong

I know you feel helpless now and I know you feel alone
That’s the same road, that same road that I am on

The Road I’m On, 3 Doors Down

Building vim with support for Python and Perl on Windows

Previously:

install a suitable version of Visual Studio / Visual C++
install a suitable version of Python
install a suitable version of Perl
open a Visual Studio Command Prompt

I have VC Express 9.0, ActivePerl 5.10.0, and Python 2.6.2 installed from Python.org’s installer.

Check out the VIM source code, you can find directions here. I suggest using CVS or SVN to make the patching life easier. Precompiled binaries of CVS and SVN are available for Windows, and it is possible to build them yourself of course ;).

I use CVS and wish to keep the tree along side my regular vim:

> cd /d P:editorsvim
> cvs -z3 -d:pserver:anonymous@vim.cvs.sf.net:/cvsroot/vim checkout -Nd vim7-cvs-src vim7
> cd vim7-cvs-srcsrc

You should know read the Make_mvc.mak makefile to find the options you are interested in using. I’ll leave the viewing the file from the command line to a Windows users intelligence (hints: more, edit, notepad, wordpad, or gvim would be useful). We have to tell nmake.exe to use this file and our options, for asses who use Visual Studio all day but don’t remember nmake: we pass it VAR=value pairs.

> nmake /F Make_mvc.mak CPUNR=i686 FEATURES=HUGE GUI=yes OLE=yes CSCOPE=yes CTAGS=ctags POSTSCRIPT=yes PYTHON=P:DevelLanguagesPython2.6 PYTHON_VER=26 PERL=P:DevelLanguagesPerl PERL_VER=510

Obviously if you want same options, adjust the paths like a good little geek.

At least on my system, MSVCs compiler refuses to build the vimrun.exe, install.exe, uninstal.exe, and xxd/xxd.exe targets (and programs). As such, I build gvim and the gvimext.dll – the targets are in the makefile. if one wants to build a vim execuitable under a diffirent name, I suggest ‘nmake /e VIM=foo /f … OPTS=… foo.exe’ to create foo.exe (default is gvim).

As such we need a place to put vim so we can actually use it.


> MKDIR ....vim-personal
> FOR %F IN (*.dll *.exe) DO XCOPY /Y %F ....vim-personal
> XCOPY /Y P:DevelLanguagesPerlbinperl510.dll ....vim-personal
> XCOPY /I /E /Y ..runtime* ....vim-personal

and one can borrow the lost vimrun and diff files from a working install. If one also juggled the names so that vim-personal became vim72, one could also borrow the install.exe file most likely…

In doing all of this, I’ve written a batch script to use in automating the thing, which is not as good as my vimbuild shell script but still works lol. When I get some time I’ll make my script also update the spell files and what nots (hint: see spellreadme.txt)

Hahaha, here I am wondering ok, what the hell is wrong with

if (statement that will return false)
DEBUG(...);
do action;

and then I noticed, uncommenting the DEBUG() macro a few minutes ago changed the dohicky.

This is exactly why whenever I’ve written a ‘style’ file for any of the projects I’ve done (and in fact, usually follow) a note that it should *always* be if () { } and never if () just for this reason!!!

Ok, I’m so freaking stupid… I should just get some sleep and code when I can pay attention (and remember my old tool Perl).

Been playing a little bit of raven shield, set to some hard rock by way of www.pandora.com it makes a nice mixture. I’m still in a really pissy mood, think I might take up some OpenArena or something to pass the time for a bit more…

I’m so tired of this place.

Dark mood

I’m really not in a good mood right now. Tired and pissed off make for a piss poor pair. It just seems the more I’m here, the worse I feel; the more I know that something is missing from my world. Been fairly busy of late, mostly keeping myself busy, less time to think. It’s like just about anything that will fill space for a little while; rather then thinking about other issues. I’m also not looking forward to this coming week and such, because I know for what family has planned, is only likely to make me feel miserable in the long run. It’s been 21 years on earth, and I just know… being around family is usually a painful affair.

Plans as part of Operation Redeemer are more or less on schedule but things just are not going fast enough in the right directions to suit my needs; lately I feel like I’m just passing time again, but for different reasons. I draw breath, but what makes me move?

Being lazy: make.cmd

A short batch file that let’s me skip typing as much as possible when using vcbuild on my present projects.

@ECHO OFF
cls
IF "%1" EQU "help" (
ECHO %0 help -- display this help
ECHO %0 clean target -- clean for "target"
ECHO %0 target [run] -- build and run "target"
GOTO EXITPOINT
)

IF "%1" EQU "clean" (
vcbuild /clean TheSolutionFile.sln "%2|Win32"
) ELSE (
IF "%2" EQU "run" (
vcbuild TheSolutionFile.sln "%1|Win32" && pathtothe.exe
) ELSE (
vcbuild TheSolutionFile.sln "%1|Win32"
)
)

:EXITPOINT

which is (obviously) saved in the same direction as my solution file. A trivial modification would allow passing the solution file through an environment variable, and one could always use vcbuild’s understanding of a lone project file in the present directory but I tend to keep a shell open to the same location as my solution file.

Then again, at the moment I am using a file system hierarchy that looks sort of like this for most of my current stuff:

...
SolutionFile.sln
Project/
ProjectFile.vcproj
Makefile # the big thing for conventional builds
Makefile.compiler
...
Source/
*.c, *.cpp, ...
include/
*.h, *.hpp, ...
lib/
# project specific library files
Build/
Target/
# result of compiling (e.g. 'make target')
...