Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

When I compiling my project with rvct:
OBJECT AutorizationForm.o c:\BREW\ARM\bin\armcpp -c -DDYNAMIC_APP --cpu ARM7TDMI --apcs /ropi/interwork/norwpi --littleend --split_sections --no_exceptions --force_new_nothrow -g -D__USE__STD__NAMESPACE__ -D__XMLRPC_NAMESPACE__ -Ospace -O2 --thumb -I. -IC:\PROGRA~1\BREW31~1.5\sdk\inc -o AutorizationForm.o c:\Projects\Brew\SONOMO~1\src\forms\AutorizationForm.cpp "c:\BREW\ARM\include/new",
line 58: Error: #536: exception specification is incompatible with that of previous function "operator new(std::size_t)" (declared at line 12 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h"): previously specified: no exceptions will be thrown void *operator new(std::size_t) throw(std::bad_alloc); ^ "c:\BREW\ARM\include/new",
line 61: Error: #536: exception specification is incompatible with that of previous function "operator delete" (declared at line 17 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h") void operator delete(void*) throw (); ^ "c:\BREW\ARM\include/new",
line 77: Error: #536: exception specification is incompatible with that of previous function "operator new[](std::size_t)" (declared at line 22 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h"): previously specified: no exceptions will be thrown void *operator new[](std::size_t) throw(std::bad_alloc); ^ "c:\BREW\ARM\include/new",
line 80: Error: #536: exception specification is incompatible with that of previous function "operator delete[]" (declared at line 27 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h") void operator delete[](void*) throw (); ^ c:\Projects\Brew\SONOMO~1\src\forms\AutorizationForm.cpp: 0 warnings, 4 errors NMAKE : fatal error U1077: 'c:\BREW\ARM\bin\armcpp' : return code '0x1' Stop.

I have overloaded operator's new and delete...

What is going wrong with my code? - Maybe this is trivial, but I have no ideas yet...

mr.j8 wrote:When I compiling my project with rvct:
OBJECT AutorizationForm.o c:\BREW\ARM\bin\armcpp -c -DDYNAMIC_APP --cpu ARM7TDMI --apcs /ropi/interwork/norwpi --littleend --split_sections --no_exceptions --force_new_nothrow -g -D__USE__STD__NAMESPACE__ -D__XMLRPC_NAMESPACE__ -Ospace -O2 --thumb -I. -IC:\PROGRA~1\BREW31~1.5\sdk\inc -o AutorizationForm.o c:\Projects\Brew\SONOMO~1\src\forms\AutorizationForm.cpp "c:\BREW\ARM\include/new",
line 58: Error: #536: exception specification is incompatible with that of previous function "operator new(std::size_t)" (declared at line 12 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h"): previously specified: no exceptions will be thrown void *operator new(std::size_t) throw(std::bad_alloc); ^ "c:\BREW\ARM\include/new",
line 61: Error: #536: exception specification is incompatible with that of previous function "operator delete" (declared at line 17 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h") void operator delete(void*) throw (); ^ "c:\BREW\ARM\include/new",
line 77: Error: #536: exception specification is incompatible with that of previous function "operator new[](std::size_t)" (declared at line 22 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h"): previously specified: no exceptions will be thrown void *operator new[](std::size_t) throw(std::bad_alloc); ^ "c:\BREW\ARM\include/new",
line 80: Error: #536: exception specification is incompatible with that of previous function "operator delete[]" (declared at line 27 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h") void operator delete[](void*) throw (); ^ c:\Projects\Brew\SONOMO~1\src\forms\AutorizationForm.cpp: 0 warnings, 4 errors NMAKE : fatal error U1077: 'c:\BREW\ARM\bin\armcpp' : return code '0x1' Stop.
I have overloaded operator's new and delete...
What is going wrong with my code? - Maybe this is trivial, but I have no ideas yet...
when you pass --force_new_nothrow to the compiler, the overrided new operator should not throw std::bad_alloc.
Also, are you sure you can generate a working mod file using the rvct 2.2 compiler? As far as I know, the compiler do not support some essential C++ features( most notablely the virtual functions ) when ropi is ON. Have you tested any C++ programs on the new elf2mod unitlity yet?

