Pelles C forum

Pelles C => General discussions => Topic started by: Rnard on December 27, 2014, 07:53:40 PM

Title: Problem with LibXls (unresolved external symbol Assert and Errno)
Post by: Rnard on December 27, 2014, 07:53:40 PM
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
Title: Re: Problem with LibXls (unresolved external symbol Assert and Errno)
Post by: frankie on December 27, 2014, 11:52:20 PM
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).
Title: Re: Problem with LibXls (unresolved external symbol Assert and Errno)
Post by: Rnard on December 28, 2014, 08:24:41 AM
Thank you Frankie for your quick reply.
I will try asap with building the library myself, thank you again !
Title: Re: Problem with LibXls (unresolved external symbol Assert and Errno)
Post by: 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!

updated 31.12.14 20:31:00
Title: Re: Problem with LibXls (unresolved external symbol Assert and Errno)
Post by: Rnard on December 30, 2014, 06:43:48 AM
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
Title: Re: Problem with LibXls (unresolved external symbol Assert and Errno)
Post by: czerny on December 30, 2014, 07:38:15 AM
One question: who developed this?
This is developed by me. It is not very well tested. So, please, send me your errors/problems.
Title: Re: Problem with LibXls (unresolved external symbol Assert and Errno)
Post by: jj2007 on December 30, 2014, 07:38:03 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 (http://www.webalice.it/jj2006/MasmBasicQuickReference.htm#Mb1085).
Excel sheets opens fine, but it doesn't write to cell 3,1 - and no error message.
Title: Re: Problem with LibXls (unresolved external symbol Assert and Errno)
Post by: czerny on December 31, 2014, 10:43:14 AM
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.
Title: Re: Problem with LibXls (unresolved external symbol Assert and Errno)
Post by: czerny on December 31, 2014, 02:01:46 PM
This
Code: [Select]
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.
Title: Re: Problem with LibXls (unresolved external symbol Assert and Errno)
Post by: TimoVJL on December 31, 2014, 03:15:39 PM
LibXLS 1.4 example xls2csv.