home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / os2 / programm / 8021 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.5 KB  |  33 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!gatech!usenet.ins.cwru.edu!agate!ames!pacbell.com!charon.amdahl.com!netcomsv!netcom.com!ljensen
  3. From: ljensen@netcom.com (Colin Jensen)
  4. Subject: Re: How to link C Set/2 library to GCC/2 or gcc-emx
  5. Message-ID: <1993Jan26.012821.9348@netcom.com>
  6. Organization: Netcom - Online Communication Services (408 241-9760 guest)
  7. References: <1993Jan25.183155.20860@ucsu.Colorado.EDU>
  8. Date: Tue, 26 Jan 1993 01:28:21 GMT
  9. Lines: 22
  10.  
  11. In article <1993Jan25.183155.20860@ucsu.Colorado.EDU> kassarji@spot.Colorado.EDU (KASSARJIAN STEVEN J) writes:
  12. >Using GCC/2 and link386 I get unresolved external functions (the ones
  13. >in the library provided by the hardware vendor, but proceeded by a
  14. >single _ character).  Apparently GCC/2 and CSet/2 mangle function
  15. >names differently.  Can this be averted?  How?
  16.  
  17. Assuming you have a vendor supplied function 
  18.     void foo(void);
  19. you will need to declare foo() as
  20.     void foo(void) asm("foo");
  21. in order for gcc/2 to be happy with it.
  22.  
  23. This advice only applies if the library is 32bit though...
  24.  
  25. Basically, DLLs and LIBs usually have no pre-pended underscore for symbol
  26. names.  Gcc/2 by default wants pre-pended underscore.  The asm notation
  27. tells gcc/2 that the symbol should really be refered to by a different
  28. name - in this example, I tell gcc that the symbol "foo" should translate
  29. as the symbol "foo" rather than the default translation of "_foo".
  30. -- 
  31. Colin Jensen
  32. ljensen@netcom.netcom.com    cjensen@ampex.com
  33.