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

Install Error on mac m2 #73

Open
long568 opened this issue Jun 3, 2024 · 0 comments
Open

Install Error on mac m2 #73

long568 opened this issue Jun 3, 2024 · 0 comments

Comments

@long568
Copy link

long568 commented Jun 3, 2024

The build system shows it can not find malloc / free...

% luarocks install lzmq ZMQ_INCDIR=/opt/homebrew/Cellar/zeromq/4.3.5_1/include
Warning: falling back to wget - install luasec >= 1.1 to get native HTTPS support
Installing https://luarocks.org/lzmq-0.4.4-1.src.rock

lzmq 0.4.4-1 depends on lua >= 5.1, < 5.4 (5.1-1 provided by VM: success)
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -O2 -fPIC -I/Users/lo/Documents/DevTools/lua/include/luajit-2.1 -c src/lzmq.c -o src/lzmq.o -DLUAZMQ_USE_SEND_AS_BUF -DLUAZMQ_USE_TEMP_BUFFERS -DLUAZMQ_USE_ERR_TYPE_OBJECT -I/opt/homebrew/Cellar/zeromq/4.3.5_1/include
src/lzmq.c:371:10: error: call to undeclared library function 'malloc' with type 'void *(unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  dest = LUAZMQ_ALLOC_TEMP(buffer_storage, dest_len);
         ^
src/lzutils.h:90:67: note: expanded from macro 'LUAZMQ_ALLOC_TEMP'
# define LUAZMQ_ALLOC_TEMP(BUF, SIZE) (sizeof(BUF) >= SIZE)?(BUF):malloc(SIZE)
                                                                  ^
src/lzmq.c:371:10: note: include the header <stdlib.h> or explicitly provide a declaration for 'malloc'
src/lzutils.h:90:67: note: expanded from macro 'LUAZMQ_ALLOC_TEMP'
# define LUAZMQ_ALLOC_TEMP(BUF, SIZE) (sizeof(BUF) >= SIZE)?(BUF):malloc(SIZE)
                                                                  ^
src/lzmq.c:374:3: error: call to undeclared library function 'free' with type 'void (void *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  LUAZMQ_FREE_TEMP(buffer_storage, dest);
  ^
src/lzutils.h:91:58: note: expanded from macro 'LUAZMQ_FREE_TEMP'
# define LUAZMQ_FREE_TEMP(BUF, PTR) do{if((PTR) != (BUF))free((void*)PTR);}while(0)
                                                         ^
src/lzmq.c:374:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'free'
src/lzutils.h:91:58: note: expanded from macro 'LUAZMQ_FREE_TEMP'
# define LUAZMQ_FREE_TEMP(BUF, PTR) do{if((PTR) != (BUF))free((void*)PTR);}while(0)
                                                         ^
2 errors generated.

Error: Build error: Failed compiling object src/lzmq.o
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