Hi,
When I use Pelles C 32-bit and compile this code using cc main.c, it works.
#include <stdio.h>
int main(void) {
printf("hello\n");
return 0;
}
However, using the 64-bit version of Pelles C, also using cc main.c, I get a long list of errors like this:
...
POLINK: error: Unresolved external symbol '__imp__DeleteFileA@4'.
POLINK: fatal error: 34 unresolved external(s).
Well, you get a linker error, not a compilation error.
Do you do this on the same machine or on two different ones?
What are the linker options passed to cc in either case?
Ralf
Try these.
cc -Tx86-coff hello.c -libpath:"%PellesCDir%\lib\win" -Fohello32.exe
cc -Tamd64-coff hello.c -libpath:"%PellesCDir%\lib\win64" -Fohello64.exe
EDIT: Fix path names with spaces and -Fo syntax.
Quote from: Bitbeisser on February 02, 2013, 07:50:33 PM
Well, you get a linker error, not a compilation error.
Do you do this on the same machine or on two different ones?
What are the linker options passed to cc in either case?
Ralf
Quote from: timovjl on February 03, 2013, 09:52:25 AM
Try these.
cc -Tx86-coff hello.c -libpath:%PellesCDir%\lib\win -Fo:hello32.exe
cc -Tamd64-coff hello.c -libpath:%PellesCDir%\lib\win64 -Fo:hello64.exe
Okay, I've figured it out. It seems that the default target is set to
Tx86-coff for both 32-bit and 64-bit versions of POCC, but the library path is set to Lib\Win64\ by default in the 64-bit version, causing a conflict. By tweaking your lines timov, I reached to this:
The trailing backslash is important.
cc hello.c -libpath:"C:\Program Files\PellesC\Lib\Win\"
cc -Tamd64-coff hello.c