Hello,
I got segmentation fault for this code:
#include <iostream>
#define PACKAGE_VERSION "2.3.4"
#include "xlslib.h"
using namespace std;
using namespace xlslib_core;
int main (int argc, char * const argv[]) {
workbook wb;
worksheet* sh = wb.sheet("Тексты");
worksheet* sh2 = wb.sheet("Контактная информация");
int err = wb.Dump("testCPP.xls");
return 0;
}
Can you please help me.
This is documented somewhere. you MUST create at least one cell in each sheet. This is a bug in xlslib, but a very difficult bug to find! I have personally fixed it once several years ago but it keeps popping up!
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Thanks for reply but this code also throws this fault:
#include <iostream>
#define PACKAGE_VERSION "2.3.4"
#include "xlslib.h"
using namespace std;
using namespace xlslib_core;
int main (int argc, char * const argv[]) {
workbook wb;
worksheet* sh = wb.sheet("Sheet 1");
worksheet* sh2 = wb.sheet("Sheet 2");
worksheet* sh3 = wb.sheet("Sheet 3");
// Title
sh->blank(0, 0);
sh->label(0,1,"test");
sh2->blank(0, 0);
sh2->label(0, 1, "test1");
sh3->blank(0, 0);
sh3->label(0, 1, "test2");
int err = wb.Dump("testCPP.xls");
return 0;
}
Your latest code looks fine. I really don't have any clue what the problem might be. Ah, the joy of open source that needs to run on huge numbers of software platforms.
All I can say is that hundreds of people are using this library and its quite stable now.
Did the test programs build? You did run ,/configure right? So, assuming you did:
./configure
make
did you try
make check
did it pass?
If that crashed, then try to bootstrap config:
./bootstrap
./configure
make
make check
Is the directory you are trying to dump the file to writeable? You might try: wb.Dump("/tmp/testCPP.xls");
If all else fails,I believe you are going to need to run this program with a debugger like gdb to find out where and why its crashing.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
I'm quite newby in this area. Maybe it is my fault. I'll investigate. Thanks!
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
It was my fault.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Last edit: Anonymous 2017-10-09