473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1583
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: David | last post by:
Hi I'm trying to teach myself python and so far to good, but I'm having a bit of trouble getting a function to work the way I think it should work. Right now I'm taking a simple program I wrote in...
11
by: Daniel Wilcox | last post by:
I have a question, I have been given a piece of code that apparantly compiles under Visual C++ but I cannot get to compile under g++ 3.2. I have read the FAQ and delved into the Stroustrup book...
43
by: nospam | last post by:
I got three (3) files (1) Untitled.aspx (2) Untitled.aspx.1.cs (3) Untitled.aspx.2.cs These three files must be used together to make file #1, Untitled.aspx, page work via J.I.T. when the...
110
by: Vijay Kumar R Zanvar | last post by:
Hi, Which section of C99 says that return value of malloc(3) should not be casted? Thanks. -- Vijay Kumar R Zanvar My Home Page - http://www.geocities.com/vijoeyz/
7
by: Mike Heard | last post by:
Hi. I have a question about the evaluation of IF statements when the && operator is used. I have been under the assumption that if the first expression in an IF statement is FALSE it will not...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
7
by: Tony Johansson | last post by:
Hello! Why does not this cause a compile error because a ulong has never been implicitly convertible to byte? ulong vektor = {100000,200000,300000}; foreach(byte b in vektor) {...
12
by: Bryan Parkoff | last post by:
I write my large project in C++ source code. My C++ source code contains approximate four thousand small functions. Most of them are inline. I define variables and functions in the global scope....
1
by: pitjpz | last post by:
We have moved our Database to another server. The server it was on used SQL 4 and the new one its on now uses SQL5 the only problem we can find is that when you attempt to delete a record from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.