Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Linking issue with OpenWatcom 1.6

(1/3) > >>

Biplab:
The C::B support for OpenWatcom seems to be bit broken. The linking process works when we're using it for Console apps or Win32 GUI app, but fails if I'm creating wxWidgets project. I'm also getting similar error messages as posted in the following bug report.


--- Quote ---https://developer.berlios.de/bugs/?func=detailbug&bug_id=8391&group_id=5358
--- End quote ---

The problem is, wcl386.exe does not responds to -L flag which has been used to specify library directories. I could not get explanation in their documentation, but -l flag is basically used to specify platform. I'm getting the following error.


--- Quote ---wcl386.exe -q -d2 -q -bt=nt -r  -LC:\wxMSW-2.9.0\lib\wat_dll -LC:\watcom\lib  obj\Debug\TestMain.obj obj\Debug\TestApp.obj  -fe=bin\Debug\Test.exe wxmsw29ud.lib  obj\Debug\resource.res
Warning! W1107: file __wcl__.lnk: line(3): undefined system name: C:\watcom\lib
Warning! W1008: cannot open wxmsw29ud.lib : No such file or directory
--- End quote ---

There are two possible solutions.
1. Provide the library with their full path name. I prefixed library with it's absolute path and it worked. See the following log.

--- Quote ---wcl386.exe -q -d2 -q -bt=nt -r  -LC:\wxMSW-2.9.0\lib\wat_dll -LC:\watcom\lib  obj\Debug\TestMain.obj obj\Debug\TestApp.obj  -fe=bin\Debug\Test.exe ..\..\wxMSW-2.9.0\lib\wat_dll\wxmsw29ud.lib  obj\Debug\resource.res
Warning! W1107: file __wcl__.lnk: line(3): undefined system name: C:\watcom\lib
Process terminated with status 0 (0 minutes, 15 seconds)
2 errors, 2 warnings
--- End quote ---
Though it shows 2 errors, but it compiles and links successfully.

2. Create a file, e.g., minimal.lbc with the following content.

--- Quote ---option quiet
name wat_msw\minimal.exe
option caseexact
   libpath .\..\..\lib\wat_lib system nt_win ref '_WinMain@16'
file wat_msw\minimal_minimal.obj
library wxmsw28_core.lib
library wxbase28.lib
library wxtiff.lib
library wxjpeg.lib
library wxpng.lib
library wxzlib.lib
library wxregex.lib
library wxexpat.lib
library kernel32.lib
library user32.lib
library gdi32.lib
library comdlg32.lib
library winspool.lib
library winmm.lib
library shell32.lib
library comctl32.lib
library ole32.lib
library oleaut32.lib
library uuid.lib
library rpcrt4.lib
library advapi32.lib
library wsock32.lib
library odbc32.lib
option resource=wat_msw\minimal_sample.res

--- End quote ---

and then pass it to wlink.exe as -


--- Quote ---wlink @minimal.lbc
--- End quote ---

This does the trick. Second one I got from minimal sample of wx.

Which one can be implemented quickly in C::B?

Regards,

Biplab

mandrav:

--- Quote ---Which one can be implemented quickly in C::B?
--- End quote ---

Adding the full path can already be done. Nothing to implement in this case.
The second workaround (create an external file) is not going to be implemented (like it hasn't for other compilers/linkers too).


--- Quote ---
--- Code: ---option caseexact
   libpath .\..\..\lib\wat_lib system nt_win ref '_WinMain@16'
--- End code ---

--- End quote ---

There has to be a way to pass this option in the command line (so both of your workarounds would become obsolete). Unfortunately I don't have OW installed here so I can't look for it...

Biplab:
I'm also curious
--- Quote from: mandrav on February 26, 2007, 05:27:29 pm ---Adding the full path can already be done. Nothing to implement in this case.

--- End quote ---

Ok, I'll read the SDK.


--- Quote from: mandrav on February 26, 2007, 05:27:29 pm ---Adding the full path can already be done. Nothing to implement in this case.
The second workaround (create an external file) is not going to be implemented (like it hasn't for other compilers/linkers too).


--- Quote ---
--- Code: ---option caseexact
   libpath .\..\..\lib\wat_lib system nt_win ref '_WinMain@16'
--- End code ---

--- End quote ---

There has to be a way to pass this option in the command line (so both of your workarounds would become obsolete). Unfortunately I don't have OW installed here so I can't look for it...

--- End quote ---

Yesterday I tried to find some option in their official manual. I couldn't find it even after a long search. I can only say OW is Full of Different Compiler Options. ;)

Biplab:
@Mandrav,

I've found a Good solution to this problem. The following option will fix this issue.

--- Code: ---/"LIBP <LibDir>"
--- End code ---

I've fixed this issue and created a patch. The patch will improve the OpenWatcom support to a great extent. I'm posting the changes in details for your information.

Major Changes:

* Removes the registry key check during auto-detection. I've found that OpenWatcom (OW) does not create any registry key.
* Lib-dir include option has been fixed. Now OW will properly search libraries in provided directory.
* Appropriate IncludeDirs , Library Dirs and Resource Include Dirs have been added. OW will Not complain about wrong lib directory.
* A Linker Library Directory Generator function has been added to supply OW with properly formatted Lib-dir include option.
* Fixed issue with parsing Warning Notes as Error Messages. Now it should properly report Warnings and Errors in Build-log.
I've tested this with a sample wxWidgets project. I'm posting the build-log.

--- Quote ----------------- Build: Release in Test ---------------
wcl386.exe -q -c -d__WXMSW__ -d__WINDOWS__ -d_WINDOWS -dWXUSINGDLL -dUNICODE -bm -br -bw -bt=nt -zq -xr -xs -wcd=549 -wcd=656 -wcd=657 -wcd=667 -wx -ox -ot  -iC:\wxMSW-2.9.0\include -iC:\wxMSW-2.9.0\contrib\include -iC:\wxMSW-2.9.0\lib\wat_dll\mswu -iC:\watcom\h -iC:\watcom\h\nt  -fo=obj\Release\TestMain.obj TestMain.cpp
TestMain.cpp(83): Warning! W726: col(1) no reference to formal parameter 'event'
TestMain.cpp(80): Note! N392: col(41) definition: 'wxCommandEvent & event' in 'void TestDialog::OnQuit( wxCommandEvent & )'
TestMain.cpp(89): Warning! W726: col(1) no reference to formal parameter 'event'
TestMain.cpp(85): Note! N392: col(42) definition: 'wxCommandEvent & event' in 'void TestDialog::OnAbout( wxCommandEvent & )'
wrc.exe -q -r -fo=obj\Release\resource.res -iC:\wxMSW-2.9.0\include -iC:\wxMSW-2.9.0\lib\wat_dll\mswu -iC:\watcom\h -iC:\watcom\h\nt  resource.rc
wcl386.exe -q -c -d__WXMSW__ -d__WINDOWS__ -d_WINDOWS -dWXUSINGDLL -dUNICODE -bm -br -bw -bt=nt -zq -xr -xs -wcd=549 -wcd=656 -wcd=657 -wcd=667 -wx -ox -ot  -iC:\wxMSW-2.9.0\include -iC:\wxMSW-2.9.0\contrib\include -iC:\wxMSW-2.9.0\lib\wat_dll\mswu -iC:\watcom\h -iC:\watcom\h\nt  -fo=obj\Release\TestApp.obj TestApp.cpp
wcl386.exe -q -l=nt -q -bt=nt -r  /"LIBP C:\watcom\lib386" /"LIBP C:\watcom\lib386\nt" /"LIBP C:\wxMSW-2.9.0\lib\wat_dll"  obj\Release\TestMain.obj obj\Release\TestApp.obj  -fe=bin\Release\Test.exe wxmsw29u.lib  obj\Release\resource.res
Process terminated with status 0 (0 minutes, 15 seconds)
0 errors, 4 warnings
--- End quote ---

I've uploaded a Patch in Berlios ([ Patch #1905 ] Bugfix and Improvements to OpenWatcom Support).

Please Note: I've added two new files in the compiler plugin (src/plugins/compilergcc/compilerOWgenerator.cpp and src/plugins/compilergcc/compilerOWgenerator.h) which are also included in the patch.

I've tested it in my PC and it works fine. This patch will fix a older bug posted in Berlios ([ Bug #8391 ] Linking directories with Open Watcom 1.5).

Regards,

Biplab

mandrav:
Sounds fine Biplab :).

Navigation

[0] Message Index

[#] Next page

Go to full version