Sign in to follow this  
Silvo

SqPlus woes!

Recommended Posts

Ok, after a large loop ive come back to Squirrel and SqPlus with VC++ 2005. The giant solution compiled and executed fine, but when I did it myself I get a problem with (it seems to be) sqobject.h my source (main.cpp):
#include "sqplus.h"

using namespace SqPlus;

#pragma comment(lib, "squirrelD.lib")
#pragma comment(lib, "sqstdlibD.lib")
#pragma comment(lib, "sqdbglibD.lib")
#pragma comment(lib, "sqplusD.lib")


int main(int argc,char * argv[]) {
  SquirrelVM::Init();
  SquirrelObject helloWorld = SquirrelVM::CompileBuffer(_T("print(\"Hello World\");"));
  SquirrelVM::RunScript(helloWorld);
  SquirrelVM::Shutdown();
  return 0;
} // main




Im getting this error: "this application has requested the Runtime to terminate in an unusual way. Please contact the application's support team for more information" Unfortunatly I am the support team... when stepping through with the debugger, i get an unhandled exception in SquirrelVM.cpp ln 133 (should be throw statement ln 131) which i can skip, and an access violation in sqobject.h ln 146 which i cannot continue past. What is this and how do i fix it?? Thanks!

Share this post


Link to post
Share on other sites
Are you compiling for Release, Debug, UNICODE? Make sure your project settings match the project settings for MinimalSqPlus. It would also be a good idea to use something like:


#define SQ_REL_PATH "../"

#ifdef UNICODE
#define LIB "U.lib"
#else
#define LIB ".lib"
#endif

#ifdef _DEBUG
#pragma comment(lib,SQ_REL_PATH "lib/squirrelD" LIB)
#pragma comment(lib,SQ_REL_PATH "lib/sqstdlibD" LIB)
#pragma comment(lib,SQ_REL_PATH "lib/sqplusD" LIB)
#else // Release
#pragma comment(lib,SQ_REL_PATH "lib/squirrel" LIB)
#pragma comment(lib,SQ_REL_PATH "lib/sqstdlib" LIB)
#pragma comment(lib,SQ_REL_PATH "lib/sqplus" LIB)
#endif




so that you get the correct libs depending on your current build (Release, Debug, UNICODE, etc.). Note that you don't need sqdbglib*.lib unless you are using the remote debugger.

Build the 'giant' solution, then build minimalSqPlus (set as the Startup Project). It should run fine with no issues.

Share this post


Link to post
Share on other sites
thanks, I didnt realise it was in unicode, but when i changed the #pragmas, it went looking for them and couldnt find them, so i had to change the project out of unicode. Now it works fine, thanks again!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this