Author Topic: Strange comportment of CB with "duplicate" Open Watcom compiler (version 64 bits  (Read 4422 times)

Offline ThierryD

  • Multiple posting newcomer
  • *
  • Posts: 45
Hi,

I'm very surprize by these strange behavior of CB with two similar configurations of compiler : OW 2.0 version 32 and 64 bits

Explain : I want generate one version of my program with 32 bits version of OW 2.0 and with 64 bits version.
I configured normally directories of binaries and search include + lib for 32 bits version of OW2.0, and all is OK for compil + link.
I "copied" the configuration of OW 32 bits in CB and renamed it for 64 bits (only the directory ot binary change : C:\WATCOM\binnt64) : the new name of compiler is OpenWatcom (W64) Compiler.
When I want compil + link version 64 bits, the syntax for the linker is incorrect :
-------------- Clean: Release OW 64 in Lesson01 (compiler: OpenWatcom (W64) Compiler)---------------

Cleaned "Lesson01 - Release OW 64"

-------------- Build: Release OW 64 in Lesson01 (compiler: OpenWatcom (W64) Compiler)---------------

wcl386.exe -q -c  -dNDEBUG  -bcl=nt   -iC:\WATCOM\h\nt -iC:\WATCOM\h -fo=objOW64\Release\Lesson01.obj Lesson01.c
wrc.exe -q -r -fo=objOW64\Release\Lesson01.res -iC:\WATCOM\h\nt -iC:\WATCOM\h Lesson01.rc
wlink.exe option quiet system nt_win  LIBP  C:\WATCOM\lib386\nt;C:\WATCOM\lib386 objOW64\Release\Lesson01.obj name binOW64\Release\Lesson01.exe library glu32,opengl32,advapi32,comdlg32,gdi32,winmm  objOW64\Release\Lesson01.res
Error! E3033: directive error near 'objOW64\Release\Lesson01.obj'
Process terminated with status 1 (0 minute(s), 1 second(s))
0 error(s), 0 warning(s) (0 minute(s), 1 second(s))

For generate my program with 64 bits version of OW, the real syntax fot linker is :
wlink.exe option quiet debug all system nt_win  LIBP  C:\WATCOM\lib386\nt;C:\WATCOM\lib386 file objOW64\Release\Lesson01.obj name binOW64\Release\Lesson01.exe library glu32,opengl32,advapi32,comdlg32,gdi32,winmm  option resource=objOW64\Release\Lesson01.res.

Thank'you for your help, I don't understand why, therefore with 32 bits version of OW 2.0 it's OK.

Thierry D.

PS : You can test my configuration of CB here : https://github.com/tdechaize/Lesson01    (Lesson02, Lesson03 .... )



Offline stahta01

  • Lives here!
  • ****
  • Posts: 7665
    • My Best Post
Code::Blocks uses X:/folder/bin for the Compiler Paths.
The path needs to end with "bin" as the last folder name to work correctly in most cases.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ThierryD

  • Multiple posting newcomer
  • *
  • Posts: 45
Hello,

Yes, I have configured "Additional Paths" to treated this : C:\watcom\binnt64 for compiler "OpenWatcom (W64) Compiler", like C:\watcom\binnt for compiler "OpenWatcom (W32) Compiler".
Thank's for remark, but is not the problem, because for compiler "OpenWatcom (W32) Compiler", the syntax of linker is OK.
Only the syntax for linker of compiler "OpenWatcom (W64) Compiler" is incorrect.
Thank you again.

Thierry D.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7665
    • My Best Post
Global Compiler Settings
Selected Compiler: Select the one you wish to edit
Click on the tab: "Other Settings" on the far right
Click on the Advanced Settings button
Select the tab "Commands"
Select the command: "Link object files to executable"

What my setup has
Code
$linker option quiet $link_options $libdirs $link_objects name $exe_output $libs $link_resobjects

What you posted seems to want
Code
$linker option quiet $link_options $libdirs $link_objects name $exe_output $libs option resource=$link_resobjects
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ThierryD

  • Multiple posting newcomer
  • *
  • Posts: 45
Strange comportment of CB with "duplicate" Open Watcom compiler (closed)
« Reply #4 on: January 29, 2023, 12:31:58 pm »
Hi

Ok, actions operated on my configuration.
It's not enought because clause "file" to designed object_file is needed by this linker.

The real syntax is :
$linker option quiet $link_options $libdirs file $link_objects name $exe_output $libs option resource=$link_resobjects

With these modified syntax, everything is OK to generated an executable with Open Watcom 2.0, binaries 64 bits (directory C:\watcom\binnt64).
You can close these Topic : it solved.

Thank you very munch Tim.

PS : Maybe to report to master branch of CB.
PS2 : Why generation with Open Watcom 2.0, binaries 32 bits, is OK, the command line for "link object file to executable" present he same syntax anomaly ?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1632
The 64-bit version of OpenWatcom is a fork of the original compiler, so some differences are expected.

Offline ThierryD

  • Multiple posting newcomer
  • *
  • Posts: 45
Hi,

Maybe ... I examine the help of wlink (.ie. "wlink ?") with the two binaries in C:\WATCOM\binnt and in C:\WATCOM\binnt64, and the directive "file" before " object files in the command line of linker seems mandatory with the twice.
But, this is ... search of perfection,   :D ...
After these exchanges, I'm proud to announce all my generation on Windows 11, Debug/Release, 32 bits or 64 bits, with all compilers (Borland, GCC (many configurations), CLANG (many configurations), WATCOM, MSVC, DMC, LCC, Pelles C) are treated correctly with CB in the same project. Consult https://github.com/tdechaize/Lesson01 for example.
Many thank's of devlopers and you.

Thierry D.