Tag Archives: The compiler

QT learning 3: configuration and testing of QT creator 2.4.1 development environment

1. System environment
Host operating system: Ubuntu 10.04
Host compiler: gcc4.4.3,
Cross compiler: arm-linux-gcc-4.3.2
Prerequisites: build three compiled versions of Qt4.6.3: PC,X86, ARM
 
2. Install
Qt_SDK_Lin32_offline_v1_2_en.run
Download address: http://www.developer.nokia.com/dp?uri=http%3A%2F%2Fsw.nokia.com%2Fid%2F8ea74da4-fec1-4277-8b26-c58cc82e204b%2FQt_SDK_Lin32_offline
 
Run it directly and follow the default steps to install it. It’s included
Qt creator — against 2.4.1
 
3. Configuration of Qt-Creator development environment
1. Start Qt-Creator.
2. In the QT-Creator menu bar Tools–>; Options opens the Options window.
3. On the left side of the Options screen, click Build & Run—> The right side of QtVersions displays the QTVersions setting interface.

 
4. Click Add on the right side to Add the path of qmake:

At this point, Qt- Creator is configured.
 
 
 
5 sample
Here is divided into two parts, first compiled under x86, and run under QVFB, and then compiled under ARM, moved to the development board to run.
From/usr/local/Trolltech QtEmbedded 4.6.3/demos copy books routines to root under/TMP folder.
 
5.1×86 compilation and debugging
5.1.1 Start Qt-Creator, File–>; Open File or Project,
Open the root/TMP/books/books. Pro.
 
5.1.2 Select Compiler

Click Finish and the screen appears

The lower on the left allows you to modify compiler-specific configurations at any time
 
5.1.3 Modify the configuration
Click and add the -qws parameter, because you want to run under QVFB

 
5.1.3 compile

5.1.3 run
Start the QVFB
#qvfb -width800 -height 480 &
Run

So this is the result
 
5.2 Compiling and debugging under ARN
Leave it on hold
 

 

Reference:
1. Qt embedded environment construction and transplantation
http://blog.chinaunix.net/uid-26119896-id-3141782.html
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Make :arm-linux-g++:Command Not Found Make :arm-linux-g++:Command Not Found Make :arm-linux-g++:Command Not Found: Make :arm-linux-g++:Command Not Found: Make :arm-linux-g++:Command Not Found

Solution of VS2008 unable to open GL / glaux. H header file

2011-04-15 wcdj
 
I don’t know why there is no OpenGL header file in SDK after VS2008. Here is a summary for this problem.
 
In Lesson 6 of learning Nehe’s texture mapping, I initially needed to use the header file containing gl/glaux. H, but found that I didn’t have this header file on my system. There are two header paths in the compiler that reference OpenGL:
C:/Program Files/Microsoft SDKs/Windows/v6.0 A/include/gl/gl h (the default)
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/gl/glut. H (the new gl manually folder)

Googled the solution.

thod 1: Find the most used solution, but I do not have VS2003 or VS2005 installed on my system, so I cannot copy it.
I have been porting old openGL program to VS2008. I have solved the problem by copying the “include/gl/glaux.h” and “lib/glaux.lib” from the VS2005 Platform SDK located on “C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK” To the PlatformSDK of VS2008 located on “C:/Program Files/Microsoft SDKS /Windows/ V6.0a “


Based on the reply to https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1065518& SiteID=1, it looks like glaux. Lib is deprecated. Instead link to kernel32.lib, user32.lib, gdi32.lib and advapi32.lib


The easiest way to sort this out is to:
) Install Glut3.6 or newer as directed.
2>pen Visual Studio 2008 and create a new project
3) Cho>C ++ -Empty solution
4) Import Al> the files from your previous OpenGL project
5) delete all headers i.e.
#include < gl/glu.h>
#include < gl/gluax.h>
and any other GL headers
6) then replace with #include < gl/glut.h>
7) recompile.

this worked for all of my 2003 & 2005 Solutions.

thod 4: Download Missing Files.
1: download the source CSDN download
OpenGL installation package download required documents:

http://d.download.csdn.net/down/2560229/ssagnn23 include:
GL. H GLAUX. H GLU. H glut.
H GLAUX. LIB GLU32. LIB glut32. LIB glut. LIB OPENGL32. LIB
GLAUX. DLL GLU32. DLL glut32. DLL glut. DLL OPENGL32. DLL

VS2008 without GL. H, H, glu.h, GLAUX. Lib, glu32.lib, opengl32.lib.

