Closed mearcla closed 9 months ago
You need to tell gcc where to find the zfp headers and library. Assuming you're in the examples directory and have already built the zfp library, add -I../include -L../lib -lzfp
to the compile line. If you're using GNU make, then you could also build the examples just by typing make BUILD_EXAMPLES=1
in the top-level zfp directory.
Thanks for your answer, I use this command \ZFP-master\examples>g++ -I../include -L../lib -lzfp simple.c -o a
And I got on this errors!
simple.c: In function 'int compress(double*, int, int, int, double, int)':
simple.c:47:12: error: 'stream_open' was not declared in this scope
stream = stream_open(buffer, bufsize);
^~~~~~~~~~~
simple.c:47:12: note: suggested alternative: 'zfp_stream_open'
stream = stream_open(buffer, bufsize);
^~~~~~~~~~~
zfp_stream_open
simple.c:74:3: error: 'stream_close' was not declared in this scope
stream_close(stream);
^~~~~~~~~~~~
simple.c:74:3: note: suggested alternative: 'zfp_stream_close'
stream_close(stream);
^~~~~~~~~~~~
zfp_stream_close
simple.c: In function 'int main(int, char**)':
simple.c:90:25: error: invalid conversion from 'void*' to 'double*' [-fpermissive]
double* array = malloc(nx * ny * nz * sizeof(double));
~~~
```~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is C, not C++ code. Try compiling with gcc instead of g++.
They're all declared in include/zfp.h
and defined in src/zfp.c
(except stream_open()
and stream_close()
, which you'll find in include/zfp/bitstream.inl
).
Did you try compiling with gcc (not g++)? Some linkers require that libraries appear at the end. Try gcc -I../include -L../lib simple.c -o a -lzfp
.
@mearcla Are you still having issues? If not, I'd like to go ahead and close this issue.
@mearcla I'm going to go ahead and close this issue for now. If you are still having problems feel free to reopen.
Hello, I am trying to use zfp on windows to compressed my dataset so I started from the simple.c file that compressed 3D array, I am trying to run this code by using this command
gcc -o a simple.c
is that correct ?I got on these errors:
Please can you help me how to use zfp on windows ? Where can I found these functions please?