Not able to compile C program on z/OS (USS)


 
Thread Tools Search this Thread
Top Forums Programming Not able to compile C program on z/OS (USS)
# 1  
Old 06-20-2011
Not able to compile C program on z/OS (USS)

Hi,
I having an issue while compiling a C program in USS (z/OS) machine.

I was able to create objest files (.o) from source (.c) files but when I try to create a binary file from the object files I am getting the below error.

Code:
$ cc util.o sock.o app.o -lnsl -o ptf
FSUM3067 The archive library nsl (libnsl.a) cannot be found.

Thanks,
Madhu.
# 2  
Old 06-20-2011
It means what it says, it doesn't have -lnsl.

Do you really need -lnsl?
# 3  
Old 06-20-2011
Hi,
Thanks for the reply.

Sorry, I am not much familiar with -lnsl is. I used it because, the same option is used while compiling the program in other unix boxes too.

When I remove the -lnsl option, I get the below errors

Code:
$ cc util.o sock.o app.o -o ptf
IGD01008I ALLOCATION SET TO SCTEMPD M0610
 
IGD01010I ALLOCATION SET TO SGTEMPD STORAGE GROUP

IGD01008I ALLOCATION SET TO SCTEMPD M0610
 
IGD01010I ALLOCATION SET TO SGTEMPD STORAGE GROUP
 
 IEW2763S DE07 FILE ASSOCIATED WITH DDNAME /0000004 CANNOT BE OPENED BECAUSE THE
          FILE DOES NOT EXIST OR CANNOT BE CREATED.
 IEW2302E 1031 THE DATA SET SPECIFIED BY DDNAME /0000004 COULD NOT BE FOUND, AND
          THUS HAS NOT BEEN INCLUDED.
 IEW2763S DE07 FILE ASSOCIATED WITH DDNAME /0000005 CANNOT BE OPENED BECAUSE THE
          FILE DOES NOT EXIST OR CANNOT BE CREATED.
 IEW2302E 1031 THE DATA SET SPECIFIED BY DDNAME /0000005 COULD NOT BE FOUND, AND
          THUS HAS NOT BEEN INCLUDED.
 IEW2456E 9207 SYMBOL ntohl UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM THE
          DESIGNATED CALL LIBRARY.
 IEW2456E 9207 SYMBOL htonl UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM THE
          DESIGNATED CALL LIBRARY.
 IEW2456E 9207 SYMBOL htons UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM THE
          DESIGNATED CALL LIBRARY.
FSUM3065 The LINKEDIT step ended with return code 8.

# 4  
Old 06-20-2011
Make sure you have all the right header files.

z/OS V1R10 information center
This User Gave Thanks to Corona688 For This Post:
# 5  
Old 06-21-2011
Hi,
I have added the arpa/inet.h header file and removed the -lnsl option.

Now, I am left with the below errors

Code:
$ cc util.o sock.o app.o -o ptf
IGD01008I ALLOCATION SET TO SCTEMPD M0610
 
IGD01010I ALLOCATION SET TO SGTEMPD STORAGE GROUP
 
IGD01008I ALLOCATION SET TO SCTEMPD M0610
 
IGD01010I ALLOCATION SET TO SGTEMPD STORAGE GROUP
 
 IEW2763S DE07 FILE ASSOCIATED WITH DDNAME /0000004 CANNOT BE OPENED BECAUSE THE
          FILE DOES NOT EXIST OR CANNOT BE CREATED.
 IEW2302E 1031 THE DATA SET SPECIFIED BY DDNAME /0000004 COULD NOT BE FOUND, AND
          THUS HAS NOT BEEN INCLUDED.
 IEW2763S DE07 FILE ASSOCIATED WITH DDNAME /0000005 CANNOT BE OPENED BECAUSE THE
          FILE DOES NOT EXIST OR CANNOT BE CREATED.
 IEW2302E 1031 THE DATA SET SPECIFIED BY DDNAME /0000005 COULD NOT BE FOUND, AND
          THUS HAS NOT BEEN INCLUDED.
FSUM3065 The LINKEDIT step ended with return code 8.

# 6  
Old 06-21-2011
Bug

Quote:
Originally Posted by madhu84
Hi,
I having an issue while compiling a C program in USS (z/OS) machine.