1) Copy GLUX. DLL, GLUT32.DLL, GLU32.DLL and GLU32.DLL to C:/WINDOWS/system32, which should already have OpenGL32.DLL and GLU32.DLL.
. (2) the GL H, GLAUX. J H, glu. H, glut. H a copy to the C:/Program Files/Microsoft Visual Studio 9.0/VC/include/GL
. (3) the GLAUX LIB and Glu32. LIB, glut32. LIB, Opengl32. LIB, C:/Program Files/Microsoft Visual Studio 9.0/VC/lib

br>>
nehe SRC – cn – nehe OpenGL tutorials Chinese version and the code download

http://code.google.com/p/nehe-src-cn/downloads/list nehe OpenGL tutorial Chinese version and the code download

http://www.yakergong.com/nehe/ provides each Lesson # sample code and the file you need.

4 according to the method, after downloading the file and configure, recompile, without the previous mistakes, documents found, but the following mistakes.
error C2664: “auxdibimageLoadw” : Cannot convert parameter 1 from “char *” to “LPCWSTR”
is is because I am building a Unicode character set based project, so I want to use wide characters. It is also possible not to use Unicode character sets in the property page ->; Configure properties ->; You can modify it in general. Select not to use the Unicode character set here; that is, select Unset. And then recompile it. OK!

br>>

reference:
missing glaux. H in v6.0 a SDK?

http://social.msdn.microsoft.com/Forums/en/windowssdk/thread/b66e5f7a-91f6-4dbe-b388-0c131008b08f project under VS2003 under VS2008 compilation, however, Can’t find the gl/glaux. H

http://topic.csdn.net/u/20070930/15/6a900f21-8e41-4325-862f-f6df3a425f36.html VS 2008 OpenGL configuration

http://lujun5918.blog.163.com/blog/static/287227712011013114410553/ Load images generated texture opengl program
http://topic.csdn.net/u/20070823/19/4497cb18-be2a-464f-ad20-b12191a61b26.html
 
 
 
 

Flash back after vs compiler running, processing method

How to solve the problem of flash back!!!!!!
I habitually deal with this problem in three ways
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — –
1, system (” pause “);
2, getchar ();
3, Ctrl + F5
Let’s discuss the pros and cons of each separately: Welcome to the land of the Kings
System (” pause “) : need to include the preprocessing header #include< stdlib.h> ||#include< windows.h>
Usage: put return (); Before the return statement, otherwise there is no meaning
Advantages: solve the flashback problem, small side effects
Disadvantages: call system function, large memory overhead

Getchar () :

Usage: put return (); Before the return statement, otherwise there is no meaning
Advantages: low overhead, receive a character to end the program
Cons: Use it on a case-by-case basis, because getchar (); You need to accept a string to represent the end, and some functions explicitly need to accept a string as the return value, if you use getchar (); To solve the flashback problem, which can be confusing and introduce errors when the program is running.
can see, although can solve the running results of the flashback problem, but in the processing is completely different, although in the operation is also approximately the same, but in the memory, CPU and other levels, overhead is sometimes different, so you can choose according to your preferences for a way for you !!!!! System (” pause “) is recommended; This way, the introduction and processing of files is also more careful, if there is a heavy use of system functionality is, of course. windows.h> #include< stdlib.h> Of course, it is suitable for those who use a lot of library functions

 

Copy forbidden in C + +++

