xlsxwriter installation for C on windows -


i new in c , trying manipulate same data files , export them in excel file.

similar case running libxlsxwriter on windows, trying install libxlsxwriter on windows usingmsys2.

i have done far:

1) installed msys2 64 bit along installation instructions

2) msys2 terminal pacman -s git gcc make zlib-devel

3) , also:

git clone https://github.com/jmcnamara/libxlsxwriter.git  michkon@michkon-pc msys ~ $ cd libxlsxwriter  michkon@michkon-pc msys ~/libxlsxwriter $ make make[1]: entering directory '/home/michkon/libxlsxwriter/third_party/minizip' make[1]: leaving directory '/home/michkon/libxlsxwriter/third_party/minizip' make[1]: entering directory '/home/michkon/libxlsxwriter/third_party/tmpfileplus' make[1]: leaving directory '/home/michkon/libxlsxwriter/third_party/tmpfileplus' make[1]: entering directory '/home/michkon/libxlsxwriter/src' make[1]: leaving directory '/home/michkon/libxlsxwriter/src'   michkon@michkon-pc msys ~/libxlsxwriter $ make install  michkon@michkon-pc msys ~/libxlsxwriter $ cc myexcel.c -o myexcel -lxlsxwriter /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x1bc9): undefined reference `crc32' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x1bc9): relocation truncated fit: r_x86_64_pc32 against undefined symbol `crc32' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x1d1f): undefined reference `deflate' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x1d1f): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflate' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2280): undefined reference `deflate' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2280): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflate' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x238a): undefined reference `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x238a): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x25e6): undefined reference `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x25e6): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2649): undefined reference `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2649): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2e06): undefined reference `deflateinit2_' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2e06): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflateinit2_' collect2: error: ld returned 1 exit status  michkon@michkon-pc msys ~/libxlsxwriter $ ./myexcel bash: ./myexcel: no such file or directory  michkon@michkon-pc msys ~/libxlsxwriter $ cc myexcel.c -o myexcel -lxlsxwriter /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x1bc9): undefined reference `crc32' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x1bc9): relocation truncated fit: r_x86_64_pc32 against undefined symbol `crc32' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x1d1f): undefined reference `deflate' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x1d1f): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflate' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2280): undefined reference `deflate' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2280): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflate' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x238a): undefined reference `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x238a): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x25e6): undefined reference `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x25e6): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2649): undefined reference `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2649): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflateend' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2e06): undefined reference `deflateinit2_' /usr/lib/../lib/libxlsxwriter.a(zip.o):zip.c:(.text+0x2e06): relocation truncated fit: r_x86_64_pc32 against undefined symbol `deflateinit2_' collect2: error: ld returned 1 exit status  michkon@michkon-pc msys ~/libxlsxwriter $ ./myexcel bash: ./myexcel: no such file or directory  michkon@michkon-pc msys ~/libxlsxwriter $ xdg-open myexcel.xlsx bash: xdg-open: command not found  michkon@michkon-pc msys ~/libxlsxwriter $ cc myexcel.c -o myexcel -i /path/to/libxlsxwriter/include /tmp/ccp8qmt9.o:myexcel.c:(.text+0x15): undefined reference `workbook_new' /tmp/ccp8qmt9.o:myexcel.c:(.text+0x15): relocation truncated fit: r_x86_64_pc 32 against undefined symbol `workbook_new' /tmp/ccp8qmt9.o:myexcel.c:(.text+0x2a): undefined reference `workbook_add_worksheet' /tmp/ccp8qmt9.o:myexcel.c:(.text+0x2a): relocation truncated fit: r_x86_64_pc 32 against undefined symbol `workbook_add_worksheet' /tmp/ccp8qmt9.o:myexcel.c:(.text+0x64): undefined reference `worksheet_write_string' /tmp/ccp8qmt9.o:myexcel.c:(.text+0x64): relocation truncated fit: r_x86_64_pc 32 against undefined symbol `worksheet_write_string' /tmp/ccp8qmt9.o:myexcel.c:(.text+0x70): undefined reference `workbook_close' /tmp/ccp8qmt9.o:myexcel.c:(.text+0x70): relocation truncated fit: r_x86_64_pc 32 against undefined symbol `workbook_close' collect2: error: ld returned 1 exit status  michkon@michkon-pc msys ~/libxlsxwriter $ ./myexcel bash: ./myexcel: no such file or directory  michkon@michkon-pc msys ~/libxlsxwriter $ cc myexcel.c -o myexcel -i /path/to/libxlsxwriter/lib/libxlsxwiter.a -lz /tmp/ccgsiylm.o:myexcel.c:(.text+0x15): undefined reference `workbook_new' /tmp/ccgsiylm.o:myexcel.c:(.text+0x15): relocation truncated fit: r_x86_64_pc 32 against undefined symbol `workbook_new' /tmp/ccgsiylm.o:myexcel.c:(.text+0x2a): undefined reference `workbook_add_worksheet' /tmp/ccgsiylm.o:myexcel.c:(.text+0x2a): relocation truncated fit: r_x86_64_pc 32 against undefined symbol `workbook_add_worksheet' /tmp/ccgsiylm.o:myexcel.c:(.text+0x64): undefined reference `worksheet_write_string' /tmp/ccgsiylm.o:myexcel.c:(.text+0x64): relocation truncated fit: r_x86_64_pc 32 against undefined symbol `worksheet_write_string' /tmp/ccgsiylm.o:myexcel.c:(.text+0x70): undefined reference `workbook_close' /tmp/ccgsiylm.o:myexcel.c:(.text+0x70): relocation truncated fit: r_x86_64_pc 32 against undefined symbol `workbook_close' collect2: error: ld returned 1 exit status  michkon@michkon-pc msys ~/libxlsxwriter $ make myexcel cc     myexcel.c   -o myexcel /tmp/ccmi33kf.o:myexcel.c:(.text+0x15): undefined reference `workbook_new' /tmp/ccmi33kf.o:myexcel.c:(.text+0x15): relocation truncated fit: r_x86_64_pc32 against undefined symbol `workbook_new' /tmp/ccmi33kf.o:myexcel.c:(.text+0x2a): undefined reference `workbook_add_worksheet' /tmp/ccmi33kf.o:myexcel.c:(.text+0x2a): relocation truncated fit: r_x86_64_pc32 against undefined symbol `workbook_add_worksheet' /tmp/ccmi33kf.o:myexcel.c:(.text+0x64): undefined reference `worksheet_write_string' /tmp/ccmi33kf.o:myexcel.c:(.text+0x64): relocation truncated fit: r_x86_64_pc32 against undefined symbol `worksheet_write_string' /tmp/ccmi33kf.o:myexcel.c:(.text+0x70): undefined reference `workbook_close' /tmp/ccmi33kf.o:myexcel.c:(.text+0x70): relocation truncated fit: r_x86_64_pc32 against undefined symbol `workbook_close' 

