home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4344 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  2.0 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!mtxinu!sybase!rhoda
  2. From: rhoda@sybase.com (Rhoda Neimand)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Export errors.
  5. Message-ID: <27227@sybase.sybase.com>
  6. Date: 16 Dec 92 16:16:10 GMT
  7. References: <724094154.AA00845@etcetc.fidonet.org>
  8. Sender: news@Sybase.COM
  9. Organization: Sybase, Inc.
  10. Lines: 43
  11.  
  12. In article <724094154.AA00845@etcetc.fidonet.org> smythee@etcetc.fidonet.org (Ean Smythe) writes:
  13. >
  14. >    I'm compiling a Windows application (Microsoft v7) in C.  I ran across
  15. >a "symbol defined more than once", which turned out to be ok, I just didn't
  16. >have the /NOI (NOIGNORECASE) switch on for LINK...
  17. >
  18. >    So I add the /NOI switch to my makefile, and all of a sudden, I get
  19. >the following group of errors :
  20. >
  21. >LINK : error L2022: MainWndProc (alias MainWndProc) : export undefined
  22. >LINK : error L2022: Sale (alias Sale) : export undefined
  23. >LINK : error L2022: NewInv (alias NewInv) : export undefined
  24. >
  25. >    and so on, for every single one of my exported functions.  They *are*
  26. >listed in the .DEF file like always.
  27. >
  28. >    I took the /NOI switch out, and it compiled without errors.
  29. >
  30. >    What's happening?
  31. >
  32.  
  33. Probably the following:
  34.  
  35. Routines that you want to export that are not _pascal require an underbar
  36. in the export list of the .def file, e.g. _Sale.  Note that routines
  37. that do not explicitly use the _pascal modifier are, by default, _cdecl
  38. and _cdecl requires the underbar.
  39.  
  40. Routines that you want to export that do use the _pascal modifier don't
  41. require the underbar.
  42.  
  43. Any routine that you export that will be called back by someone else,
  44. like Windows or a DLL of your own, must use the _pascal modifier.
  45.  
  46. Summary:
  47.  
  48. _pascal modifer               : no underbar in export list
  49. no modifier (which is _cdecl) : underbar in export list
  50.  
  51. --
  52. Rhoda Neimand                            [I speak for myself]
  53. {sun,lll-tis,pyramid,pacbell}!sybase!rhoda -or- rhoda@sybase.com
  54. "I didn't want to, Jim"        Mr. Spock in _This Side Of Paradise_
  55.