i dont remember the proper way to add the sdlmain linked but you can remove "-lSDLmain" from your makefile then just add the normal psp module info in your SDL_psp_main.c file, exemple :
Your main function needs to be called SDL_main and included in an "extern C" block. The symbol would already be redefined if you added $(shell $(SDL_CONFIG) --cflags) to your CFLAGS, but you have those lines commented out.
extern "C" int SDL_main(int nNumArgs,char **ppcArgs) ;
at the beginning of the main file as the program starts with that function,but unfortuneltly,still no luck,same error.
"extern" doesn't tell the link-loader a function is in this object, it tells it it's NOT in this object. You use extern when you wish to access a function defined somewhere else.
From an online C reference:
extern
Indicates that an identifier is defined elsewhere.
Keyword extern indicates that the actual storage and initial value of a variable, or body of a function, is defined elsewhere, usually in a separate source code module. So, it may be applied to data definitions and function prototypes:
/*=============================================================================
XMOTO
Copyright (C) 2005-2006 Rasmus Neckelmann ([email protected])
This file is part of XMOTO.
XMOTO is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
XMOTO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with XMOTO; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
=============================================================================*/
/*
* Game main.
*/
#include <stdio.h>
#include <stdlib.h>
#include "Game.h"
#include "VFileIO.h"
using namespace vapp;
#ifndef GameMain.cpp
#define GameMain.cpp
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================
SDL main entry point
===========================================================================*/
//extern "C" int SDL_main(int nNumArgs,char **ppcArgs) ;
int SDL_main(int nNumArgs,char **ppcArgs) {
/* Start application */
try {
/* Setup basic info */
GameApp Game;
Game.setAppName(std::string("X-Moto"));
Game.setAppCommand(std::string("xmoto"));
Game.setCopyrightInfo(std::string("(C) Copyright 2005-2006 Rasmus Neckelmann ([email protected])"));
Game.run(nNumArgs,ppcArgs);
}
catch (Exception &e) {
FS::writeLog(std::string("Exception: ") + e.getMsg());
printf("fatal exception : %s\n",e.getMsg().c_str());
SDL_Quit(); /* make sure SDL shuts down gracefully */
#if defined(WIN32)
char cBuf[1024];
sprintf(cBuf,"Fatal exception occured: %s\n"
"Consult the file xmoto.log for more information about what\n"
"might has occured.\n",e.getMsg().c_str());
MessageBox(NULL,cBuf,"X-Moto Error",MB_OK|MB_ICONERROR);
#endif
}
return 0;
}
#ifdef __cplusplus
}
#endif
#endif
i dont remember the proper way to add the sdlmain linked but you can remove "-lSDLmain" from your makefile then just add the normal psp module info in your SDL_psp_main.c file, exemple :
i dont remember the proper way to add the sdlmain linked but you can remove "-lSDLmain" from your makefile then just add the normal psp module info in your SDL_psp_main.c file, exemple :
This will also allow to output printf and stderr to psplink, what i cant do when linking with lsdlmain (dunno why).
I've added these lines at top of the SDL_psp_main.c file,and removed -lSDLmain from makefile,but it's still no go.And I really don't know why it's linking all libriaries together,rather than compiling my own code,I have OBJS line in my makefile,so I don't know why it's not compiling.Please help me,as I really want to do it.
I don't know why, but your problem is definitely the fact that your link command that you quoted consists of all libraries and nothing else. You'll have to track down in your Makefile why that is happening, or maybe post your whole project somewhere and someone can take a look.
Here you go,all project files with makefile....but don't expect it to build,it's just a first time build,I just need to get past that !@#% sdl error,then I will try to figure out the rest.Thanks!
Here you go..... You don't put these at the end of the file..... You need to know when and where to use them.... The order of operations is important in makefiles.
I don't know,maybe I'm retarded or something,but after applying your makefile this thing still refuses to build past that error.Does it gets past it if you build it?Maybe I have something wrong in my PSPSDK or SDL?I don't know,but it's really anoying,please help me,so we could end this.
Well, I don't think the CFLAGS needs "-I../uae_cpu". That was part of an example I gave from PSP Basilisk, which DOES need that. He needs all the include paths that are for HIS app here (Xmoto? ).
I've included all files and makefile so could someone please get it past that error?I'm not asking for making all the hard work for me,but just for solving a problem which I can't solve personally - if I could I wouldn't disturb you.Thx.
Because of all those backslashes at the ends of the comment lines, the OBJS= definition is considered part of the preceding comment, and so you are never defining any OBJS. Delete the backslash from the end of "#randtable.$(OBJEXT)", or just remove those commented lines entirely, or add some blank lines between the comments and OBJS, etc.
Strange...... I can get past the SDL issue with my changes unlike before with your original makefile. Perhaps SDL was not compiled and installed properly? I set the following paths within my cygwin batch file....
Because of all those backslashes at the ends of the comment lines, the OBJS= definition is considered part of the preceding comment, and so you are never defining any OBJS. Delete the backslash from the end of "#randtable.$(OBJEXT)", or just remove those commented lines entirely, or add some blank lines between the comments and OBJS, etc.
Yeah,you hit the right spot! That was it! after removing that slash it get past that error........but remembered me another thing I forget...is there a Lua lib for psp(I mean c++ libriary,I know that there's standalone version).And thanks for all people involved in solving this problem! ;-D
I get the same error message, but mine is not caused by a misplaced backslash, the error appears just by renaming the source file from rectangles.c to rectangles.cpp ??.