From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,b3e01e5c19d8e617,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-08-08 10:48:45 PST Path: bga.com!news.sprintlink.net!hookup!swrinde!cs.utexas.edu!howland.reston.ans.net!usenet.ins.cwru.edu!ds2.uh.cwru.edu!muzic From: muzic@ds2.uh.cwru.edu (Ray Muzic) Newsgroups: comp.sys.dec Subject: fortran + c application linker bug??? Date: 8 Aug 94 17:00:35 GMT Organization: Case Western Reserve University, Cleveland, Ohio (USA) Message-ID: NNTP-Posting-Host: ds2.uh.cwru.edu I am customizing a public domain code which is mainly fortran (program + approx 300 subroutines and functions) but has a collection of c routines that do plotting via xwindows. The fortran code defines a function screen and the c code defines an int screen. When I build this application I get an access violation when the c routine tries to assign the value zero to screen. This makes sense because according to the debugger, screen is considered top be a function. Moreover, when I changed the name screen to rscreen in the c code, the program works fine. My questions are these: 1) Is this a bug? Should c and fortan keep their own copies of screen? 1) Why does this program work correctly on other (Unix) platforms? Is it because some platforms append underscores, capitalize, or otherwise modify variable names of fortran variables? 2) Is there a way to link things differently to solve this problem for VMS? Particulars OpenVMS AXP (TM) Operating System, Version V1.5-1H1 DEC Fortran V6.1-386 DEC C V1.3-000A c code fragment int border_width=10, ch_flag, ch_old, ch_pixel, color_flag, cursor_shape[]={XC_cross, XC_top_left_corner, XC_bottom_right_corner}, depth, display_height, display_height_mm, display_width, display_width_mm, height, pnt_x, pnt_y, res_x, res_y, screen, width, win_flag, win_shape, xo=0, yo=0; fortran code fragment The fortran code is compiled fortran/separate/nooptimize, the c code is compiled cc/nooptimize, and the pieces are linked together fortran first, c second, options file, vaxcrtl/library. function screen(ar) Line of c-code that causes access violation (DefaultScreen is the standard x macro). screen=DefaultScreen(display); Ray Muzic -- * Ray Muzic, Jr., Ph.D. | "I try not to think, it slows the progress." - rfm2 * * muzic@ds2.uh.cwru.edu | Biomedical Engr, CWRU & Image Analysis Ctr, UH __o * * Voice: (216)-844-3543 | Div. Nuclear Medicine, Univ Hosp of Cleveland -\<, * * Fax: (216)-844-3106 | 11100 Euclid Ave, Cleveland, OH, 44106, USA....O/ O *