collect2: error: ld returned 1 exit status make: *** [: myexcel] error 1

michkon@michkon-pc msys ~/libxlsxwriter $ 

so doesn't seem work @ end. there no exe file created. seems last 3 commands ordering compileing, wrong header files...

thank time

edit:

so have looked deeper solution: running libxlsxwriter on windows seems have similar problem carl.

make not work except if place .c file inside 1 of predefined files examples, through command window can compile , run it. know if there can done in order able compile , run files normally, other c files through devc++.

i tried adding c:\msys64\usr\bin in user , computer path (environment variables) doesn't seem work.

thank time!

it should work according instructions. re-ran them check , worked:

# install mysys2 http://www.msys2.org/ # example below used msys2-x86_64-20161025.exe  # run mysys2 shell , install dependencies: $ cd /tmp $ pacman -s git gcc make zlib-devel  # clone, make, , install libxlswriter: $ git clone https://github.com/jmcnamara/libxlsxwriter.git $ cd libxlsxwriter/ $ make $ make install  # create sample c test file in directory: $ cd .. $ mkdir mytmp $ cd mytmp $ vim myexcel.c $ cat myexcel.c #include "xlsxwriter.h"  int main() {     lxw_workbook  *workbook  = workbook_new("myexcel.xlsx");     lxw_worksheet *worksheet = workbook_add_worksheet(workbook, null);     int row = 0;     int col = 0;      worksheet_write_string(worksheet, row, col, "hello me!", null);      return workbook_close(workbook); }  # compile , run application: $ cc myexcel.c -o myexcel -lxlsxwriter -lz $ ./myexcel.exe  $ ls -ltr total 1077 -rw-r--r-- 1 jmcnamara domain users     313 apr  6 19:02 myexcel.c -rwxr-xr-x 1 jmcnamara domain users 1093488 apr  6 19:03 myexcel.exe -rw-r--r-- 1 jmcnamara domain users    5254 apr  6 19:03 myexcel.xlsx 

the issues seeing due header/library not been found double check installation stage.

also, isn't same issue other question linked to. in case had mix or 32 , 64bit libraries causing link issues. author of libxlsxwriter, btw.


Comments