Re: Compiling programs under Solaris
"David D. Lucas" <[email protected]> Thu, 24 Jul 2003 07:35:44 -0400
| Newsgroups | gmane.comp.lib.jtc |
|---|---|
| Organization | Lucas Software Engineering, Inc. |
| Message-ID | <[email protected]> |
Also consult the man pages (i.e. "man cc" or "man c++" or "man CC" ). One of those should bring up the compiler options and explain them to you. There should be some examples where the CC was installed at. Check the /usr directory for the compilers and see if the examples were loaded as well. I once used the following options, but that was in 1998. CC -g -D_REENTRANT -mt -c <sourcefile> -o <objectfile> and to link, I included -L/usr/lib -lpthread back then. That has probably changed. Have not compiled C++ on Solaris in a while. If you are compiling C++ code that uses templates, you may need to include the CC options above on the link step as well. Best Wishes, Dave Brent Eagles wrote: > Hi, > > On Wed, Jul 23, 2003 at 02:30:13PM +0400, [email protected] wrote: > >> Dear everybody, >> >> I just downloaded JThreads and managed to compile the libraries under >> Solaris 8 using CC Workshop6. >> >> My problem now is I want to include threads in my application , what are >> the command line parameters for the compilation ( how to include libraries >> and allow multithreading) >> >> I am not very aware of make files coz I'm originally a Java programmer and >> used to do C++ on Windows. >> >> Can you shed some light on this. >> >> Thx inadvance > > > Without specific information about how you are building your project, I > cannot give you precise instructions. This shouldn't be necesarry > anyways, since its pretty easy ;) > > To get compilation to work, you need to add the include file directory > to your compilation command line. Most compilers have an '-I' option > for this. For example, if you installed JThreads/C++ in > '/opt/JThreads/' you would add '-I/opt/JThreads/include'. > > To get linking to work, you indicate the location of the JThreads/C++ > library to the linker and the name of the library. For some UNIX > platforms, you indicate the location of the libraries using the '-L' > option and the libraries with '-l'. For example, if you installed > JThreads/C++ as above, you would add '-L/opt/JThreads/lib -ljtc' to your > linker command line. > > For development tool specific details, see the appropriate > documentation. For examples of working command lines, just build the > demos and test suite and examine the commands used to build the > executables. > > Best regards, > > Brent > -- +------------------------------------------------------------+ | David Lucas mailto:[email protected] | | Lucas Software Engineering, Inc. (740) 964-6248 Voice | | Unix,Java,C++,CORBA,XML,EJB (614) 668-4020 Mobile | | Middleware,Frameworks (888) 866-4728 Fax/Msg | +------------------------------------------------------------+ | GPS Location: 40.0150 deg Lat, -82.6378 deg Long | | IMHC: "Jesus Christ is the way, the truth, and the life." | | IMHC: "I know where I am; I know where I'm going." <>< | +------------------------------------------------------------+ Notes: PGP Key Block=http://www.lse.com/~ddlucas/pgpblock.txt IMHO="in my humble opinion" IMHC="in my humble conviction" All trademarks above are those of their respective owners. _______________________________________________ JTC-Users Mailing List - [email protected] http://www.orbacus.com/mailman/listinfo/jtc-users Visit our support FAQ before you send a message. http://www.orbacus.com/faq/support.html