Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How to setup linking in a Visual COBOL project so that an entry point defined within a .LIB will be used as the main entry point

How to setup linking in a Visual COBOL project so that an entry point defined within a .LIB will be used as the main entry point

Problem:

Customer is migrating his application from Net Express to Visual COBOL. The application is a mixture of COBOL and C programs where there is a main entry point WinMain that resides within a C library.

Under Net Express they used a makefile to call the system linker directly in order to link this so that the C WinMain would be the main entry point and the COBOL objects would be alternate entry points.

The customer now wishes to compile and link this in the same manner but using a Visual COBOL project to do the build instead of a makefile.

The program builds and links OK but it is not picking up the WinMain in the C .LIB as the main entry point so it does not start correctly.

When they try to specify WinMain as the entry point on the COBOL Link tab of the project properties it gives them an error that this entry point cannot be found.

How can they use this link scenario from within a Visual COBOL project?

Resolution:

Add the following to the additional directives on the bottom of the COBOL Link Property page.

-WL/entry:WinMain@16

This tells the linker to force the main entry point to be the name specified so that it will search all .LIBs for that name.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-10-25 17:28
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.