I was able to create objest files (.o) from source (.c) files but when I try to create a binary file from the object files I am getting the below error.

Code:
$ cc util.o sock.o app.o -lnsl -o ptf
FSUM3067 The archive library nsl (libnsl.a) cannot be found.

Thanks,
Madhu.
Hello Madhu,

From the error, its obvious that you need the libnsl.a because code links against some routines from that lib. What I would suggest is that find that library (using find) and explicitly specify the lib in the compile option (with -L) to see if it works.

Code:
find / -type f -iname "libnsl.a"

From this if you get any results then do
Code:
$ cc util.o sock.o app.o -lnsl -o ptf -L<YOUR_RESULT>

If you are not able to find libnsl.a then locate it from similar architecture of compile it on your machine.

Thanks and Regards,
Gaurav.
# 7  
Old 06-21-2011
Hi,
I was able to compile the code now.

I have removed "-lnsl" and included "arpa/inet.h" header file, which fixed the issue related to library.

By removing the "-o ptf" remaining issues were also resolved. But this created the binary as a.out and I have renamed it to ptf.


Thanks,
Madhu.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Cannot compile/install gnu program

Hello, I'm trying to install ansifilter which is a program that translates ansi text to HTML. The idea is to install it on AIX 7.1 but is failing. All de appropriate gcc libraries and requirements for this software were installed successfully, but when I do the gmake I get the following... (4 Replies)
Discussion started by: bazajav
4 Replies

2. Programming

Can someone compile and run a program on AIX 6.1 please?

Hi, I have a program which collects performance data from AIX. It works fine on older releases (< 5.3) but I fail to get data from /proc. I would really appreciate it if someone could compile (using ANSI compat C compiler), run the program (for 30-40 minutes) on AIX 6.1 and send me the... (2 Replies)
Discussion started by: StuBob
2 Replies

3. UNIX for Advanced & Expert Users

compile a c program in a encrypted way

Hi Guys, I wonder I had have a look to the cc compile options but I could be missing one but basically I'm compliling a c program where I will storing a command to connect to a database and also userid and password. The issue is that after the module is generated using a command like strings I... (14 Replies)
Discussion started by: arizah
14 Replies

4. Programming

Compile c program on Sun Solaris OS

Can anyone tell me how to compile a c programs on SunSolaris OS 5.1 Version as gcc and cc are not working Thanks!!!! (4 Replies)
Discussion started by: shivu
4 Replies

5. Solaris

How do I compile a 64-bit program on SPARC??

Hi, wcslen(), strlen() returns size_t. On 64-bit platform i want to use int like str length is 10. int len = wcslen(str); On 64-bit what should I need to do if i wants the length in int. Because getting error as "Conversion of 64 bit type value to "int" causes truncation". if i... (17 Replies)
Discussion started by: amit_27
17 Replies

6. Programming

compile a c program

I am trying to compile a c program on AIX 5.3L 64-bit unix. I have used this program in the past and it works. Does anybody know what this error means? /usr/local/bin> gcc get_epoch_secs.c get_epoch_secs gcc: get_epoch_secs: No such file or directory get_epoch_secs.c: In function... (8 Replies)
Discussion started by: djehresmann
8 Replies

7. BSD

How to compile a c program in freeBSD

Hi , I have freeBSD installed. I need to compile a c program which has embedded informix sql statement in it. Can you please help me to to do the same. I need to know what I should I do to make BSD compatable to compile the c program ? Thanks in advance Jisha (3 Replies)
Discussion started by: jisha
3 Replies

8. Programming

how to compile a program statically

how can i do static compilation in cc and -lldap i have system defined and user defined header file. Can any one suggest any site where from i can get some information about static and dynamic compilation. Thankx (1 Reply)
Discussion started by: bhakti
1 Replies

9. Programming

How to compile a c program by using gcc

Hi all, Yeasterday I try to compile c program by using cygwin. I just find an errors the fist one is concerinig about the end of the line. To summit my Assignment which is the day after tommorow I have to compile my c program by using just gcc. If any one know what do I have to... (5 Replies)
Discussion started by: Bell
5 Replies

10. Programming

how to compile a program

how do i go about compiling a simple hello world script in mandrake linux? this is something i have had no luck in finding on the main site, please help? thank you (2 Replies)
Discussion started by: CmpKillr
2 Replies
Login or Register to Ask a Question