Post: C++ Conflict with Functions help
05-25-2017, 03:48 PM #1
KazzyOFM
NextGenUpdate Elite
(adsbygoogle = window.adsbygoogle || []).push({}); Hey guys, so my problem i started to get these Undefined reference '_exit' and three others. So i looked up a fix and found i needed to add :
    void* malloc(uint32_t a_uiSize) {
sys_addr_t l_uiAddr;
a_uiSize = ((a_uiSize + 65536) / 65536) * 65536;

sys_memory_allocate(a_uiSize, SYS_MEMORY_PAGE_SIZE_64K, &l_uiAddr);

return (void*)l_uiAddr;
}
void free(void* a_Addr) {
sys_memory_free((sys_addr_t)a_Addr);
}


But this didnt seem to fix my issue, infact i ended up getting a conflict:
    1>C:\ Desktop\Infinity V2 Source\VFunctions.h(305,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(307,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(309,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(311,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(313,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(315,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(317,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(319,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(321,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Menu.h(45,1): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Menu.h(93,84): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\Menu.h(94,84): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,62): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,67): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,72): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,77): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,85): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,93): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(119,6): error 736: function "malloc(std::uint32_t)" conflicts with using-declaration of function "std::malloc(std::size_t)"
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(127,6): error 736: function "free(void *)" conflicts with using-declaration of function "std::free(void *)"
1>
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.42
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


So my problem is how do i solve the conflicts with malloc(std::uint32_t) and "std::malloc(std::size_t)" Smile any help is much appreciated
Last edited by KazzyOFM ; 05-25-2017 at 04:35 PM.
05-27-2017, 04:19 AM #2
KazzyOFM
NextGenUpdate Elite
Bumpp
05-27-2017, 04:00 PM #3
SC58
Former Staff
Originally posted by KazzyOFM View Post
Hey guys, so my problem i started to get these Undefined reference '_exit' and three others. So i looked up a fix and found i needed to add :
    void* malloc(uint32_t a_uiSize) {
sys_addr_t l_uiAddr;
a_uiSize = ((a_uiSize + 65536) / 65536) * 65536;

sys_memory_allocate(a_uiSize, SYS_MEMORY_PAGE_SIZE_64K, &l_uiAddr);

return (void*)l_uiAddr;
}
void free(void* a_Addr) {
sys_memory_free((sys_addr_t)a_Addr);
}


But this didnt seem to fix my issue, infact i ended up getting a conflict:
    1>C:\ Desktop\Infinity V2 Source\VFunctions.h(305,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(307,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(309,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(311,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(313,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(315,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(317,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(319,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(321,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Menu.h(45,1): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Menu.h(93,84): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\Menu.h(94,84): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,62): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,67): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,72): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,77): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,85): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,93): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(119,6): error 736: function "malloc(std::uint32_t)" conflicts with using-declaration of function "std::malloc(std::size_t)"
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(127,6): error 736: function "free(void *)" conflicts with using-declaration of function "std::free(void *)"
1>
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.42
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


So my problem is how do i solve the conflicts with malloc(std::uint32_t) and "std::malloc(std::size_t)" Smile any help is much appreciated


use this

    
CDECL_BEGIN
void * _sys_malloc(size_t size);
void _sys_free(void *ptr);
CDECL_END
05-27-2017, 05:03 PM #4
KazzyOFM
NextGenUpdate Elite
Originally posted by SC58 View Post
use this

    
CDECL_BEGIN
void * _sys_malloc(size_t size);
void _sys_free(void *ptr);
CDECL_END



i still get the conflicts :/
06-05-2017, 04:34 AM #5
Yo Kazzy you remember me? i'm E7ite (e7iteBO2 on PS3) Whats your skype? I dont think i have u
06-08-2017, 11:41 PM #6
matrixmods
Pokemon Trainer
Originally posted by KazzyOFM View Post
Hey guys, so my problem i started to get these Undefined reference '_exit' and three others. So i looked up a fix and found i needed to add :
    void* malloc(uint32_t a_uiSize) {
sys_addr_t l_uiAddr;
a_uiSize = ((a_uiSize + 65536) / 65536) * 65536;

sys_memory_allocate(a_uiSize, SYS_MEMORY_PAGE_SIZE_64K, &l_uiAddr);

return (void*)l_uiAddr;
}
void free(void* a_Addr) {
sys_memory_free((sys_addr_t)a_Addr);
}


But this didnt seem to fix my issue, infact i ended up getting a conflict:
    1>C:\ Desktop\Infinity V2 Source\VFunctions.h(305,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(307,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(309,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(311,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(313,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(315,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(317,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(319,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Functions.h(321,15): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Menu.h(45,1): warning 176: subscript out of range
1>
1>C:\ Desktop\Infinity V2 Source\V2\Menu.h(93,84): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\Menu.h(94,84): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,62): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,67): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,72): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,77): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,85): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(104,93): warning 68: integer conversion resulted in a change of sign
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(119,6): error 736: function "malloc(std::uint32_t)" conflicts with using-declaration of function "std::malloc(std::size_t)"
1>
1>C:\ Desktop\Infinity V2 Source\V2\prx.cpp(127,6): error 736: function "free(void *)" conflicts with using-declaration of function "std::free(void *)"
1>
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.42
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


So my problem is how do i solve the conflicts with malloc(std::uint32_t) and "std::malloc(std::size_t)" Smile any help is much appreciated


my guess is you have 'using namespace std' that your malloc and free function are also trying to use.
06-09-2017, 06:32 AM #7
KazzyOFM
NextGenUpdate Elite
Originally posted by matrixmods View Post
my guess is you have 'using namespace std' that your malloc and free function are also trying to use.


holy shit thanks i forgot to even check that xD

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo