469,642 Members | 1,254 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,642 developers. It's quick & easy.

Question of compile C++ code with g++

Dear All:
I have question about how to compile those below code.
The architecture is as below:

Independent:
caluating.cc , reading.cc, ran_gen.cc, hamming.cc, sorting.cc,
combine.cc
-----------
Dependency:
find_column.cc self + hamming.cc, sorting.cc
counting.cc self + hamming.cc, count.cc
write.cc self, hamming.cc
rem_routine.cc self, hamming.cc, combine.cc

solving.cc self, counting.cc+find_column.cc+ran_gen.cc+sorting.cc

main.cc self+reading.cc+ran_gen.cc+write.cc+rem_routine.cc +
solving.cc

I write the main function in main.cc , other programs are describle
some other function.

---------------

I try to compile hamming.cc and write.cc to create hamming.o and
write.o
g++ -c hamming.cc ; this pass, no error.
However, when I compile write.cc , there are some error; I try three
method, but all fail.
1.g++ -c write.cc hamming.o
error message:
g++: hamming.o: linker input file unused because linking not done
2.g++ write.cpp hamming.o -o write
: undefined reference to `main'
3.g++ -c write.cpp hamming.o -o write
g++: cannot specify -o with -c or -S and multiple compilations
I don't know how to compile those code to a executable file.

Thank you for helping.

Sen-Lung

Aug 2 '05 #1
1 1482
Sen-Lung Chen wrote:
Dear All:
I have question about how to compile those below code.
The architecture is as below:

[...]


Please post this to 'gnu.g++.help'

We here talk _language_, not compiler options.

V
Aug 2 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

32 posts views Thread by David | last post: by
11 posts views Thread by Daniel Wilcox | last post: by
110 posts views Thread by Vijay Kumar R Zanvar | last post: by
7 posts views Thread by Mike Heard | last post: by
10 posts views Thread by jojobar | last post: by
7 posts views Thread by Tony Johansson | last post: by
12 posts views Thread by Bryan Parkoff | last post: by
1 post views Thread by pitjpz | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.