NO

Author Topic: POLIB Internal error (create_archive_file)  (Read 6931 times)

Offline jj2007

  • Member
  • *
  • Posts: 536
POLIB Internal error (create_archive_file)
« on: December 16, 2012, 03:49:57 AM »
Hello,
I am trying to build the LZMA library, downloaded as lzma920.tar.bz2 from http://www.7-zip.org/sdk.html

The folder in question is LZMA_SDK\C

Error message is:
C\Util\LzmaLib\output\resource.res
POLIB: fatal error: Internal error (create_archive_file).
*** Error code: 1 ***

Thanks in advance!

P.S.: There was another little error before, in C\CpuArch.c
static void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)
...  __asm mov EAX, function;

... resolved as
static void MyCPUID(UInt32 CpuFunction, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)
  __asm mov EAX, CpuFunction

CommonTater

  • Guest
Re: POLIB Internal error (create_archive_file)
« Reply #1 on: December 16, 2012, 03:54:33 AM »
Ok... this is a 3rd party library ... you need to ask questions about it in their forums.
 
Given that it's in tar.bz format, I'm betting you've got linux code there which isn't likely to work on windows.


 

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: POLIB Internal error (create_archive_file)
« Reply #2 on: December 16, 2012, 04:16:57 AM »
Tater, surely.. :o

- it's polib that throws the error, not LZMA - that's why it's called "internal"
- most of the stuff in the LZMA\C folder just builds fine
- and no, it's not Linux code

P.S.: I see you are teaching C to qWord - good project ;-)

CommonTater

  • Guest
Re: POLIB Internal error (create_archive_file)
« Reply #3 on: December 16, 2012, 04:48:12 AM »
Tater, surely.. :o

Surely... If you think it's a bug in POLIB... feel free to make a bug report in the appropriate forum.  But I've seen bad code cause internal errors in both POLIB and POLINK before... it's probably something simple, like a library call that doesn't exist in Pelles or is prefixed with an underscore because it's non-standard ...  You can try checking "Define Compatibility Names" in the compiler settings...

Quote
P.S.: I see you are teaching C to qWord - good project ;-)

Please don't bring stuff from other forums into this one...
We tried that once and it got pretty ugly.
« Last Edit: December 16, 2012, 04:52:40 AM by CommonTater »

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: POLIB Internal error (create_archive_file)
« Reply #4 on: December 16, 2012, 08:20:13 AM »
Tater, surely.. :o

- it's polib that throws the error, not LZMA - that's why it's called "internal"
But that still leaves the possibility of you feeding it some data that is causing that internal error.

A quick look into the makefiles show that there is a reference to
Code: [Select]
!include "../../../CPP/Build.mak" in the ...\C\Util\LzmaLib folder just after an reference to resource.re, which could cause issues if there is some C++ related stuff in there that a plain C compiler like Pelle's C doesn't (properly) processes...
Quote
- most of the stuff in the LZMA\C folder just builds fine
Well, what doesn't? That could give another hint as to what could cause the error...
Quote
- and no, it's not Linux code
Fairly irrelevant, it is supposed to be plain ANSI C and portable between OS's.
It's just that .bz2 files aren't very common in the Windows world, and to an even lesser extend, tar files.

But to find out what is causing the error, you have not provided even remotely enough information in order to reproduce and verify that issue...

Ralf

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: POLIB Internal error (create_archive_file)
« Reply #5 on: December 16, 2012, 09:04:59 AM »
That folder's project is for dll, not for static library.

Resource file have to convert to object-file before inserting library.

May the source be with you

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: POLIB Internal error (create_archive_file)
« Reply #6 on: December 16, 2012, 11:47:37 AM »
But that still leaves the possibility of you feeding it some data that is causing that internal error.

A quick look into the makefiles show that there is a reference to
Code: [Select]
!include "../../../CPP/Build.mak" in the ...\C\Util\LzmaLib folder just after an reference to resource.rc, which could cause issues if there is some C++ related stuff in there that a plain C compiler like Pelle's C doesn't (properly) processes...

Thanks, Ralf. Of course, it's the input that triggers the error, but "internal error" is not very helpful for chasing the problem...

Actually, the library seems to be fine now, see attachment. But I have no clue how to get LZMA_SDK\C\Util\Lzma\LzmaUtil.c working. There is a makefile, but the help of POIDE does not know the word "makefile", and the forum entry found by Google is titled "RESOLVED" but apparently the OP's solution was "I think I will try another IDE" ;-)

LZMA_SDK\C\Util\Lzma\makefile:

MY_STATIC_LINK=1
PROG = LZMAc.exe

CFLAGS = $(CFLAGS) \

LIB_OBJS = \
  $O\LzmaUtil.obj \

C_OBJS = \
  $O\Alloc.obj \
  $O\LzFind.obj \
  $O\LzFindMt.obj \
  $O\LzmaDec.obj \
  $O\LzmaEnc.obj \
  $O\7zFile.obj \
  $O\7zStream.obj \
  $O\Threads.obj \