A common way to disallow copying classes is to define copy constructors and assignment functions as private functions, as shown in effective c++ :
Real estate agents sell houses, and software systems that serve such agents naturally have a class to represent the houses being sold:
class HomeForSale { … };
Every real estate agent is quick to point out that every property is unique — no two are exactly alike. In this case, the idea of making a copy for a HomeForSale Object is puzzling. How can you copy something unique?So it’s best to make things like this attempt to copy a HomeForSale Object non-compilable:
HomeForSale h1;
HomeForSale h2;
HomeForSale h3(h1);// attempt to copy the h1 – should
// not compile!
h1 = h2;// attempt to copy the h2 – should
// not compile!
Alas, the way to prevent this kind of compilation is not that straightforward. In general, if you don’t want a class to support some kind of functionality, you can simply not declare the function that gives it that functionality. This strategy does not work for copy constructor (copy constructor) or copy assignment operator (copy assignment operator) because, as indicated in Item 5, if you do not declare them and someone wants to call them, the compiler will declare them for you.
That limits you. If you do not declare copy constructor or copy assignment operator, the compiler can also generate them for you. Your class will also support copying. On the other hand, if you declare these functions, your classes will still support copying. During this period, our aim is to prevent copying!
The key to solving this problem is that all compiler generated functions are public. To prevent these functions from being generated, you have to declare them yourself, but you have no reason to declare them public. Instead, declare the copy constructor (copy constructor) and the copy assignment operator (copy assignment operator) private. By explicitly declaring a member function, you prevent the compiler from generating its own version, and by declaring the function private, you prevent others from calling it.
In general, this option is not very safe, as the member and friend functions can still call your private functions. In other words, unless you’re smart enough not to define them. So, when someone accidentally calls them, there will be an error at link-time. This technique – declaring member functions private yet deliberately failing to implement it – is indeed very good. In the iostreams library of C++, there are several classes using this method to prevent copying. For example, if you look at the definitions (definitions) of ios_base, basic_ios, and Sentry in your standard library implementation, you will see that the copy constructor (copy constructor) and the copy assignment operator (copy assignment operator) are declared private and are not defined.
To apply this trick to HomeForSale, it’s simple:
The class HomeForSale {
public:

Private:

HomeForSale (const HomeForSale&) ;// declarations only
HomeForSale& operator=(const HomeForSale&) ;
};
You’ll notice That I omitted the name functions’ parameters. It’s not necessary, it’s just a common practice. After all, functions are not implemented and are less likely to be used, so why specify parameter names?
For the above class Definition, the compiler will prevent a client from attempting to copy HomeForSale Objects, and if you accidentally do so in a Member or friend function, the linker will protest.
Will link – time error (connection) in advance to compile time is feasible after all, the discovery of the error (early than late found good), by not HomeForSale itself declared in the copy constructor (copy constructor) and copy the assignment operator (copy assignment operator) is a private, but in a to prevent copying (prevent copy) and specially designed base class (base class) in a statement. The base class itself is very simple:
Class Uncopyable {
protected:// allow construction
Uncopyable () {}// and destruction of
~ Uncopyable () {}// derived objects…
Private:
Uncopyable (const Uncopyable&) ;//… But prevent copying
Uncopyable& operator=(const Uncopyable&) ;
};
To prevent copying HomeForSale Objects, we must now make it inherit from Uncopyable:
Class HomeForSale: private Uncopyable {// class no longer
…// declares copy ctor or
};// copy the assign. Operator
This is done because if someone — even a member (member) or friend function (friend function) — tries to copy a HomeForSale Objects (object), the compiler will attempt to generate a copy constructor (copy constructor) and a copy assignment operator (copy assignment operator). As explained by Item 12, the compiler-generated versions of these functions attempt to call the corresponding functions of the Base class, and these calls are rejected because the copy operation is private in the Base class.
The implementation and use of Uncopyable contain subtlety. For example, inheritance from Uncopyable need not be public (see Items 32 and 39), and Uncopyable’s destructor need not be virtual (see Item 7). Because Uncopyable does not contain data, it meets the condition of Empty Base Class Optimization described by Item 39, but because it is a base class, multiple inheritance cannot be introduced for application of this technique (see Item 40). On the other hand, Multiple inheritance sometimes defies empty Base Class optimization (see Item 39 again). In general, you can ignore these subtleties and use Uncopyable only as demonstrated here, because it works like an advertisement. You can also use a version available in Boost (see Item 55). That class is called noncopyable. That’s a good thing, I just found that name a little UN – (no…) HMM… Nonnatural.

Some problems in using arrays

