473,396 Members | 1,886 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.

order in which files are built

hello.
I have 3 files:
parent.cpp
child.cpp
driver.cpp

I am working in visual C++ 6.0 and have all the files in one same
project. When I ask the IDE to biuld my project, it compiles the code
in such a way that the order makes it incorrect. For example, it
compiles the parent.cpp file after child.cpp . Any ideas on how to
specify a building order? I know that eclipse does this automatically
for java, but what about for visual studio C++?

Thanks for your heads up.

Nov 10 '06 #1
6 1840
p_adib wrote:
I have 3 files:
parent.cpp
child.cpp
driver.cpp

I am working in visual C++ 6.0 and have all the files in one same
project. When I ask the IDE to biuld my project, it compiles the code
in such a way that the order makes it incorrect. For example, it
compiles the parent.cpp file after child.cpp . Any ideas on how to
specify a building order? I know that eclipse does this automatically
for java, but what about for visual studio C++?
..cpp files can compile in any order. Their order can never be incorrect.

They may, upon rare occassion, link in the wrong order. You probably don't
have that problem.

You need to report the actual problem you have, before thinking the build
order will fix this problem. If, for example, you have missing identifiers,
then you might have incomplete .h files.

Next, you must understand this newsgroup is only qualified to discuss raw
C++ itself, not all its compilers or their options. If you have a problem
that any C++ developer could help you with, post it here. If your problem
appears to come from VC++, try news:microsoft.public.vc.language instead.

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Nov 10 '06 #2

p_****@encs.concordia.ca wrote:
hello.
I have 3 files:
parent.cpp
child.cpp
driver.cpp

I am working in visual C++ 6.0 and have all the files in one same
project. When I ask the IDE to biuld my project, it compiles the code
in such a way that the order makes it incorrect. For example, it
compiles the parent.cpp file after child.cpp . Any ideas on how to
specify a building order? I know that eclipse does this automatically
for java, but what about for visual studio C++?

Thanks for your heads up.
Building order should not affect the initialisation of your objects. If
it does, you have undefined behaviour. Since you aren't describing the
objects that are causing this, we can't help.

See if the following describes your issue:
How do I prevent the "static initialization order fiasco"?
http://www.parashift.com/c++-faq-lite/ctors.html
#faq-10.12

Nov 10 '06 #3
Phlip wrote:
.cpp files can compile in any order. Their order can never be incorrect.
Well, I talked to my professor and it was a syntax error. When I fixed
it, the program compiled and I understand now that compile order is not
an issue.
They may, upon rare occassion, link in the wrong order. You probably don't
have that problem.
Ok, I guess I'll take a look at the link that Salty_Peter sent me ( How
do I prevent the "static initialization order fiasco"? ) for more on
it.
Next, you must understand this newsgroup is only qualified to discuss raw
C++ itself, not all its compilers or their options. If you have a problem
that any C++ developer could help you with, post it here. If your problem
appears to come from VC++, try news:microsoft.public.vc.language instead.
Thanks, but I have no confusion regarding this. I was only stating my
environment so that you could understand the context of the issue,
which I deemed a C++ one and not a VC++ one. Though I appreciate you
setting the record straight and will be carefull to post things at
their appropriate place.

Phil.

Nov 10 '06 #4
p_adib wrote:
>Next, you must understand this newsgroup is only qualified to discuss raw
C++ itself, not all its compilers or their options. If you have a problem
that any C++ developer could help you with, post it here. If your problem
appears to come from VC++, try news:microsoft.public.vc.language instead.

Thanks, but I have no confusion regarding this. I was only stating my
environment so that you could understand the context of the issue,
which I deemed a C++ one and not a VC++ one. Though I appreciate you
setting the record straight and will be carefull to post things at
their appropriate place.
The exact hair to split (unless you post code with a syntax error in it for
us to review) is that only someone familiar with the VC++ environment can
tell you how to change the order it will compile its input files.

Always state your compiler anyway, because you might indeed have a
compiler-specific bug. The admonition is not against stating your compiler's
name, it is against asking a generic group how to configure a specific
compiler correctly.

Try to answer questions here for a while, and you will see what I mean!

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Nov 12 '06 #5
Phlip wrote:
The admonition is not against stating your compiler's
name, it is against asking a generic group how to configure a specific
compiler correctly.
Thank you Phlip for helping me discern this issue.

Nov 22 '06 #6
Phlip wrote:
The admonition is not against stating your compiler's
name, it is against asking a generic group how to configure a specific
compiler correctly.
Thank you Phlip for helping me discern this issue.

Nov 22 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: joseph speigle | last post by:
hi, To see the query results in native language see http://database.sarang.net/?inc=read&aid=5368&criteria=pgsql&subcrit=qna&id=&limit=20&keyword=&page=1 the simpler url is ...
2
by: Nick | last post by:
So, this link: http://msdn2.microsoft.com/en-us/library/54dwfbb7.aspx says, "The build order is inferred from the top-down order of the codeSubDirectories collection. The App_Code directory is...
3
by: Hartmut Dippon | last post by:
Hi all, I hope somebody can help me with following problem: I have an application where I can drag&drop files/dirs from within explorer onto my form. If multiple files/dirs are selected I...
2
by: fuchsia555 | last post by:
is there any way to move files from old host to new host without upload the files from my computer i have asked my hosting about FXP but they doesn't support it can it be done by any way or by...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.