[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C++ Compilation



%% Byron Hillis <the.metric@gmail.com> writes:

  bh> I'm just trying to get a basic C++ program to compile, but I have
  bh> no idea what is going wrong.

It's very simple.

You're using the C compiler front-end to compile and link C++ code.
Don't do that.

You should use the C++ compiler front-end to compile and link C++ code
(especially link!)

  bh> ctkLogTest : ctkLog_test.o
  bh>         gcc -g -o ctkLogTest ctkLog_test.o

  bh> ctkLog_test.o : ctkLog_test.cpp
  bh>         gcc -g -c ctkLog_test.cpp

  bh> clean :
  bh>         rm ctkLog_test ctkLog_test.o

You should be using g++ for both of these commands.

In a makefile you really want to use variables, anyway.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@nortel.com>           HASMAT--HA Software Mthds & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
        These are my opinions--Nortel takes no responsibility for them.



Reply to: