Pelles C forum

C language => Beginner questions => Topic started by: t57042 on October 13, 2011, 06:03:00 PM

Title: error when using polib
Post by: t57042 on October 13, 2011, 06:03:00 PM
Hello,

I am trying to use POLIB (version 6.01.0) to make a .lib out of a .obj file, created with minigui.
I get following error message:

POLIB: fatal error : Invalid machinetype in object 'test.obj'

Any help?
thanks
Richard

Title: Re: error when using polib
Post by: CommonTater on October 13, 2011, 09:26:43 PM
First... read up on POLIB in the help file ... help -> Contents-> command line tools -> polib

It would seem the /machine option is missing or incorrect on your POLIB command line... Your choices are

/MACHINE:X86
/MACHINE:AMD64
/MACHINE:ARM
/MACHINE:X64

Title: Re: error when using polib
Post by: t57042 on October 14, 2011, 12:32:25 PM
The problem is, I have no help file. Polib came with Purebasic.

My machine is X86 - windows7
The objectfile is test.obj and the lib should be test.lib

Can you give the syntax??

Thanks
Richard

Title: Re: error when using polib
Post by: TimoVJL on October 14, 2011, 01:43:30 PM
Try this first:
polib.exe test.obj /OUT:test.lib

and tell us what happens?

From help:
Quote
Create or modify a library with POLIB
 
You can use POLIB to create a library. When you do, use the following syntax:

POLIB filespec /OUT:library

The filespec argument specifies the name of one or more object files or libraries. Wildcards are allowed. If there are many files - use a response file.

The result will be written to the file named library.

You can remove members from a library with the following syntax:

POLIB library /REMOVE:member [/REMOVE:member ...]

The member name must be specified exactly as stored, but it is not case sensitive.
Title: Re: error when using polib
Post by: CommonTater on October 14, 2011, 02:12:51 PM
The problem is, I have no help file. Polib came with Purebasic.

Why not just download Pelles C?  It's free and the help file is VERY complete.
Title: Re: error when using polib
Post by: t57042 on October 14, 2011, 04:12:35 PM
Try this first:
polib.exe test.obj /OUT:test.lib:

POLIB: fatal error: Invalid machinetype in object 'test.obj' .

Title: Re: error when using polib
Post by: TimoVJL on October 14, 2011, 05:31:03 PM
Next thing to do is examine that test.obj is proper object-file.
If you have hex-viewer, you can tell us what are first bytes of it.
For x86 they should be 4C 01 ( L and face).

Here is link for good PEView.exe to look into PE COFF files:
http://www.magma.ca/~wjr/PEview.zip (http://www.magma.ca/~wjr/PEview.zip)
Title: Re: error when using polib
Post by: t57042 on October 14, 2011, 06:17:08 PM
First bytes are 80 08
Title: Re: error when using polib
Post by: TimoVJL on October 14, 2011, 07:17:18 PM
So it is OMF-type object-file and polib.exe uses PE-COFF.

Title: Re: error when using polib
Post by: t57042 on October 14, 2011, 07:32:49 PM
Do you know a program  that can I make the conversion?

Thanks
Richard


Title: Re: error when using polib
Post by: CommonTater on October 15, 2011, 02:38:51 AM
Do you know a program  that can I make the conversion?

First check your project types... make sure it's a windows project...

Also, I'd suggest heading over to the PowerBasic forums and informing them of the bug in their compiler...



Title: Re: error when using polib
Post by: Bitbeisser on October 16, 2011, 12:32:23 AM
Also, I'd suggest heading over to the PowerBasic forums and informing them of the bug in their compiler...
I doubt he'll get much help for his PureBasic (http://purebasic.com/) there...  ;)

Was actually more than surprised to see that PureBasic is even using/including some of Pelle's tools (POLINK, POLIB and PORC, with the first one v5.0, the other two v6.0),a s they are claiming to directly create executables...  ???

Ralf
Title: Re: error when using polib
Post by: CommonTater on October 16, 2011, 01:11:24 AM
Also, I'd suggest heading over to the PowerBasic forums and informing them of the bug in their compiler...
I doubt he'll get much help for his PureBasic (http://purebasic.com/) there...  ;)

OOPS... my bad.


Quote
Was actually more than surprised to see that PureBasic is even using/including some of Pelle's tools (POLINK, POLIB and PORC, with the first one v5.0, the other two v6.0),a s they are claiming to directly create executables...  ???

Even more interesting I'm hoping they've dealt with the copright issues...  I'd really hate to see Pelle get ripped off since that is a commercial product.