/*
* array note some issues
*/
#include < iostream>
using namespace std;
Int main()
{
const int ArraySize = 5;
// initializes the elements in the array, and the uninitialized elements are by default filled with the value 0, representing the NULL character (NULL or \0)
int arr[ArraySize] = {10,3,5};

// array name, which represents the starting address of the first element (direct array name is recommended)
cout < < “arr = ” < < arr < < endl;
// array is a collection, take the address of the array name, get is the first address of the collection represented by the array (generally not recommended to use the address of the array name)
cout < < “& arr = ” < < & arr < < endl;

{
/* array name itself is not a variable, so it does not occupy storage space, nor can it be used to store data; ,
, which simply represents a data, as a value, it represents the address of the first data element in the array. */
// for example, the following is wrong!!
/* compile times wrong: assigning to an array from the an, initializer list */
// arr = {10,16,8};
// therefore, arrays cannot be assigned, only array elements can be initialized or assigned.
}
// if an array is defined and not initialized, its output will be garbage instead of having no value
/*cout < < “No array initialization, garbage data output!” < < endl;
for(int I = 0; i ! = ArraySize; I++)
cout & lt; < arr[i] < < “‘;
cout & lt; < endl;

// input data, assign values to data elements in arr array
/* even if the number of input data elements is greater than the length of the array, cin will only extract required data from the input buffer according to the length of the array
, while the remaining data will be left in the input buffer for use next time */
//cout < < “The input data are:”;
//for(int I = 0; i ! = ArraySize; I++)
// cin & gt; > arr[i];

// below are three different ways to output the address of each array element in memory
/*cout < < “Method 1:” < < endl;
for(int I = 0; i ! = ArraySize; I++)
cout & lt; < “& arr[” << i << “] = ” < < & arr[i] < < endl;
cout & lt; < “Method two:” < < endl;
for(int I = 0; i ! = ArraySize; I++)
cout & lt; < “[arr+” << i << “] = ” < < arr+i < < endl;
cout & lt; < “Method 3:” < < endl;
for(int I = 0,*p = arr; p ! = (arr+ArraySize) & & i ! = ArraySize; I++ p++)
cout & lt; < “p -[” << i << “]= ” < < p < < endl; */

/* the following four methods of outputting elements in an array have no errors;
the compiler changes the brackets in the array at compile time :(both sides are equivalent to each other)
arr[I] < => * (arr + I)
* (arr + I) & lt; => * (I + arr)
* (I + arr) & lt; => I (arr)
arr [I] < => I [arr]
I is the offset, indicating the number of elements of the offset first element */
/*for(int I = 0; i ! = ArraySize; I++)
cout & lt; < arr[i] < < “‘;
cout & lt; < endl;
For (int I = 0; i ! = ArraySize; I++)
cout & lt; < *(arr+i) < < “‘;
cout & lt; < endl;
For (int I = 0; i ! = ArraySize; I++)
cout & lt; < i[arr] < < “‘;
cout & lt; < endl;

for(int* p = arr; p ! = (arr+ArraySize); P++)
cout & lt; < *p < < “‘;
cout & lt; < endl; * /

cout <
cout < < “The consequences of a cross-border visit!” < < endl;
int iNum = 123,iLen = 90;
int array[7] = {10,3,6,8,5,9,7};
for(int I = -2);
for(int I = -2);
for(int I = -2); i ! = 9; I++)
cout & lt; < array[i] < < “‘;
cout & lt; < endl;

cout & lt; < iNum < < “—” < < iLen < < endl;
// Out-of-bounds storage of data can result in the value of other variables, and may even cause the program to crash (which didn’t happen, which is weird!!).
for(int I = -2; i ! = 7. I++)
cin & gt; > array[i];
for(int I = 0; i ! = 7. I++)
cout & lt; < array[i] < < “‘;
cout & lt; < endl;
cout & lt; < iNum < < “—” < < iLen < < endl;
return 0;
}

CCS compiler reported an error: error ා 10234-d: unresolved symbols remain

When I just contacted the CCS compiler and created a new test project, the following error occurred:
error #10234-D: unresolved symbols remain
If some of the system’s declared function calls fail.
Solutions:
Right click engineering -& GT; Properties-> Build-> ARM Linker-> File Search Path, add driverlib.a link:
“${CC3200_SDK_ROOT}/driverlib/CCS/Release/driverlib.”

Fatal error C1010: unexpected end of file encountered while looking for precompiled header. Did you forget to add “ා include” StdAfx. H to the source

Fatal Error C1010: Unexpected end of file encountered while looking for precompiled headers. Did you forget to add “#include” stdafx.h “to the source?
Error analysis:
this error occurs because the compiler is looking for a precompiled indicator header (default #include “stdafx.h”) when the file does not end as expected. The header file “stdafx.h” with precompiled instructions was not found.
(because the project of every CPP file attributes the default is to use the precompiled header (/ YU), but add a third party documents not # include “stdafx. H” precompiled directives, so the compiler in the CPP file until the end did not find it)
my this problem occurred in, by means of adding files to add to existing within the MFC one big tuo. H and. CPP file. These.h and.cpp files belong to the standard C++ open source code category and have no deeper relationship with MFC.
Solution: a.

1) in the solution explorer, right-click on the corresponding. CPP file, click “properties”
2) on the left side in the configuration properties, PM on “C/C + +”, click “precompiled header”
3) changes on the right side of the first line of “create/use precompiled header,” option from the “use precompiled header (/ Yu)” to “do not use the precompiled header”
4) note:
2.
(not recommended)
1) in the solution, right click on the project, click on properties
2) in the configuration properties -> c/c++ -> Changing “use the precompiled header (/YU)” to “do not apply the precompiled header”
in the precompiled header will make every compilation process very slow
Refer to the blog: http://blog.csdn.net/zrm_1995/article/details/68490749?locationNum=2& fps=1