Question of compile C++ code with g++

S

Sen-Lung Chen

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
 
V

Victor Bazarov

Sen-Lung Chen said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top