mr.j8 wrote:When I compiling my project with rvct:
OBJECT AutorizationForm.o c:\BREW\ARM\bin\armcpp -c -DDYNAMIC_APP --cpu ARM7TDMI --apcs /ropi/interwork/norwpi --littleend --split_sections --no_exceptions --force_new_nothrow -g -D__USE__STD__NAMESPACE__ -D__XMLRPC_NAMESPACE__ -Ospace -O2 --thumb -I. -IC:\PROGRA~1\BREW31~1.5\sdk\inc -o AutorizationForm.o c:\Projects\Brew\SONOMO~1\src\forms\AutorizationForm.cpp "c:\BREW\ARM\include/new",
line 58: Error: #536: exception specification is incompatible with that of previous function "operator new(std::size_t)" (declared at line 12 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h"): previously specified: no exceptions will be thrown void *operator new(std::size_t) throw(std::bad_alloc); ^ "c:\BREW\ARM\include/new",
line 61: Error: #536: exception specification is incompatible with that of previous function "operator delete" (declared at line 17 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h") void operator delete(void*) throw (); ^ "c:\BREW\ARM\include/new",
line 77: Error: #536: exception specification is incompatible with that of previous function "operator new[](std::size_t)" (declared at line 22 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h"): previously specified: no exceptions will be thrown void *operator new[](std::size_t) throw(std::bad_alloc); ^ "c:\BREW\ARM\include/new",
line 80: Error: #536: exception specification is incompatible with that of previous function "operator delete[]" (declared at line 27 of "c:\Projects\Brew\SONOMO~1\src\forms\.\..\PlatformSpecific.h") void operator delete[](void*) throw (); ^ c:\Projects\Brew\SONOMO~1\src\forms\AutorizationForm.cpp: 0 warnings, 4 errors NMAKE : fatal error U1077: 'c:\BREW\ARM\bin\armcpp' : return code '0x1' Stop.
I have overloaded operator's new and delete...
What is going wrong with my code? - Maybe this is trivial, but I have no ideas yet...
when you pass --force_new_nothrow to the compiler, the overrided new operator should not throw std::bad_alloc.
Also, are you sure you can generate a working mod file using the rvct 2.2 compiler? As far as I know, the compiler do not support some essential C++ features( most notablely the virtual functions ) when ropi is ON. Have you tested any C++ programs on the new elf2mod unitlity yet?

Nope, this should be my first...
Now, I'm trying to compile some simple example... I need C++ 'cause it gives ability to manage big projects more effectively...
Worst thing - it's complies in dll for simulator without any problems, so, it's hard to track where code is become wrong... Actually, I've removed all virtual functoins and destructors, but it didn't hepl...
Maybe templates makes my code uncompilable? Is it possible?

Nope, this should be my first...
Now, I'm trying to compile some simple example... I need C++ 'cause it gives ability to manage big projects more effectively...
Worst thing - it's complies in dll for simulator without any problems, so, it's hard to track where code is become wrong... Actually, I've removed all virtual functoins and destructors, but it didn't hepl...
Maybe templates makes my code uncompilable? Is it possible?

Using template is ok as long as you do not get any compiler or linker error.
I think it is a good idea to test your program on the ads 1.2 compiler and make sure it works since it is the only offically supported compiler so far.
After that, you can try the Gcc and rvct 2.2 plus the new elf2mod utility.

Using template is ok as long as you do not get any compiler or linker error.
I think it is a good idea to test your program on the ads 1.2 compiler and make sure it works since it is the only offically supported compiler so far.
After that, you can try the Gcc and rvct 2.2 plus the new elf2mod utility.

