Problem with LibXls (unresolved external symbol Assert and Errno)

Started by Rnard, December 27, 2014, 07:53:40 PM

Previous topic - Next topic

Rnard

Hi All,
i found by accident an interesting library which allows to access and read an excel file (http://libxls.sourceforge.net/).

I included the library name (libxlsreader.a) within Project options -> Linker etc.,

but i got the following error message:

POLINK: error: Unresolved external symbol '__errno'.
POLINK: error: Unresolved external symbol '__assert'.
POLINK: fatal error: 2 unresolved external(s).

I did many many attempts to try to solve this: including assert.h and errno.h, linking to several other libraries etc. but nothing to do.
But it compiles correctly in Codeblocks - MinGW.

What else could i do, to solve this ?

As an alternative, can you suggest me another library that allows access to Xls spreadsheets, and works fine with Pelles ?

Thank you in advance and kind regards !
Rnard

frankie

The problem is that the library you're atrying to use is built against MSVCRT.lib that gives a different name to the two symbols not found in PellesC runtime libraries.
You have two options:
- link your program against msvcrt.lib (be sure to select 'Omit default library names in object files' from compiler tab).
- (preferred one) Rebuild the library with PellesC (I will try myself as soon as I'll have time).
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Rnard

Thank you Frankie for your quick reply.
I will try asap with building the library myself, thank you again !

czerny

Maybe this is from some use vor you!

This module uses DDEML to talk with excel. An example is included. I have not tested this very much! So, be carfull!

updated 31.12.14 20:31:00

Rnard

Czerny,
I have no chance to test it before early January but i had a look at the two .c examples in the zipped file, and this looks fantastic !

Looks simple to handle and exactly what i was looking for, thank you!

One question: who developed this?
I was just thinking that, on the developer's webpage, some other interesting stuff can be found.

Thank you again for you hint, i think i will "replace" libxls with the library you just sent me!!!

Roberto

czerny

Quote from: Rnard on December 30, 2014, 06:43:48 AM
One question: who developed this?
This is developed by me. It is not very well tested. So, please, send me your errors/problems.

jj2007

Quote from: czerny on December 29, 2014, 12:59:10 PM
Maybe this is from some use vor you!

This module uses DDEML to talk with excel. An example is included. I have not tested this very much! So, be carfull!

Nice! Reminds me of my own attempts.
Excel sheets opens fine, but it doesn't write to cell 3,1 - and no error message.

czerny

Quote from: jj2007 on December 30, 2014, 07:38:03 PM
Excel sheets opens fine, but it doesn't write to cell 3,1 - and no error message.
I can not reproduce the problem on my system. Will test it on a quicker computer in 2015!

But there is an other one: XLSExec works with an call to DdeClientTransaction  where the timeout flag is set to TIMEOUT_ASYNC.
This works ok if this was not the last XLSExec call bevor an XLSClose. So it would be better to set this parameter to an explicit timeout value, say 3000.

czerny

This
ShellExecute(0, "open", "C:\\test.xls", 0, 0, SW_SHOWMINIMIZED);
is not working (open not minimized).

Is this Excel specific, or what?

SW_HIDE dowsn't work either. But SW_SHOWMAXIMIZED works.

TimoVJL

LibXLS 1.4 example xls2csv.
May the source be with you