From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,7bfa09f05667b86c X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-10-20 08:51:27 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!spool.mu.edu!caen!hearst.acc.Virginia.EDU!news.em.doe.gov!russmac.em.doe.gov!russ.russell From: Russ Russell Newsgroups: comp.unix.osf.osf1 Subject: Re: C++ compile problem on osf/1 Date: 20 Oct 1994 14:40:30 GMT Organization: Coleman Research Corporation Distribution: world Message-ID: <385vgu$ieo@news.em.doe.gov> References: NNTP-Posting-Host: russmac.em.doe.gov Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: Nuntius Version 1.3b14 X-XXMessage-ID: X-XXDate: Thu, 20 Oct 1994 14:41:27 GMT In article David McDougall, davidm@bri.hp.com writes: >Hi Folks, > I have a program that happily compiles >using the standard c compiler on a DEC 3000/300 >running OSF/1 v1.3. It uses a few ioctl calls to >do various things. I have ported the code to C++ >and I am getting a ridiculous error which states >the following: > >"dec_interface.C:44: error: In this statement, "ioctl" is not declared." > >Now line 44 is identical in syntax to the c version and I >have included the #include line in my c++ header >file. Does anyone know whats wrong or had a similar problem. >Things are getting silly as there is nothing obviously wrong. >Famous last words. Are there any defines I should be setting for the >compiler command. Make sure that you put extern "C" { } around all your system includes for C commands. Remember that C defaults a function to int, but c++ has no defaults, so EVERY function must be explicitly declared. In compiling my MUD in DEC c++, I even had to declare a couple of system functions (select for example) in my own header files, because they were int functions, and for some reason weren't externed in the system includes. It will surely work if you do the extern "C" {}, and if you have to declare the function in your own header files. ----------------------------------------------------- Russ Russell, Network Engineer and UNIX Administrator Coleman Research Corporation Contractor to and for the U.S. Department of Energy Russ.Russell@em.doe.gov Brutius at SneezyMUD(128.162.19.9 7900) My views are mine, and do not necessarily reflect the views of Coleman Research or the U.S. DOE -----------------------------------------------------