forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Eclipse, minPSPw and interesting problem

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
SkyWhy



Joined: 22 May 2009
Posts: 4

PostPosted: Fri May 22, 2009 3:26 am    Post subject: Eclipse, minPSPw and interesting problem Reply with quote

I'm currently setting up my PSP toolchain for windows.

I've followed everything in here:
http://www.jetcube.eu/archives/2008/02/entry_72.html

But the problem I run is the fact that when I compile eclipse gives me this error:
Code:
**** Build of configuration Default for project pspHelloWorld ****

make all
psp-gcc -I. -IC:/Programs/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150  -L. -LC:/Programs/pspsdk/psp/sdk/lib   main.o -lstdc++   -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o main.elf
c:/programs/pspsdk/bin/../lib/gcc/psp/4.3.3/../../../../psp/lib/crt0.o: In function `_main':
../../../../pspsdk/src/startup/crt0.c:86: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [main.elf] Error 1


For some reason the _main cannot find the references to main. Is it problem with my makefile or a problem with my setup? Anyone has any ideas how to get this sorted? I'm pretty hungry to start developing for PSP but after two days of fighting with this I'm kind of running out of ideas.

If it helps at all, here is my makefile:
Code:
TARGET = main
OBJS = main.o
LIBS = -lstdc++ 

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = -fno-exceptions -fno-rtti
 
EXTRA_TARGETS = EBOOT.PBP

PSP_EBOOT_TITLE = $(TARGET)

PSPSDK=$(shell psp-config --pspsdk-path)

include $(PSPSDK)/lib/build.mak

%.o: %.cxx
   $(CXX) $(CXXFLAGS) -c -o $@ $<


AND here is my main.c
Code:
#include <pspkernel.h>
#include <pspdebug.h>



/* Define the module info section */
PSP_MODULE_INFO("helloworld", 0, 1, 1);

/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);



int main(int argc, char *argv[])
{
   pspDebugScreenInit();
   pspDebugScreenPrintf("Hello World\n");
   return 0;
}



OH and if it helps, eclipse is complaining the PSP_MODULE_INFO() and PSP_MAIN_THREAD_ATTR() "contain syntax errors".

So if anyone knows where to look or what to do next, do shed some light into my problems.

Thanks guys.


- SkyWhy
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Fri May 22, 2009 4:14 am    Post subject: Reply with quote

replace psp-gcc with psp-g++ in the configuration

i had the same problem
Back to top
View user's profile Send private message
SkyWhy



Joined: 22 May 2009
Posts: 4

PostPosted: Fri May 22, 2009 4:36 am    Post subject: Reply with quote

Thanks for the reply hlide.

Replaced the psp-gcc with psp-g++ from the windows-> preferences, created completely new project with same content in .c file and in MakeFile.

Reports exactly the same error. But one thing I noticed and I don't know is it supposed to be this way.

When I hit build this is what I get:
Code:
make all
psp-gcc -I. -IC:/Programs/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150   -c -o main.o main.c
psp-gcc -I. -IC:/Programs/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150  -L. -LC:/Programs/pspsdk/psp/sdk/lib   main.o -lstdc++   -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o main.elf
c:/programs/pspsdk/bin/../lib/gcc/psp/4.3.3/../../../../psp/lib/crt0.o: In function `_main':
../../../../pspsdk/src/startup/crt0.c:86: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [main.elf] Error 1


After make all, there is still the magical psp-gcc, shouldn't it surely be psp-g++ if I'm not completely mistaken? I checked the project settings and Eclipse preferences and both say it's using the psp-g++, any ideas?
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Fri May 22, 2009 4:56 am    Post subject: Reply with quote

SkyWhy wrote:
Thanks for the reply hlide.

Replaced the psp-gcc with psp-g++ from the windows-> preferences, created completely new project with same content in .c file and in MakeFile.

Reports exactly the same error. But one thing I noticed and I don't know is it supposed to be this way.

When I hit build this is what I get:
Code:
make all
psp-gcc -I. -IC:/Programs/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150   -c -o main.o main.c
psp-gcc -I. -IC:/Programs/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150  -L. -LC:/Programs/pspsdk/psp/sdk/lib   main.o -lstdc++   -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o main.elf
c:/programs/pspsdk/bin/../lib/gcc/psp/4.3.3/../../../../psp/lib/crt0.o: In function `_main':
../../../../pspsdk/src/startup/crt0.c:86: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [main.elf] Error 1


After make all, there is still the magical psp-gcc, shouldn't it surely be psp-g++ if I'm not completely mistaken? I checked the project settings and Eclipse preferences and both say it's using the psp-g++, any ideas?


sorry I thought you were building a C++ project as I did :/. In your case, psp-gcc should be okay at least. Are you sure main.c is providing a main function ?
Back to top
View user's profile Send private message
SkyWhy



Joined: 22 May 2009
Posts: 4

PostPosted: Fri May 22, 2009 5:00 am    Post subject: Reply with quote

I am building a c++ project.

New -> C++ project -> custom tool chain. I just happened to rename the main to main.c which really should not change a thing as far as I know. All though I haven't played around with my own MakeFiles ever. Been a Visual Studio slave for years.

And can I be sure my main is providing main function? As far as I can see, yes.
Code:
#include <pspkernel.h>
#include <pspdebug.h>

PSP_MODULE_INFO("helloworld", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int main(int argc, char *argv[])
{
   pspDebugScreenInit();
   pspDebugScreenPrintf("Hello World\n");
   return 0;
}


Or am I missing out something completely?

EDIT #1:
When it comes to your own MakeFiles, there is a hell of a difference obviously. Just by renaming the main.c to main.cpp and it compiled.. gah!

Anyone any links to tutorials to understand MakeFiles a bit more deeper than this? This is starting to bug me like hell. About time I learned these darn things properly.

And thanks for the tips, got things working now :)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group