|
I was told a while back that to get a release build of a project, I click Build on the Build menu, and the project executable is found in the project's debug folder. Recently, I have been told that this build is not a release build, but a debug build. I am trying to get a release version of my program, so any help clarifying how to get a release build of a project would be nice.
Thanks
ps, I am using VS C++ 2005 Express
|
|
|
|
|
If you're using VS 2005:
you should be able to go to Project then properties then under configuration there's a place where you can select release or debug.
If you're using VS 6.0:
you should be able to go to Project then settings then you can select "Settings for:" either Debug or Release
Kitty5
|
|
|
|
|
I am using VS C++ 2005 Express (VS 2005), and I have found that properties window, but I am not sure which setting I need to change to get my project to build in release mode.
|
|
|
|
|
In VS 2003 and VS 2005, the active configuration under build can be selected in a dialog box activated from menu: Build --> Configuration Manager. Then change the value of Active Solution Configuration drop-down list to "Release".
In VS 6, use Build --> Set Active Configuration menu command.
After this rebuild your project.
|
|
|
|
|
Ok, I have changed the setting, Where is my executable built? Is it still in the project's debug folder? Thanks.
-- modified at 11:07 Wednesday 21st June, 2006
I am also getting errors from this process because the compiler says: "cannot open precompiled header: \release\test.pch"
I'm not sure what is going wrong. Any ideas? Thanks
|
|
|
|
|
In the projects Release folder.
|
|
|
|
|
The output file should be in the Release folder. In order to see or change this folder, open the project's properties dialog box and see the General --> Output Directory field.
|
|
|
|
|
Thanks. I am using the stdafx precompiled header, can I just transfer the .pch file from the debug to the release folder, or will that just end up creating a debug build instead of a release build?
Thanks
|
|
|
|
|
You will need to rebuild the whole application as "release", the precompile header will be redone in the release folder.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
No, the PCH files are different in Debug and Release build. You should rebuild your application, and the PCH file will be created by the compiler.
|
|
|
|
|
The compiler will not precompile the header automatically, and creates a fatal error, when I try to compile, because it is trying to read the precompiled header, and it is not able to find the file. Is there a setting that would be able to be reset to get the compiler to create the header?
|
|
|
|
|
In a normal project created by the Wizard, you should have the "stdafx.cpp" file. Right click on it in Solution Explorer and go to Properties dialog.
In the C/C++ --> Precompiled Headers --> Create/Use Precompiled Header, you should have "Create Precompiled Header" option.
For the rest of the files, actually for the entire project, in this field you should have "Use Precompiled Header".
If you still have troubles, maybe creating of a new project will help?
|
|
|
|
|
Thanks very much, that worked.
I don't think you can create a new managed c++ project (not windows forms) in express. I had to get a managed project, and then strip all the code out of it, so creating a new project probably wouldn't be a good idea
|
|
|
|
|
Hi,
I am changing my dialog based MFC application to SDI application.
I have the initialization code in TestDlg::OnInitDialog(), in the part
//TODO: Add extra initialization here
What is the equivalent function in SDI? Where can I add this extra initialization? I see CAppView::OnInitalUpdate() function, but there isn't
//TODO: Add extra initialization here comment.
Thanks,
Harsha
|
|
|
|
|
One such place is the document's OnOpenDocument() method, or the view's OnInitialUpdate() method. It really just depends on what it is that you are initializing.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
Thank you. I am adding the initialization code related to the controls I have
added on IDD_APP_FORM (Dialog).
So I guess I should add initialization code to view's OnInitialUpdate() method.
In which case document's OnOpenDocument() method is used?
Thanks,
Harsha
|
|
|
|
|
harsha1305 wrote: In which case document's OnOpenDocument() method is used?
When you want to reinitialize the existing CDocument object, rather than create a new one.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think you can do this in CChildView::OnCreate handler for WM_CREATE notification.
|
|
|
|
|
Hello,
how to sort an vector! is there any codesnippet or example for me? i try but my solution dont works!
This is what i try before:
<br />
typedef vector<CVector>VectorGlobal;<br />
VectorGlobal vec;<br />
<br />
while(int_value < 10)<br />
{<br />
vec.push_back(CVector(int_value, cstring_value, cstring_value));<br />
}<br />
<br />
VectorGlobal::iterator iter;<br />
<br />
for(iter = vec.begin(); iter != vec.end(); iter++)<br />
{<br />
TRACE(L"CSindex: %s, Url: %s\n", iter->csIndex, iter->csUrl);<br />
}<br />
sort(vec.begin(), &vec[vec.size()]);<br />
<br />
for(iter = vec.begin(); iter != vec.end(); iter++)<br />
{<br />
TRACE(L"CSindex: %s, Url: %s\n", iter->csIndex, iter->csUrl);<br />
}<br />
after i call the sort function the datas stay unsortet, where is the error, how to call the sortfunction für an vector?
regards
break;
-- modified at 10:24 Wednesday 21st June, 2006
|
|
|
|
|
|
break; wrote: sort(vec.begin(), &vec[vec.size()]);
?
try: sort(vec.begin(), vec.end());
but, more importantly, since you have a vector of CVector, what does your CVector comparison function look like ?
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hi,
thaks for answers, the CVector is maybe a wrong name, this is very simple class:
<br />
class CVector<br />
{<br />
public:<br />
CString csName;<br />
CString csLastName;<br />
UINT iIndex;<br />
}<br />
bool operator==(const CVector& x, const CVector& y)<br />
{<br />
return (x.csUrl == y.csUrl) && (x.iIndex == y.iIndex);<br />
}<br />
<br />
bool operator<(const CVector& x, const CVector& y)<br />
{<br />
return x.iIndex < y.iIndex;<br />
}<br />
and the compare functions are global, this sample is from the MSDN!!
break;
-- modified at 10:31 Wednesday 21st June, 2006
|
|
|
|
|
if i run your code (with minor adjustments to make it compile - and fill with random data), it works fine - they are sorted by index:
class CVector
{
public:
CString csIndex;
CString csUrl;
UINT iIndex;
CVector(int i, char *a, char *b)
{
iIndex = i;
csIndex = a;
csUrl = b;
}
};
bool operator==(const CVector& x, const CVector& y)
{
return (x.csUrl == y.csUrl) && (x.iIndex == y.iIndex);
}
bool operator<(const CVector& x, const CVector& y)
{
return x.iIndex < y.iIndex;
}
.... main
typedef vector < CVector > VectorGlobal;
VectorGlobal vec;
int int_value = 0;
while(int_value < 10)
{
char a[2];
a[0] = 'a' + (rand() % 26);
char b[2];
b[0]= 'A' + (rand() % 26);
a[1]=b[1]=0;
vec.push_back(CVector(rand() % 40, a, b));
int_value++;
}
VectorGlobal::iterator iter;
for(iter = vec.begin(); iter != vec.end(); iter++)
{
TRACE("CSindex: %s, Url: %s Idx: %d\n", iter->csIndex, iter->csUrl, iter->iIndex);
}
sort(vec.begin(), vec.end());
for(iter = vec.begin(); iter != vec.end(); iter++)
{
TRACE("CSindex: %s, Url: %s Idx: %d\n", iter->csIndex, iter->csUrl, iter->iIndex);
}
output:
CSindex: p, Url: H Idx: 14
CSindex: g, Url: H Idx: 4
CSindex: m, Url: E Idx: 2
CSindex: y, Url: L Idx: 25
CSindex: l, Url: F Idx: 1
CSindex: x, Url: F Idx: 22
CSindex: r, Url: C Idx: 31
CSindex: s, Url: C Idx: 33
CSindex: g, Url: G Idx: 21
CSindex: w, Url: K Idx: 15
CSindex: l, Url: F Idx: 1
CSindex: m, Url: E Idx: 2
CSindex: g, Url: H Idx: 4
CSindex: p, Url: H Idx: 14
CSindex: w, Url: K Idx: 15
CSindex: g, Url: G Idx: 21
CSindex: x, Url: F Idx: 22
CSindex: y, Url: L Idx: 25
CSindex: r, Url: C Idx: 31
CSindex: s, Url: C Idx: 33
Cleek | Image Toolkits | Thumbnail maker
-- modified at 10:48 Wednesday 21st June, 2006
|
|
|
|
|
Hi Chris,
thanx for answer, i try the same, but take no efect!
break;
|
|
|
|
|
Try this:
class CVector<br />
{<br />
bool operator< (const CVector& that)<br />
{<br />
return this.data < that.data;<br />
}<br />
};<br />
<br />
typedef vector<CVector> VectorGlobal;<br />
VectorGlobal vec;<br />
<br />
while(int_value < 10)<br />
{<br />
vec.push_back(CVector(int_value, cstring_value, cstring_value));<br />
}<br />
<br />
void print(const CVector& v)<br />
{<br />
TRACE(L"CSindex: %s, Url: %s\n", v.csIndex, v.csUrl);<br />
}<br />
<br />
for_each(vec.begin(), vec.end(), print);<br />
sort(vec.begin(), vec.end());<br />
for_each(vec.begin(), vec.end(), print);
As a side note, use STL algorithms instead of custom loops whenever possible (which is almost always).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|