By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,128 Members | 1,206 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,128 IT Pros & Developers. It's quick & easy.

Question of compile C++ code with g++

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.