Author Topic: newbie here, need help in compiling to 64-bit  (Read 69 times)


  • Newbie
  • *
  • Posts: 3
    • View Profile
newbie here, need help in compiling to 64-bit
« on: February 02, 2020, 06:25:21 PM »
after some trial an error I managed to compile to 32-bit, but how do I compile for 64-bit?
specifically this web app here
I have Mingw32 and Mingw64 (msys2), PellesC x64 and lcc x64 installed
I edited PW.bat replacing x86 with x64 but I get the error "BCX_SlideShow.c(443): error #2206: No support for inline assembly code on this target machine."
PW.bat modified
Code: [Select]
@rem Created with Bldbat v.3.0.0 for PellesC (GUI)
IF NOT EXIST %1.c GOTO usage
CALL "C:\Program Files\PellesC\Bin\povars64.bat"
IF EXIST %1.res GOTO res
IF NOT EXIST "res\%~1.rc" GOTO nores
ECHO Compiling resources.....
"C:\Program Files\PellesC\Bin\porc.exe" "res\%~1.rc" /i res /fo "%~1.res"
IF EXIST %1.res SET PRES="%~1.res"
ECHO Compiling "%~1.c"..........
"C:\Program Files\PellesC\Bin\pocc.exe" /W0 /Ot /Go /Gd /Ze /Zx /Tx64-coff "%~1.c"
ECHO Linking ................
"C:\Program Files\PellesC\Bin\polink.exe" /release /machine:x64 /subsystem:windows "%~1.obj" %PRES% %2 %3 %4 %5 %6 %7 %8 %9 /out:"%~1.exe"
ECHO Finished!
IF EXIST "%~1.obj" del "%~1.obj"
GOTO done
ECHO **************************************************************
ECHO  Usage:  PW.BAT MainFile  ExtraFile1 ExtraFile2 ExtraFile3
ECHO  Note:   ExtraFiles can be .libs, .res , .obj
ECHO          Compile a GUI mode program with Pelle's C.
ECHO **************************************************************
« Last Edit: February 02, 2020, 06:31:04 PM by jbk »


  • Administrator
  • Full Member
  • *****
  • Posts: 218
    • View Profile
Re: newbie here, need help in compiling to 64-bit
« Reply #1 on: February 02, 2020, 07:01:51 PM »
Any BCX code that you find that uses Dynaload can only be compiled for 32-bit. 

For example, inside you will find several examples of this, such as :

 AtlAxWinInit (LIB DllPath$)   ... the LIB tells you that BCX is using Dynaload, part of the BCX runtime library.

Below is my batch file for compiling a 64-bit GUI app using Pelles C 9.0

You might need to edit the PATHS

Code: [Select]
@ECHO off

SET  PellesCDir=C:\PellesC
SET  PATH=%PellesCDir%\Bin;%PATH%
SET  INCLUDE=%PellesCDir%\Include;%PellesCDir%\Include\Win;%INCLUDE%
SET  LIB=%PellesCDir%\Lib;%PellesCDir%\Lib\Win64;%LIB%

SET  PoccOPTS=/Go /Gn /W1 /Gd /Ze /Zx -Tamd64-coff /D_WIN32_WINNT=0x501  /std:c17
SET  PolinkOPTS=/release /machine:X64 /subsystem:windows,5.01 /STACK:10485760               
SET  PolinkLIBS=kernel32.lib advapi32.lib delayimp.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib ole32.lib oleaut32.lib

ECHO Pelles C is compiling %1 as a 64-bit Gui app
call c:\pellesc\bin\pocc   %PoccOPTS%    %1.c
call c:\pellesc\bin\polink %PolinkLIBS%  %PolinkOPTS%    %1.obj %2 %3 %4 %5 %6 %7 %8 %9
ECHO Completed ...
GOTO done

ECHO **************************************************************
ECHO  For building 64-bit Gui apps using Pelles C Compiler
ECHO  Usage:   PW64   "C" FileName  [Optional Linker Files: 2-9]
ECHO  Example: PW64    MyGuiApp      MyIcons.res   MyManifest.res
ECHO **************************************************************


  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: newbie here, need help in compiling to 64-bit
« Reply #2 on: February 02, 2020, 07:10:43 PM »
thanks MrBcx  :)