mex c compile using arc4random_uniform gets undefined reference to `arc4random_uniform' collect2.exe: error: ld returned 1 exit status
显示 更早的评论
I am trying to install SPIKY on Matlab 2019b which has as part of the SPIKY install the mex script:
mex -Dchar16_t=uint16_T SPIKE_order_surro_MEX.c
The program
SPIKE_order_surro_MEX.c
contains the following:
while (sc<num_swaps) {
brk=0;
coin=arc4random_uniform(num_coins)+1; // get random integer
The compile generates the following error:
Building with 'MinGW64 Compiler (C)'
.
Error using mex
C:\Users\RobLe\AppData\Local\Temp\mex_57607468677249_25364\SPIKE_order_surro_MEX.obj:SPIKE_order_surro_MEX.c:(.text+0x1d0): undefined reference to
`arc4random_uniform'
collect2.exe: error: ld returned 1 exit status
Error in SPIKY_compile_MEX (line 27)
mex -Dchar16_t=uint16_T SPIKE_order_surro_MEX.c
Any idea how I fix this ?
Thanks
6 个评论
Jan
2019-11-24
What is SPIKY? Can you provide a link to this software package? Did you contact the authors already?
ROBERT LENZIE
2019-11-24
James Tursa
2019-11-25
Can you find the functions arc4random or arc4random_uniform anywhere in your source code?
ROBERT LENZIE
2019-12-1
ROBERT LENZIE
2019-12-1
ROBERT LENZIE
2019-12-1
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!