Hey everyone. I'm working on a program using the awesome ArrayFire Nim.
aftest0.nim
import ArrayFireNim
# that all
Run
compile aftest0.nim
nim c --backend:cpp --passC:-I/opt/ArrayFire-3.8.3-Linux/include
--passL:-L/opt/ArrayFire-3.8.3-Linux/lib64 aftest0.nim
73821 lines; 1.920s; 75.781MiB peakmem; proj: /home/my/test/aftest0.nim; out:
/home/my/test/aftest0 [SuccessX]
The code compiled successfully in nim 1.6.14 version.
but I got an error in nim 2.0.0 version.
Please tell me how to fix.
`/home/my/.cache/nim/aftest0_d/@mArrayFireNim.nim.cpp:42:53:`
error: T1_ was not declared in this scope
> 42 | N_LIB_PRIVATE af::index span__65rray70ire78im_u8759(T1_ );
Error: execution of an external compiler program g++ -c -std=gnu++17
-funsigned-char-w -fmax-errors=3 -fpermissive -pthread -std=c++11
`-g -I/opt/ArrayFire-3.8.3-Linux/include
-I/home/my/.choosenim/toolchains/nim-2.0.0/lib`
`-I/home/my/test -o /home/my/.cache/nim/aftest0_d/@mArrayFireNim.nim.cpp.o`
`/home/my/.cache/nim/aftest0_d/@mArrayFireNim.nim.cpp`
failed with exit code: 1
@mArrayFireNim.nim.cpp v1.6.14
/* Generated by Nim Compiler v1.6.14 */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
g++ -c -std=gnu++14 -funsigned-char-w -fmax-errors=3 -fpermissive
-std=c++11 -g -I/opt/ArrayFire-3.8.3-Linux/include
-I/home/my/.choosenim/toolchains/ nim-1.6.14/lib -I/home/my/test -o
/home/my/.cache/nim/aftest0_d/@mArrayFireNim.nim.cpp.o
/home/my/.cache/nim/aftest0_d/@mArrayFireNim.nim.cpp */
#define NIM_INTBITS 64
#include "nimbase.h"
#include "arrayfire.h"
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0;
nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len;
VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length;
nimFrame((TFrame*)&FR_);
#define nimln_(n, file) \
FR_.line = n; FR_.filename = file;
N_LIB_PRIVATE N_NIMCALL(af::seq, aseq__65rray70ire78im_7881)(NI first, NI
last, NI step);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_2993)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE NIM_CONST int iend__65rray70ire78im_6818 = ((int) -1);
N_LIB_PRIVATE af::index span__65rray70ire78im_7898;
....
}
}
Run
@mArrayFireNim.nim.cpp v2.0.0
/* Generated by Nim Compiler v2.0.0 */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
g++ -c -std=gnu++17 -funsigned-char-w -fmax-errors=3 -fpermissive -pthread
-std=c++11 -g -I/opt/ArrayFire-3.8.3-Linux/include -I/home/my/.choosenim/
toolchains/nim-2.0.0/lib -I/home/my/test -o
/home/my/.cache/nim/aftest0_d/@mArrayFireNim.nim.cpp.o
/home/my/.cache/nim/aftest0_d/@mArrayFireNim.nim.cpp */
#define NIM_INTBITS 64
#include "nimbase.h"
#include "arrayfire.h"
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0;
nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI
len;VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length;
nimFrame((TFrame*)&FR_);
#define nimln_(n) \
FR_.line = n;
#define nimlf_(n, file) \
FR_.line = n; FR_.filename = file;
N_LIB_PRIVATE N_NIMCALL(af::seq, aseq__65rray70ire78im_u8732)(NI first_p0,
NI last_p1, NI step_p2);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4570)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE NIM_CONST int iend__65rray70ire78im_u7521 = ((int)-1);
extern NIM_THREADVAR TFrame* framePtr__system_u4006;
N_LIB_PRIVATE af::index span__65rray70ire78im_u8759(T1_);
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
....
}
}
Run