I've compiled simple c++ app whithout any problems(...gain *.mod file)
But, when I'm including - errors comes back...
I suspect, the only reason of this all is a memory allocation stuff...
So, modification of *.h files, which responds for memory can help, probaby,
this errors i've get after overloading new/del and modifying
(only 2 lines):
TARGET C:\PROJECTS\BREW\BrewCpp\BrewCpp.elf c:\BREW\ARM\bin\armlink -o C:\PROJECTS\BREW\BrewCpp\BrewCpp.elf --ropi --remove --rwpi --entry 0x8000 AEEAPP~1.o AEEMOD~1.o BrewCpp.o --first AEEMod_Load
Error: L6265E: Non-RWPI Section BrewCpp.o(.bss__ZNSs9__nullrefE) cannot be assigned to PI Exec region ER_ZI.
Error: L6248E: BrewCpp.o(i._ZN7BrewCppC1Ev) in PI region 'ER_RO' cannot have address type relocation to std::basic_string, std::allocator>::__nullref in PI region 'ER_ZI'.
Error: L6248E: BrewCpp.o(i._ZN7BrewCppD1Ev) in PI region 'ER_RO' cannot have address type relocation to std::basic_string, std::allocator>::__nullref in PI region 'ER_ZI'.
Finished: 0 information, 0 warning and 3 error messages. NMAKE : fatal error U1077: 'c:\BREW\ARM\bin\armlink' : return code '0x1' Stop.
this is code: i've change in
#ifndef __BREW__MEMORY__MODEL__
//thi is oroginal code... without changes...
_RWSTD_EXPORT void* __rw_allocate (_RWSTD_C::size_t, int = 0);
_RWSTD_EXPORT void __rw_deallocate (void*, _RWSTD_C::size_t, int = 0);
#else
// this was added:
void* __rw_allocate (_RWSTD_C::size_t sz, int num = 0){
return MALLOC((num) ? sz*num : sz);
;
void __rw_deallocate (void* p, _RWSTD_C::size_t, int = 0){
FREE(p);
;
#endif
and,of course, i'm including "aeestllib.h" in that case...
Without this stuff i'm getting next errors:
TARGET C:\PROJECTS\BREW\BrewCpp\BrewCpp.elf
c:\BREW\ARM\bin\armlink -o C:\PROJECTS\BREW\BrewCpp\BrewCpp.elf --ropi --remove --rwpi --entry 0x8000 AEEAPP~1.o AEEMOD~1.o BrewCpp.o --first AEEMod_Load
Error: L6265E: Non-RWPI Section libspace.o(.bss) cannot be assigned to PI Exec region ER_ZI.
Error: L6265E: Non-RWPI Section vendor.o(.bss__ZNSs9__nullrefE) cannot be assigned to PI Exec region ER_ZI.
Error: L6248E: libspace.o(.text) in PI region 'ER_RO' cannot have address type relocation to __libspace_start in PI region 'ER_ZI'.
Error: L6248E: arm_exceptions_globs.o(.text) in PI region 'ER_RO' cannot have address type relocation to __default_terminate_handler() in PI region 'ER_RO'.
Error: L6248E: sys_stackheap.o(.text) in PI region 'ER_RO' cannot have address type relocation to Image$$ZI$$Limit in PI region 'ER_ZI'.
Error: L6248E: BrewCpp.o(i._ZN7BrewCppC1Ev) in PI region 'ER_RO' cannot have address type relocation to std::basic_string, std::allocator>::__nullref in PI region 'ER_ZI'.
Error: L6248E: BrewCpp.o(i._ZN7BrewCppD1Ev) in PI region 'ER_RO' cannot have address type relocation to std::basic_string, std::allocator>::__nullref in PI region 'ER_ZI'.
Error: L6248E: new.o(i._Znwj) in PI region 'ER_RO' cannot have address type relocation to __default_new_handler() in PI region 'ER_RO'.
Finished: 0 information, 0 warning and 8 error messages.
NMAKE : fatal error U1077: 'c:\BREW\ARM\bin\armlink' : return code '0x1'
Stop.
maybe, I have to includ esome additional libs in case, I use STL?( to get vaild std::basic_string, std::allocator>::__nullref structure) ...and no code modifications needed???

I've compiled simple c++ app whithout any problems(...gain *.mod file)
But, when I'm including - errors comes back...
I suspect, the only reason of this all is a memory allocation stuff...
So, modification of *.h files, which responds for memory can help, probaby,
this errors i've get after overloading new/del and modifying
(only 2 lines):
TARGET C:\PROJECTS\BREW\BrewCpp\BrewCpp.elf c:\BREW\ARM\bin\armlink -o C:\PROJECTS\BREW\BrewCpp\BrewCpp.elf --ropi --remove --rwpi --entry 0x8000 AEEAPP~1.o AEEMOD~1.o BrewCpp.o --first AEEMod_Load
Error: L6265E: Non-RWPI Section BrewCpp.o(.bss__ZNSs9__nullrefE) cannot be assigned to PI Exec region ER_ZI.
Error: L6248E: BrewCpp.o(i._ZN7BrewCppC1Ev) in PI region 'ER_RO' cannot have address type relocation to std::basic_string, std::allocator>::__nullref in PI region 'ER_ZI'.
Error: L6248E: BrewCpp.o(i._ZN7BrewCppD1Ev) in PI region 'ER_RO' cannot have address type relocation to std::basic_string, std::allocator>::__nullref in PI region 'ER_ZI'.
Finished: 0 information, 0 warning and 3 error messages. NMAKE : fatal error U1077: 'c:\BREW\ARM\bin\armlink' : return code '0x1' Stop.
this is code: i've change in
#ifndef __BREW__MEMORY__MODEL__
//thi is oroginal code... without changes...
_RWSTD_EXPORT void* __rw_allocate (_RWSTD_C::size_t, int = 0);
_RWSTD_EXPORT void __rw_deallocate (void*, _RWSTD_C::size_t, int = 0);
#else
// this was added:
void* __rw_allocate (_RWSTD_C::size_t sz, int num = 0){
return MALLOC((num) ? sz*num : sz);
;
void __rw_deallocate (void* p, _RWSTD_C::size_t, int = 0){
FREE(p);
;
#endif
and,of course, i'm including "aeestllib.h" in that case...
Without this stuff i'm getting next errors:
TARGET C:\PROJECTS\BREW\BrewCpp\BrewCpp.elf
c:\BREW\ARM\bin\armlink -o C:\PROJECTS\BREW\BrewCpp\BrewCpp.elf --ropi --remove --rwpi --entry 0x8000 AEEAPP~1.o AEEMOD~1.o BrewCpp.o --first AEEMod_Load
Error: L6265E: Non-RWPI Section libspace.o(.bss) cannot be assigned to PI Exec region ER_ZI.
Error: L6265E: Non-RWPI Section vendor.o(.bss__ZNSs9__nullrefE) cannot be assigned to PI Exec region ER_ZI.
Error: L6248E: libspace.o(.text) in PI region 'ER_RO' cannot have address type relocation to __libspace_start in PI region 'ER_ZI'.
Error: L6248E: arm_exceptions_globs.o(.text) in PI region 'ER_RO' cannot have address type relocation to __default_terminate_handler() in PI region 'ER_RO'.
Error: L6248E: sys_stackheap.o(.text) in PI region 'ER_RO' cannot have address type relocation to Image$$ZI$$Limit in PI region 'ER_ZI'.
Error: L6248E: BrewCpp.o(i._ZN7BrewCppC1Ev) in PI region 'ER_RO' cannot have address type relocation to std::basic_string, std::allocator>::__nullref in PI region 'ER_ZI'.
Error: L6248E: BrewCpp.o(i._ZN7BrewCppD1Ev) in PI region 'ER_RO' cannot have address type relocation to std::basic_string, std::allocator>::__nullref in PI region 'ER_ZI'.
Error: L6248E: new.o(i._Znwj) in PI region 'ER_RO' cannot have address type relocation to __default_new_handler() in PI region 'ER_RO'.
Finished: 0 information, 0 warning and 8 error messages.
NMAKE : fatal error U1077: 'c:\BREW\ARM\bin\armlink' : return code '0x1'
Stop.
maybe, I have to includ esome additional libs in case, I use STL?( to get vaild std::basic_string, std::allocator>::__nullref structure) ...and no code modifications needed???