OBJS = \
  $(LIB_OBJS) \
  $(C_OBJS) \

!include "../../../CPP/Build.mak"

$(LIB_OBJS): $(*B).c
   $(COMPL_O2)
$(C_OBJS): ../../$(*B).c
   $(COMPL_O2)


P.S.: Although the project deals with an archiver (by the way: the best around), the string create_archive_file is not found anywhere in the LZMA folder, so it seems to be a genuine POIDE error message.
« Last Edit: December 16, 2012, 11:52:25 AM by jj2007 »

CommonTater

  • Guest
Re: POLIB Internal error (create_archive_file)
« Reply #7 on: December 16, 2012, 02:10:28 PM »
Quote
C\Util\LzmaLib\output\resource.res
POLIB: fatal error: Internal error (create_archive_file).

As already pointed out... You can't have resource objects in static libraries. 
It's pretty clear from the report that it's choking on a .RES file...

I'm thinking you've downloaded source code for a DLL... and probably should compile it as such.

Finally... the make utility for Pelles C is POMAKE.EXE ... and it is in the help file. 
 
« Last Edit: December 16, 2012, 02:13:43 PM by CommonTater »

CommonTater

  • Guest
Re: POLIB Internal error (create_archive_file)
« Reply #8 on: December 16, 2012, 02:16:25 PM »
$(LIB_OBJS): $(*B).c
$(COMPL_O2)
$(C_OBJS): ../../$(*B).c
$(COMPL_O2)

And this is exactly why I wrote Easy Build... What does that even mean???

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: POLIB Internal error (create_archive_file)
« Reply #9 on: December 16, 2012, 03:41:33 PM »
Quote
C\Util\LzmaLib\output\resource.res
POLIB: fatal error: Internal error (create_archive_file).

As already pointed out... You can't have resource objects in static libraries. 
It's pretty clear from the report that it's choking on a .RES file...

I'm thinking you've downloaded source code for a DLL... and probably should compile it as such.

That's what I am trying now.

Quote
Finally... the make utility for Pelles C is POMAKE.EXE ... and it is in the help file.

POMAKE: Build.mak(90): fatal error: Invalid meta symbol part: B.
 :(

CommonTater

  • Guest
Re: POLIB Internal error (create_archive_file)
« Reply #10 on: December 16, 2012, 04:23:02 PM »
POMAKE: Build.mak(90): fatal error: Invalid meta symbol part: B.

Not unexpected...
There are few things in this world less compatible than various make tools.

The good news is that you are now massaging makefiles rather than waiting for a bugfix...
 
Check in the help file for Command Line Tools -> POMAKE.EXE .... and compare it to whatever make tool they used when building it on Linux... odds are it's a simple fix, just a matter of figuring out what each tool expects.




Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: POLIB Internal error (create_archive_file)
« Reply #11 on: December 16, 2012, 08:51:47 PM »
Thanks, Ralf. Of course, it's the input that triggers the error, but "internal error" is not very helpful for chasing the problem...
My best guess is that this is simply due to a condition that triggers an error/exception withing POLIB that isn't expected and hence not possible to describe better. Unfortunately, I think Pelle will be the only one who could shed a bit more light onto this...
Quote
LZMA_SDK\C\Util\Lzma\makefile:
That is not the makefile you seem to be executing when you get the error of your OP, the only place that resource.res is mentioned is the one in the DLL subfolder! (which is LZMA_SDK\C\Util\LzmaLib\makefile by your naming convention)
Quote
P.S.: Although the project deals with an archiver (by the way: the best around), the string create_archive_file is not found anywhere in the LZMA folder, so it seems to be a genuine POIDE error message.
I have no doubt that the error message is "genuine POIDE" (or POLIB for that matter), but this is as mentioned hard to track down not only for the reason that we don't have the sources for POLIB but also not those of the project that your are trying to compile.

Ralf

PS: "The best" is always a very subjective issue. always depending on someone's needs and preferences. For a lot of things that I am doing, plain old LZA/LHA compression is more than sufficient, both speed, resource and compression ration wise. YMMV...  ;)

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: POLIB Internal error (create_archive_file)
« Reply #12 on: December 17, 2012, 12:25:07 AM »
Quote
LZMA_SDK\C\Util\Lzma\makefile:
That is not the makefile you seem to be executing when you get the error of your OP, the only place that resource.res is mentioned is the one in the DLL subfolder! (which is LZMA_SDK\C\Util\LzmaLib\makefile by your naming convention)

Thanks for this hint.

Quote
PS: "The best" is always a very subjective issue. always depending on someone's needs and preferences. For a lot of things that I am doing, plain old LZA/LHA compression is more than sufficient, both speed, resource and compression ration wise. YMMV...  ;)

Ralf,

You are perfectly right, of course, but hobby coders need little challenges  :)
I got it working now, by the way.