03-26-2007
Quote:
Originally Posted by meili100
How to compile the following "test.cpp" code? It reports "std error"...
#include <vector>
#include<iostream>
int main(){
std:vector <int> a1(10);
a1[0]=12;
std:cout<<a1[0]<<endl;
return 0;
}
Instead of colon (
after std u shld use scope resolution operator (:: ) That will solve ur problem ... but if u wanna use endl then u shld compile with g++ as endl is compile with g++ complier .... and give space after include .... the syntax shld be perfect then only code will complie ... thanks
10 More Discussions You Might Find Interesting
1. Programming
Can you tell me why ? Thank you !
$ cc -L /usr/lib server.c -lsocket
UX:acomp: WARNING: "server.c", line 60: argument is incompatible with prototype6
Undefined first referenced
symbol in file
ffush server.o... (2 Replies)
Discussion started by: loudingyang
2 Replies
2. Windows & DOS: Issues & Discussions
Hi.
I'm New user for this Forum.Presently i'm working with Cygwin
I want to know the basic commands that will be used for Cygwin.
Can anyone guide me on this regards
Thanks & Regards
Sanjay (0 Replies)
Discussion started by: sanjay.karthik
0 Replies
3. Shell Programming and Scripting
i have a cygwin unix and i would like to use alias to save a cd command.. however i lose this alias when i close out cygwin and log back in.. is there any way to save this command so that i can use it every time i log in? i am using cygwin on windows xp. thanks. (1 Reply)
Discussion started by: npatwardhan
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I installed unix emulator cygwin, it does not allow me to open vi editor.
Can anybody know if cygwin supports vi.
if not can somebody please refer a good emulator. (5 Replies)
Discussion started by: siquadri
5 Replies
5. UNIX for Dummies Questions & Answers
Hello, I know this isn't exactly a Unix question, but I wasn't able to find much information elsewhere.
I'm trying to run a program in the background using Cygwin on a Windows machine, then use the wait command to pause before proceeding. Unfortunately, as I've confirmed using ps aux, the... (0 Replies)
Discussion started by: ocdcollector
0 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I am very unfamiliar with linux/unix (don't even know the difference), but am trying to get some linux software to run on my Windows machine for my research. I have the makefiles for the software, and it is designed to be compiled in the PGI complier, which I also have. When i... (6 Replies)
Discussion started by: roba87
6 Replies
7. UNIX for Dummies Questions & Answers
I need to rebuild an application that developed in unix environment and run in windows OS with cygwin. so How can I rebuild from the source code?
is there any one who said something on this regard? (2 Replies)
Discussion started by: bejirond
2 Replies
8. HP-UX
Hi all,
am new to the forum. i would like to check with the community whether anyone had tried to run self-developed UNIX apps on the CYGWIN? Does the CYGWIN presents a friendly environment to host the UNIX apps? thanks :) (14 Replies)
Discussion started by: lchunleo
14 Replies
9. Shell Programming and Scripting
Hi All,
We have shell scripts in UNIX ( Sun OS ) server.
Also in my windows machine i have Cygwin installed.
Now is there a way to execute Shell script available in UNIX server from Cygwin? (4 Replies)
Discussion started by: Girish19
4 Replies
10. Windows & DOS: Issues & Discussions
Hi,
Objective is to transfer files from windows server to Unix server using cygwin.
I have installed cygwin, and I manually execute commands and transfer files from windows to unix using sftp. These are steps I execute
1) Run cmd
2) Run cygwin
3) At prompt type sftp user1@uniserver
4) lcd... (2 Replies)
Discussion started by: wahi80
2 Replies
LEARN ABOUT DEBIAN
fort77
FORT77(1) Linux Programmer's Manual FORT77(1)
NAME
fort77 - invoke f2c Fortran translator transparently, like a compiler
SYNOPSIS
fort77 [-c] [-g] [-v] [-k] [-P] [-cpp] [f2c option ...] [-L directory ...] [gcc-option ...] [link option ...] [-O optlevel] [-o out-
file] [-s] [-w] [-Wx,arg1[,arg2]...] file ...
DESCRIPTION
The fort77 script invokes the f2c command transparently, so it can be used like a real Fortran compiler. It can be used to compile For-
tran, C and assembler code, and to link it with the f2c libraries.
File arguments ending with .f are compiled as Fortran source files. Files which end with .P are passed through to f2c, and files ending
with .F are passed to the C preprocessor (invoked as "/lib/cpp -traditional") first. Any switches passed via -D will be passed to the pre-
processor. If the translation is successful, the resulting C files will be passed to cc for translation into an object file. Files ending
in .c, .C, .cc, .i, .s, .S, .m, .cc or .cxx are passed to the GNU C compiler directly; see gcc(1). All other files are passed to the
linker.
OPTIONS
-c Supress linking and produce an object ( .o ) file from each source file.
-g Include debugging information. -v Be verbose; supplying this twice will also tell the C compilers etc to be verbose.
-k Keep the C files generated by f2c around.
-cpp Pass Fortran code through the C preprocessor, as if filenames ended in .F.
-P Generate f2c .P files.
-Ldirectory
Include directory in the search for libraries in the final linking stage.
-o outfile
Send output to outfile.
-trapuv Have f2c generate code to trap uninitialized values.
-Wx,arg1[,arg2...]
Pass the argument[s] argi through to the subprocess x, where x can assume one of the following values: f for the f2c step, p for
the preprocessing step, c for the C compiler, a for the assembler (this is actually passed to the C compiler, too), and l for the
linker. As an example, defining a preprocessor constant for the C compilation step would be done with -Wc,-DUNIX=1. Specifying
the -f option to f2c would be done via -Wf,-f.
f2c option
fort77 passes through almost all f2c options: -C, -U, -u, -a, -E, -h, -P, -R, -r, -z, -I2, -I4, -onetrip, -!c, -!l, -!P, -!R, -ext,
-!bs, -W[n], -trapuv, -w8, -r8 and -w66.
gcc options
The following options are passed through to gcc: -f*, -W*, -U*, -A*, -m*, -S, -E, -v, -x, -pipe, -o, -I, -V, -b*, -p, -pg.
linker option
The options passed to the linking stage are -static, -shared, -v, -V, and -symbolic.
BUGS
To make debugging work, you need to set a breakpoint at MAIN__ before you start.
f2c This script automatically supplies the -I. option to f2c. Older versions of f2c may not support this.
This script is for the interaction of gcc and f2c; using it with another compiler will probably require modification.
The fort77 script does not strictly conform to Posix.2, because it acceppts long options with one leading slash. This is done for gcc com-
patibility.
SEE ALSO
f2c(1), cc(1), as(1), ld(1)
AUTHOR
Thomas Koenig, ig25@rz.uni-karlsruhe.de
Linux Nov 1996 FORT77(1)