Author Topic: Open Watcom problems\questions  (Read 10133 times)

Offline madnut.ua

  • Multiple posting newcomer
  • *
  • Posts: 13
  • something mad...
Open Watcom problems\questions
« on: January 06, 2007, 11:20:32 pm »
I try to use Open Watcom with C::B and have some problems with it.

1. I can't specify path of the libs for the linker. wcl386.exe uses wlink directive for it. It's look like:
Code: [Select]
wcl386.exe -"LIBPath <path> ..."where <path> - it is my path for libs. In C::B I can't specify that directive in Settings->Compiler...->Other->Advanced Options->Others, cause path must be in quotes. If I write some like -"LIBPath", than command will be like: wcl386.exe -"LIBPath"c:\bla\bla... - that is incorrect.
Another way. If I write directly in linker field in commands tab -"LIBPath $libdirs", that will be also incorrect, cause all paths in that directive must delimited by ";", not by space as in C::B.
How can I resolve this problem?

2. I can't link resource file to exe. wcl386.exe writes that it unknown object file. I try to use wrc.exe with -zm option for Microsoft .res compatible file, but it also not work. So, what to do?

3. How can I specify PCH file for the project? I try to use -fh option with specify "watcom.pch" file, but while compiling, this file was recreated for every cpp file in the project.

Who can help me with my problems?

imho, some errors in c::b code:
compilerOW.cpp
Code: [Select]
52: m_Programs.MAKE             = wxT("mingw32-make.exe"); // need "wmake.exe"?
...
55: m_Switches.libDirs          = wxT("-L"); // it's not watcom option
...
341: m_RegExes.Add(RegExStruct(_("Note"), cltError, wxT("([A-Za-z0-9_:/\\.-]+)\\(([0-9]+)\\): Note! (.+)"), 3, 1, 2)); // must be cltInfo instead of cltError


p.s. sorry for "nice" English :)
« Last Edit: January 07, 2007, 12:22:01 am by madnut.ua »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Open Watcom problems\questions
« Reply #1 on: January 06, 2007, 11:24:35 pm »
project (or you can even put on compiler level) : Directories tab (or Linker tab maybe for other settins)

Offline madnut.ua

  • Multiple posting newcomer
  • *
  • Posts: 13
  • something mad...
Re: Open Watcom problems\questions
« Reply #2 on: January 06, 2007, 11:48:07 pm »
project (or you can even put on compiler level) : Directories tab (or Linker tab maybe for other settins)

and what? of course, I write my paths here, but full command line looks like:
Code: [Select]
wcl386.exe  -LC:\wxWidgets\lib\wat_dll -LC:\wxWidgets\lib -L..\..\lib -LC:\watcom\libIt's incorrect, cause "-L" - is key for gcc, not for watcom.

Offline madnut.ua

  • Multiple posting newcomer
  • *
  • Posts: 13
  • something mad...
Re: Open Watcom problems\questions
« Reply #3 on: January 06, 2007, 11:59:23 pm »
Also I try to create new project with project wizard. wxWidgets application with watcom compiler. But I get error in script. see attach

C::B SVN rev. 3459

[attachment deleted by admin]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6671
    • My Best Post
Re: Open Watcom problems\questions
« Reply #4 on: January 07, 2007, 03:39:45 am »
project (or you can even put on compiler level) : Directories tab (or Linker tab maybe for other settins)

and what? of course, I write my paths here, but full command line looks like:
Code: [Select]
wcl386.exe  -LC:\wxWidgets\lib\wat_dll -LC:\wxWidgets\lib -L..\..\lib -LC:\watcom\libIt's incorrect, cause "-L" - is key for gcc, not for watcom.

I am trying to verify that  "-L" works or does NOT work, since I have NOT used Watcom C before it might take awhile for me to reach an answer. The documentation implies that it will NOT work.
Tim S

The testing is starting to confirm that "-L" does NOT work as a way to set patch to look for libraries.
« Last Edit: January 07, 2007, 04:34:28 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Open Watcom problems\questions
« Reply #5 on: January 07, 2007, 04:38:20 am »
Official wxWidgets wizard does not support OpenWatcom. So no settings are added for that. The error you are getting in the script is due to some uninitialised variables. Nothing to worry on that.

PCH file should be created first using some header or cpp file. Otherwise you can keep all the header includes in all the cpp file consistent. That means every time the compiler encounters a cpp file PCH mode, it would see that the include headers are similar, and it would not recreate the PCH file.

I'm not sure how OpenWatcom creates PCH file. But you can set some command to create PCH file through wx/wxprec.h and then try to use the generated PCH file.

OpenWatcom is in my to TODO list for wxWidgets project wizard. But I need to know it more before I can start working on it.  :)
Be a part of the solution, not a part of the problem.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6671
    • My Best Post
Re: Open Watcom problems\questions
« Reply #6 on: January 07, 2007, 04:54:44 am »
project (or you can even put on compiler level) : Directories tab (or Linker tab maybe for other settins)

I know what killerbot was talking about now;

He meant that instead of listing the linker directories under "Directories" -> "Linker" to use instead "Linker" -> "Linker other options". This seems to help get past the first errors I was getting, but I am getting other errors because I have no idea on how to use Watcom with wxWidgets.

I added this to "Linker other options" and it seemed to work.
-"libpath C:\wx\inno\wxWidgets\lib\wat_lib"

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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Open Watcom problems\questions
« Reply #7 on: January 07, 2007, 10:41:53 am »
yes, that's what I was suggesting.

@madnut.ua :
1) Can you have more the none LIBPath <path> ... ?
2) Could you give an example where you want to add 2 paths "PathA" and "PathB", preferably each as a separate setting, please give such an example of the full command line.
I will adjust this evening then.

You can already manually change it (look in default.conf in your user-dir\codeblocks : the compiler sets)



Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Open Watcom problems\questions
« Reply #8 on: January 07, 2007, 10:56:32 am »
Quote
If the name of a library file appearing in a "LIBRARY" directive or the the name of an object
file appearing in a "LIBFILE" directive contains a path specification, only the specified path
will be searched.
Note that
libpath path1
libpath path2
is equivalent to the following.
libpath path2;path1

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Open Watcom problems\questions
« Reply #9 on: January 07, 2007, 11:07:30 am »
@madnut.ua

I have the changes ready to commit, but you will have to manually adjust your defaul.conf anyway, unless you delete it [otherwise the changes in the CB soures won't have any effect].

Change this in your default.conf to try out, to see if it works (note nothing to do with wx wizard !!) :
- look for <ow>
- then the subtag <Make> and change from :
Code: [Select]
<MAKE>
<str>
<![CDATA[mingw32-make.exe]]>
</str>
</MAKE>

to
Code: [Select]
<MAKE>
<str>
<![CDATA[wmake.exe]]>
</str>
</MAKE>

then look for the subtag(s) : <switches> <LIBS>
and change from :
Code: [Select]
<LIBS>
<str>
<![CDATA[-L]]>
</str>
</LIBS>
to
Code: [Select]
<LIBS>
<str>
<![CDATA[-LIBpath]]>
</str>
</LIBS>

and finally look for <regex><re001> and change from
Code: [Select]
<TYPE int="2" />
to
Code: [Select]
<TYPE int="0" />
that last one will change it to cltNormal, we don't have cltInfo, so not sure if this will have the desired effect
Please provide a simple line of code that will trigger a *note*. According to the dropdown box the "Info" should map to cltNormal.

Please provide us with your feedback, so I can commit this evening the fixed code.

EDIT : Make sure all cb instances are closed when you make this changes !
« Last Edit: January 07, 2007, 11:10:49 am by killerbot »

Offline madnut.ua

  • Multiple posting newcomer
  • *
  • Posts: 13
  • something mad...
Re: Open Watcom problems\questions
« Reply #10 on: January 07, 2007, 12:15:34 pm »
Thanks all for help! :)

@madnut.ua

Please provide us with your feedback, so I can commit this evening the fixed code.

I already change it before.

But -libpath not work, as I write before.
Quote
If the name of a library file appearing in a "LIBRARY" directive or the the name of an object
file appearing in a "LIBFILE" directive contains a path specification, only the specified path
will be searched.
Note that
libpath path1
libpath path2
is equivalent to the following.
libpath path2;path1

It's docs for wlink.exe. For wcl386.exe directive must be in quotes: -"libpath path1" or -"libpath path1;path2"

Code: [Select]
C:\WATCOM\binnt>wcl386.exe
Open Watcom C/C++32 Compile and Link Utility Version 1.6
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
Usage:  wcl386 [options] file(s)
Options:  ( /option is also accepted )
....
....
                              [Linker options]
-bd  build Dynamic link library       -fm[=<map_file>]  generate map file
-bm  build Multi-thread application   -k<stack_size> set stack size
-br  build with dll run-time library  -l=<os> link for the specified OS
-bw  build default Windowing app.     -x  make names case sensitive
-bcl=<os> compile and link for OS.    @<file> additional directive file
-fd[=<file>[.lnk]] write directives   -"<linker directives>"
-fe=<executable> name executable file

See -"<linker directives>"
wcl386.exe translate this line to wlink for parsing. so it must be in quotes. Else I get error, cause wcl386.exe parse it as "-l=<os> link for the specified OS".

Here my full command line:
Code: [Select]
-------------- Build: cdc_u_release_dll_28_watcom in cdc ---------------
Skipping file (no compiler program set): ..\..\src\wx_pch.h
wcl386.exe -q  -LIBpathC:\wxWidgets\lib\wat_dll -LIBpathC:\wxWidgets\lib -LIBpath..\..\lib -LIBpathC:\watcom\lib 
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\CCrypter\crypter.obj
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\DES\des.obj
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\app.obj
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\wx_pch.obj
...
...
-fe=..\..\..\bin\cb_unicode_release_dll_watcom\cdc.exe wxmsw28u_html.lib wxbase28u_xml.lib wxmsw28u_adv.lib wxmsw28u_core.lib wxbase28u.lib sqlite3.lib  ..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\res\cdc.obj
Warning! W1107: file __wcl__.lnk: line(2): undefined system name: IBpathC:\watcom\lib
Error! E3146: ..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\res\cdc.obj is an invalid object file
Error: Linker returned a bad status
Process terminated with status 1 (0 minutes, 6 seconds)
0 errors, 0 warnings

if I remove .res file form link process:
was
$linker -q $link_options $libdirs $link_objects -fe=$exe_output $libs $link_resobjects
to
$linker -q $link_options $libdirs $link_objects -fe=$exe_output $libs
I got:
Code: [Select]
-------------- Build: cdc_u_release_dll_28_watcom in cdc ---------------
Skipping file (no compiler program set): ..\..\src\wx_pch.h
wcl386.exe -q  -libpathC:\wxWidgets\lib\wat_dll -libpathC:\wxWidgets\lib -libpath..\..\lib -libpathC:\watcom\lib 
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\CCrypter\crypter.obj
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\DES\des.obj
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\app.obj
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\wx_pch.obj
...
...
-fe=..\..\..\bin\cb_unicode_release_dll_watcom\cdc.exe wxmsw28u_html.lib wxbase28u_xml.lib wxmsw28u_adv.lib wxmsw28u_core.lib wxbase28u.lib sqlite3.lib
Warning! W1107: file __wcl__.lnk: line(2): undefined system name: ibpathC:\watcom\lib
Warning! W1008: cannot open wxmsw28u_html.lib : No such file or directory
Warning! W1008: cannot open wxbase28u_xml.lib : No such file or directory
Warning! W1008: cannot open wxmsw28u_adv.lib : No such file or directory
Warning! W1008: cannot open wxmsw28u_core.lib : No such file or directory
Warning! W1008: cannot open wxbase28u.lib : No such file or directory
Warning! W1008: cannot open sqlite3.lib : No such file or directory
Error! E2028: near wxHtmlWindow::~wxHtmlWindow() is an undefined reference
Error! E2028: void near wxHtmlWindow::SetHTMLWindowTitle( wxString const near & ) is an undefined reference
Error! E2028: void near wxHtmlWindow::OnHTMLLinkClicked( wxHtmlLinkInfo const near & ) is an undefined reference
Error! E2028: wxHtmlOpeningStatus near wxHtmlWindow::OnHTMLOpeningURL( wxHtmlURLType, wxString const near &, wxString near * ) const is an undefined reference
Error! E2028: wxPoint near wxHtmlWindow::HTMLCoordsToWindow( wxHtmlCell near *, wxPoint const near & ) const is an undefined reference
Error! E2028: wxWindow near * near wxHtmlWindow::GetHTMLWindow() is an undefined reference
Error! E2028: wxColour near wxHtmlWindow::GetHTMLBackgroundColour() const is an undefined reference
Error! E2028: void near wxHtmlWindow::SetHTMLBackgroundColour( wxColour const near & ) is an undefined reference
Error! E2028: void near wxHtmlWindow::SetHTMLBackgroundImage( wxBitmap const near & ) is an undefined reference
Error! E2028: void near wxHtmlWindow::SetHTMLStatusText( wxString const near & ) is an undefined reference
Error! E2028: wxCursor near wxHtmlWindow::GetHTMLCursor( wxHtmlWindowInterface::HTMLCursor ) const is an undefined reference
Error! E2028: ___wcpp_4_fs_handler_ is an undefined reference
Error! E2028: near wxWindowBase::wxWindowBase() is an undefined reference
Error! E2028: void near wxWindow::Init() is an undefined reference
Error! E2028: near wxBaseArrayLong::wxBaseArrayLong() is an undefined reference
...
...

If I write full path for .lib files I've got:
Code: [Select]
-------------- Build: cdc_u_release_dll_28_watcom in cdc ---------------
Skipping file (no compiler program set): ..\..\src\wx_pch.h
wcl386.exe -q  -libpathC:\wxWidgets\lib\wat_dll -libpathC:\wxWidgets\lib -libpath..\..\lib -libpathC:\watcom\lib 
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\CCrypter\crypter.obj
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\DES\des.obj
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\app.obj
..\..\..\bin\cb_unicode_release_dll_watcom\.objs\src\wx_pch.obj
...
...
-fe=..\..\..\bin\cb_unicode_release_dll_watcom\cdc.exe C:\wxWidgets\lib\wat_dll\wxmsw28u_html.lib C:\wxWidgets\lib\wat_dll\wxbase28u_xml.lib C:\wxWidgets\lib\wat_dll\wxmsw28u_adv.lib C:\wxWidgets\lib\wat_dll\wxmsw28u_core.lib C:\wxWidgets\lib\wat_dll\wxbase28u.lib ..\..\lib\sqlite3.lib
Warning! W1107: file __wcl__.lnk: line(2): undefined system name: ibpathC:\watcom\lib
Error! E2028: ___wcpp_4_fs_handler_ is an undefined reference
Error! E2028: __wcpp_4_dtor_array_store__ is an undefined reference
Error! E2028: void near operator delete []( void near * ) is an undefined reference
Error! E2028: void near operator delete( void near * ) is an undefined reference
Error! E2028: __imp_free_ is an undefined reference
Error! E2028: __imp_wcslen_ is an undefined reference
Error! E2028: void near * near operator new( int unsigned ) is an undefined reference
Error! E2028: __imp_realloc_ is an undefined reference
Error! E2028: __imp_malloc_ is an undefined reference
Error! E2028: __imp_memset_ is an undefined reference
Error! E2028: __imp__stprintf_ is an undefined reference
Error! E2028: __wcpp_4_pure_error__ is an undefined reference
Error! E2028: __wcpp_4_undefed_cdtor__ is an undefined reference
Error! E2028: __compiled_under_NT is an undefined reference
Error! E2028: __CHK is an undefined reference
Error! E2028: __wcpp_4_lcl_register__ is an undefined reference
Error! E2028: __wcpp_4_destruct_all__ is an undefined reference
Error! E2028: __wcpp_4_destruct__ is an undefined reference
Error! E2028: void near * near operator new []( int unsigned ) is an undefined reference
Error! E2028: __wcpp_4_ctor_array_storage_gs__ is an undefined reference
Error! E2028: __imp_memcpy_ is an undefined reference
Error! E2028: __imp_strlen_ is an undefined reference
Error! E2028: __wcpp_4_rethrow__ is an undefined reference
Error! E2028: _setjmp_ is an undefined reference
...
...

But if I write libs path in Linker tab like: -"libpath C:\watcom\lib",
c::b translate it to command line like: wcl386.exe "-"libpath C:\watcom\lib"" ...
so it doesn't work(
« Last Edit: January 07, 2007, 12:20:32 pm by madnut.ua »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Open Watcom problems\questions
« Reply #11 on: January 07, 2007, 01:00:46 pm »
what if we specify as program for "Linker for dynamic libs" (no idea what will happen for exe's) : wlink.exe
(For static libs wa also specify wlib.exe) instead of wcl386.exe

Maybe we need an extra program : Linker for executables. ???

[EDIT] For MSVC the link.exe specified for dll's is also used (I guess) for exe's.
[EDIT2] : I think it's better to directly use the wlink instead of the wcl386, those i do all programs that then call other's , pff ;-)
« Last Edit: January 07, 2007, 01:04:57 pm by killerbot »

Offline severach

  • Multiple posting newcomer
  • *
  • Posts: 44
Re: Open Watcom problems\questions
« Reply #12 on: January 08, 2007, 09:36:19 pm »
C::B is a long way off from proper Watcom support. I now build my projects in the Watcom IDE to find out what the proper command lines are and transfer them over to C::B.