home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / os2 / programm / 6538 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  2.0 KB

  1. Path: sparky!uunet!gumby!destroyer!cs.ubc.ca!unixg.ubc.ca!ochealth
  2. From: ochealth@unixg.ubc.ca (ochealth)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: EMX link ERRORS
  5. Date: 18 Nov 1992 23:47:01 GMT
  6. Organization: University of British Columbia, Vancouver, B.C., Canada
  7. Lines: 48
  8. Message-ID: <1eekllINNmr3@iskut.ucs.ubc.ca>
  9. References: <tdukes.921118111315@ohm.ee.eng.auburn.edu>
  10. NNTP-Posting-Host: unixg.ubc.ca
  11.  
  12. In article <tdukes.921118111315@ohm.ee.eng.auburn.edu> tdukes@eng.auburn.edu (Todd J Dukes) writes:
  13. :I am trying to make the switch to EMX from GCC/2. I read the documentation
  14. :that comes with EMX and am trying to make a simple program I wrote
  15. :when I started using GCC/2. It compiles fine, but when linking there
  16. :are several link errors (I believe it is all of the PM functions).
  17. :I have included my make file below. Does anybody have any suggestions?
  18. :
  19. :Thanks
  20. :Todd
  21. :tdukes@eng.auburn.edu
  22. :
  23.  
  24. for OS/2 PM programming, it is probably better to use the native OS/2
  25. link format. In EMX 0.8e, use the flag -Zomf for all linking and compiling.
  26. (-Zmt is probably a good idea. It's smaller, and it is thread safe)
  27.  
  28. You can use the .o format as well, but look at the file emxtest.zip
  29. which has various examples. (stuff with emxbind)
  30.  
  31. With the .obj format you should do
  32.  
  33. foo.exe:  $(OBJS) foo.def foo.res
  34.     gcc -Zomf -o foo.exe foo.def $(OBJS) etc..
  35.     rc foo.res foo.exe
  36.  
  37. foo.res:  foo.rc foo.h foo.ico ....
  38.     rc -r foo.rc
  39. :
  40. :CC=gcc
  41. :CFLAGS=-c -I/TOOLKT20/C/OS2H
  42. :
  43. :OBJS= stdmain.o winproc.o getfile.o process.o
  44. :
  45. :pmdraw.exe: $(OBJS) pmdraw.def pmdraw.res
  46. :    gcc -o pmdraw.exe $(OBJS) pmdraw.def pmdraw.res -los2 -lgpp
  47.  
  48. gcc (EMX) won't automatically link in .res files
  49. use rc for that
  50.  
  51. Oh, and you are using C++ too, so make sure you have the C++ stuff
  52. (EMX comes puts C++ in a seperate archive file)
  53.  
  54. :
  55. -- 
  56. ______________________________________________________________________________
  57. jpm: ochealth@unixg.ubc.ca         
  58.                             Happily using OS/2 2.0 because MS Windows isNT ___
  59.                                                       Insert VapourFeature ^^^
  60.