 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
nDEV
Joined: 13 Apr 2007 Posts: 48
|
Posted: Sun May 20, 2007 7:02 am Post subject: Crazy vector error...dont know what else to try |
|
|
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 |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Sun May 20, 2007 7:40 am Post subject: |
|
|
| To use C++, you either need to link with psp-g++ (not psp-gcc), or explicitly add -lstdc++ to the link. |
|
| Back to top |
|
 |
nDEV
Joined: 13 Apr 2007 Posts: 48
|
Posted: Sun May 20, 2007 8:33 am Post subject: |
|
|
| 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 |
|
 |
|
|
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
|