User forums > Help

How to set up 16-bit DOS Open Watcom target linking?

<< < (3/4) > >>

stahta01:

--- Quote from: mrmoelgaard on November 24, 2015, 10:29:15 am ---Hello,

Excuse for resurrecting this topic. I'm using Code::Blocks as an IDE for Open Watcom in a project that targets DOS 16. My project is structured in a number of libraries linked into a console application.
I'm struggling with setting up the compiler options to achieve this an came across this post in my search for a solution.
I had already adjusted my advanced options to the settings described here. I compared the build log in the Open Watcom IDE with Code::Blocks to get it working.

But there's an issue when working with libs since wlink and wlib use different syntax for the object list.
wlink.exe requires a list of obj files separated by comma
wlib.exe requires a list of obj files separated by space

In the Other options there's only one "Object separator" so I'm a little challenged by the tool. I'm using Code::Blocks version 13.12 with Open Watcom 1.9 (latest) on a Windows 7 PC.
Any advice would be highly appreciated since I've become really fond of using Code::Blocks instead of the Open Watcom IDE.

Thanks in advance.

Best regards
Emil Moelgaard

--- End quote ---

I am willing to try to help you; but, other than this thread I have NOT used Open Watcom.
You will need to post the correct command for Open Watcom to compile to object code.
And, the correct command need to link the object code to an 16 bit exe.

Links to download the Open Watcom 16 bit compiler/linker you are using would help me to test the changes I do.

Tim S.

mrmoelgaard:
Hi, thanks for your assistance.

I've tried to create a small example that illustrates my challenge:

A library called MyLib includes two source files (types and calc). MyLib is then used by MyProg.exe through a handler. It is essential that both the library and the application consists of more than one source file. Otherwise there are no obj files to separate.


--- Code: ---wcl.exe -q -c -d2 -wx -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\types.obj types.c
wcl.exe -q -c -d2 -wx -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\calc.obj calc.c
wlib.exe -q MyLib.lib obj\Debug\types.obj obj\Debug\calc.obj

wcl.exe -q -c -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\main.obj main.c
wcl.exe -q -c -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\calcHandler.obj calcHandler.c
wlink.exe name MyProg.exe d all sys dos op m op maxe=25 op q LIBP C:\WATCOM\lib386;C:\WATCOM\lib386\dos FIL main.obj,calcHandler.obj library ..\MyLib\bin\Debug\MyLib.lib,lib\OtherLib.lib

--- End code ---

The list of obj files sent to wlib.exe is separated by spaces. But for wlink it needs to be separated by commas.

Of course I have the option to create another copy of the compiler profile and have one setup for compiling library projects and another for exe projects.

Best regards
Emil

stahta01:
I will try to take a look at the changes needed in the next few days.

Tim S.


--- Quote from: mrmoelgaard on November 26, 2015, 10:08:09 am ---Hi, thanks for your assistance.

I've tried to create a small example that illustrates my challenge:

A library called MyLib includes two source files (types and calc). MyLib is then used by MyProg.exe through a handler. It is essential that both the library and the application consists of more than one source file. Otherwise there are no obj files to separate.


--- Code: ---wcl.exe -q -c -d2 -wx -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\types.obj types.c
wcl.exe -q -c -d2 -wx -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\calc.obj calc.c
wlib.exe -q MyLib.lib obj\Debug\types.obj obj\Debug\calc.obj

wcl.exe -q -c -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\main.obj main.c
wcl.exe -q -c -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\calcHandler.obj calcHandler.c
wlink.exe name MyProg.exe d all sys dos op m op maxe=25 op q LIBP C:\WATCOM\lib386;C:\WATCOM\lib386\dos FIL main.obj,calcHandler.obj library ..\MyLib\bin\Debug\MyLib.lib,lib\OtherLib.lib

--- End code ---

The list of obj files sent to wlib.exe is separated by spaces. But for wlink it needs to be separated by commas.

Of course I have the option to create another copy of the compiler profile and have one setup for compiling library projects and another for exe projects.

Best regards
Emil

--- End quote ---

stahta01:
@mrmoelgaard: The problem has code changes in SVN that should have fixed the issue in the past.

What version of Code::Blocks are you using? SVN/Release info

Edit: I have NOT yet figured out if the past changes work or when they were done.

Edit2: Found a real problem; the project settings are being ignored for some things for the Watcom compiler.
Library paths, Library names, and likely some other things are being ignored.

Tim S.

mrmoelgaard:
Hi,

I'm using the 13.12 binary release with MinGW bundle.

For now I'm using the workaround with two compiler setups, one for lib and one for exe. Not ideal but it gets the work done.
Let me know if there's another version I can test. Would that be latest nightly?

Best regards
Emil

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version