To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 765
764  |  766
Subject: 
Re: Can't get Linux NQC to compile/Run
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Tue, 12 Sep 2000 17:53:46 GMT
Viewed: 
1798 times
  
Dave Baum wrote:

In article <39BDC401.DA322AD7@akasa.bc.ca>, Dean Husby
<nntp@akasa.bc.ca> wrote:

Dave Baum wrote:

#include <vector.h>

int main(int, char **)
{
  vector<int> v;

  return 0;
}

I'm afraid I don't have a clue how to compile that one.

I tried   make test.c
but, of course, that doesn't work.

I also tried
[tfm@linux tfm]$ gcc ./test.c
./test.c:1: vector.h: No such file or directory

but not much luck there either.


You need to compile it as a C++ source file.  There are ways to force
C++ compilation of .c files, but its probably easier to just save it as
test.cpp, then try:

g++ test.cpp

Assuming that the compiler knows where to find the C++ standard
includes, it should be able to #include <vector.h>.  If it can't find
vector.h, then you'll have to add a -I option to the command (after
figuring out where vector.h lives).


It couldn't find where vector.h lives. I'll have to hunt.

Dean
--
Coin-Op's For Sale!: http://www.akasa.bc.ca/tfm/coin-op.html
Dean's Lego Workshop: http://www.akasa.bc.ca/tfm/lego_wr.html
Vancouver Lego Club: http://www.akasa.bc.ca/vlc



Message has 1 Reply:
  Re: Can't get Linux NQC to compile/Run
 
(...) Try `locate vector.h`. I'm not sure what package vector.h belongs to on Mandrake; on Red Hat 6.x, it's one of the egcs packages, but I know that gcc/egcs is one of the things Mandrake does differently. (24 years ago, 13-Sep-00, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  Re: Can't get Linux NQC to compile/Run
 
(...) You need to compile it as a C++ source file. There are ways to force C++ compilation of .c files, but its probably easier to just save it as test.cpp, then try: g++ test.cpp Assuming that the compiler knows where to find the C++ standard (...) (24 years ago, 12-Sep-00, to lugnet.robotics.rcx.nqc)

26 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR