Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding header files for size_t and calloc/malloc #39

Open
huahandsome opened this issue Jun 1, 2018 · 0 comments
Open

adding header files for size_t and calloc/malloc #39

huahandsome opened this issue Jun 1, 2018 · 0 comments

Comments

@huahandsome
Copy link

Here looks like a bug in header file: wrappers.hpp

If you disable "MATLAB_MEX_FILE", when building imResamplexxx.cpp, which requires the header file "wrappers.hpp", there is an error:

wrappers.hpp:12:24: error: ‘wrCalloc’ declared as an ‘inline’ variable
inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
^
wrappers.hpp:12:24: error: ‘size_t’ was not declared in this scope
wrappers.hpp:12:36: error: ‘size_t’ was not declared in this scope
inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
^
wrappers.hpp:12:48: error: expression list treated as compound expression in initializer [-fpermissive]
inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
^
wrappers.hpp:12:50: error: expected ‘,’ or ‘;’ before ‘{’ token
inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
^
wrappers.hpp:13:24: error: ‘wrMalloc’ declared as an ‘inline’ variable
inline void* wrMalloc( size_t size ) { return malloc(size); }
^
wrappers.hpp:13:24: error: ‘size_t’ was not declared in this scope
wrappers.hpp:13:38: error: expected ‘,’ or ‘;’ before ‘{’ token
inline void* wrMalloc( size_t size ) { return malloc(size); }
^
wrappers.hpp: In function ‘void wrFree(void*)’:
wrappers.hpp:14:44: error: ‘free’ was not declared in this scope
inline void wrFree( void * ptr ) { free(ptr); }
^
wrappers.hpp: At global scope:
wrappers.hpp:17:17: error: ‘size_t’ was not declared in this scope
void* alMalloc( size_t size, int alignment ) {
^
wrappers.hpp:17:30: error: expected primary-expression before ‘int’
void* alMalloc( size_t size, int alignment ) {
^
wrappers.hpp:17:44: error: expression list treated as compound expression in initializer [-fpermissive]
void* alMalloc( size_t size, int alignment ) {
^
wrappers.hpp:17:46: error: expected ‘,’ or ‘;’ before ‘{’ token
void* alMalloc( size_t size, int alignment ) {

This error can be fixed by adding the two header files:
#include <stdio.h>
#include <stdlib.h>

Please help review and confirm.

Thanks,

Shuai Hua

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant