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.
https://developer.berlios.de/bugs/?func=detailbug&bug_id=8391&group_id=5358
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.
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
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.
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
Though it shows 2 errors, but it compiles and links successfully.
2. Create a file, e.g., minimal.lbc with the following content.
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
and then pass it to
wlink.exe as -
wlink @minimal.lbc
This does the trick. Second one I got from minimal sample of wx.
Which one can be implemented quickly in C::B?
Regards,
Biplab