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

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

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

Post by nDEV »

Here's my code:

#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:
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?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

To use C++, you either need to link with psp-g++ (not psp-gcc), or explicitly add -lstdc++ to the link.
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Post Reply