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 

Crazy vector error...dont know what else to try

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



Joined: 13 Apr 2007
Posts: 48

PostPosted: Sun May 20, 2007 7:02 am    Post subject: Crazy vector error...dont know what else to try Reply with quote

Here's my code:

Quote:


#include <oslib/oslib.h>
//#include "core.h"
#include <vector>
PSP_MODULE_INFO("APP", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
int main()
{
std::vector<OSL_IMAGE*> v;

OSL_IMAGE *T;
T=oslLoadImageFile("TEST.PNG", OSL_IN_RAM, OSL_PF_5551);
v.push_back(T);

return 0;
}



and HERE'S THE error:
Quote:

C:\pspdev\APP>make
psp-g++ -I. -Ic:/pspdev/psp/sdk/include -G4 -Wall -O2 -I. -Ic:/pspdev/psp/sdk/i
nclude -G4 -Wall -O2 -fno-exceptions -fno-rtti -c -o main.o main.cpp
psp-gcc -I. -Ic:/pspdev/psp/sdk/include -G4 -Wall -O2 -L. -Lc:/pspdev/psp/sdk/
lib main.o core.o -losl -lpng -lz -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppo
wer -lpspgu -lpspaudiolib -lpspaudio -lm -lmad -lpspdebug -lpspdisplay -lpspge -
lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -l
psputility -lpspuser -lpspkernel -o APP.elf
main.o: In function `main':
main.cpp:(.text+0x64): undefined reference to `operator delete(void*)'
main.o: In function `std::vector<OSL_IMAGE*, std::allocator<OSL_IMAGE*> >::_M_in
sert_aux(__gnu_cxx::__normal_iterator<OSL_IMAGE**, std::vector<OSL_IMAGE*, std::
allocator<OSL_IMAGE*> > >, OSL_IMAGE* const&)':
main.cpp:(.gnu.linkonce.t._ZNSt6vectorIP9OSL_IMAGESaIS1_EE13_M_insert_auxEN9__gn
u_cxx17__normal_iteratorIPS1_S3_EERKS1_[std::vector<OSL_IMAGE*, std::allocator<O
SL_IMAGE*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<OSL_IMAGE**, std::vecto
r<OSL_IMAGE*, std::allocator<OSL_IMAGE*> > >, OSL_IMAGE* const&)]+0xd4): undefin
ed reference to `operator new(unsigned int)'
main.cpp:(.gnu.linkonce.t._ZNSt6vectorIP9OSL_IMAGESaIS1_EE13_M_insert_auxEN9__gn
u_cxx17__normal_iteratorIPS1_S3_EERKS1_[std::vector<OSL_IMAGE*, std::allocator<O
SL_IMAGE*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<OSL_IMAGE**, std::vecto
r<OSL_IMAGE*, std::allocator<OSL_IMAGE*> > >, OSL_IMAGE* const&)]+0x130): undefi
ned reference to `operator delete(void*)'
main.cpp:(.gnu.linkonce.t._ZNSt6vectorIP9OSL_IMAGESaIS1_EE13_M_insert_auxEN9__gn
u_cxx17__normal_iteratorIPS1_S3_EERKS1_[std::vector<OSL_IMAGE*, std::allocator<O
SL_IMAGE*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<OSL_IMAGE**, std::vecto
r<OSL_IMAGE*, std::allocator<OSL_IMAGE*> > >, OSL_IMAGE* const&)]+0x17c): undefi
ned reference to `std::__throw_length_error(char const*)'
main.cpp:(.gnu.linkonce.t._ZNSt6vectorIP9OSL_IMAGESaIS1_EE13_M_insert_auxEN9__gn
u_cxx17__normal_iteratorIPS1_S3_EERKS1_[std::vector<OSL_IMAGE*, std::allocator<O
SL_IMAGE*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<OSL_IMAGE**, std::vecto
r<OSL_IMAGE*, std::allocator<OSL_IMAGE*> > >, OSL_IMAGE* const&)]+0x184): undefi
ned reference to `std::__throw_bad_alloc()'
collect2: ld returned 1 exit status
make: *** [APP.elf] Error 1


HOLY f**...why im getting this?
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sun May 20, 2007 7:40 am    Post subject: Reply with quote

To use C++, you either need to link with psp-g++ (not psp-gcc), or explicitly add -lstdc++ to the link.
Back to top
View user's profile Send private message
nDEV



Joined: 13 Apr 2007
Posts: 48

PostPosted: Sun May 20, 2007 8:33 am    Post subject: Reply with quote

jimparis wrote:
To use C++, you either need to link with psp-g++ (not psp-gcc), or explicitly add -lstdc++ to the link.



wow , it worked.
Really weird...i made a test c++ project and it worked without this option.

Anyway , really thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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