Thursday, July 29, 2010

C + + compiler on the template of separate answers to questions



First of all, C + + standard that a compilation unit [translation unit] is a. Cpp file and include it all. H files,. H file in the code will be extended to include it. Cpp file, and then compile the compiler. cpp file as a. obj file, which has a PE [Portable Executable, the windows executable file] file format, and contains in itself already is a binary code, but may not be able to perform, as and does not guarantee there will be one main function. When the compiler will be a project in all. Cpp files to compile separate ways after, then the connector (linker) to connect to a. Exe file.

For example:

//--------------- Test.h-------------------//

void f ();// here to declare a function f

//--------------- Test.cpp--------------//

# Include "test.h"

void f ()

(

... / / Do something

) / / Here to achieve the function f declared test.h

//--------------- Main.cpp--------------//

# Include "test.h"

int main ()

(

f (); / / call f, f is the external connection type

)
In this case, test. Cpp and main.cpp is compiled into various different. Obj file [name test.obj throw and main.obj], in the main.cpp, calling the f function, but when the compiler main.cpp time, just know that it is only main.cpp contained in the test.h file in the one on void f (); the statement, the compiler will be here, f as the external connection type, or that Its function is to achieve the code in another. obj file, in this case is test.obj, that is, main.obj actually not even a line on the f function of the binary code, and these codes are actually present in test.cpp compiled into the test.obj in. In main.obj call on f command will generate a line call, like this:

call f [C + + in the name of course, after mangling [deal] off]

At compile time, this call instruction is clearly wrong, because there is no line f main.obj the implementation code. Then how should we do? This is the task of the connector, connectors for the other. Obj in [this case test.obj] f the implementation code search to find the instruction after the call f replaced by a call to address the actual entry point address of the function f . Note that: the connector will actually work inside. Obj "connection" has become a. Exe file, and its most critical task is said above, look for an external connection symbol in the other. Obj in the address, then replace the original "false" address.

If this process is a more in-depth:

call f command line but it is not, it is actually the so-called stub, which is a jmp 0x23423 [This address may be arbitrary, but the key is that there is a line command to address a genuine call f action. That is, the. Obj file which calls all of the f, jmp to the same address, in which there really "call" f. This has the advantage that changes of address as long as the connector on the latter's call XXX address for changes on the line. But how to find the f connector is the actual address it [in this case, it is test.obj in].

Because. Obj to. Exe format is the same, in such a file into a symbol table and symbol export table [import table and export table] which will address all the symbols and their associates. This connector as long as the export table in test.obj find symbol symbol f [of course, C + + on f were mangling] address on the line, and then make some offset treatment [because it is two. Obj files into, of course, address will have a certain offset, the connector clear] write main.obj the symbols into the table f occupied by the last one.
This is about process. The key is:

Main.cpp compiled, the compiler does not know f the realization of it all when it comes to just give a call instruction, the connector should be directed to find f for its implementation body. This means that main.obj not on any line of binary code f.

Compile test.cpp, the compiler found a f implementation. Ever since the realization of f [binary code] in test.obj years.

Connection, the connector found in test.obj f the implementation code [binary] address [derived through symbol table]. Then the pending call XXX main.obj address into f the actual address.

Completed.

However, the template, you know, actually the code template function can not be directly compiled into binary code, which must be of a "modernization" process. For example:

//---------- Main.cpp------//

template

void f (T t)

()

int main ()

(

... / / Do something

f (10); / / call f decided to give the compiler where f is a body of concrete f

... / / Do other thing

)



[Next]



That is, if you had not called main.cpp file, f, f is also not specific to main.obj in f there is no arbitrary line on the binary code! ! If you call this:

f (10); / / f to come out with is of

f (10.0); / / f to come out with is of

This main.obj in and will have a f, f are two functions of the binary code. And so on.

But with the current requirements of the compiler know that the template definition, is not it?

See the following example: [to separate the template and its implementation]

//------------- Test.h----------------//

template

class A

(

public:

void f (); / / here is a statement

);

//--------------- Test.cpp-------------//

# Include "test.h"

template

void A:: f () / / template to achieve, but note: not with the current

(

... / / Do something

)

//--------------- Main.cpp---------------//

# Include "test.h"

int main ()

(

A a;

af (); / / Here the compiler does not know A:: f of the definition because it is not test.h inside

/ / So compiler can only hopes the connector so that it might in others. Obj to find something

/ / A:: f the implementation body, in this case is test.obj, however, the latter really have A:: f the

/ / Binary code? NO! ! ! Because C + + standard clearly that when a template is not used when

/ / Hou it should not be a stand out, test.cpp used in the A:: f it? No! ! So Real

/ / Test.cpp compiled on the occasion of the test.obj file on A:: f the line of binary code has not

/ / Then the connector was stoned, and had to give a connection error

/ / However, if you write a function in test.cpp, which calls A:: f, the compiler will it / / with stand out, because at this point [test.cpp in], the compiler know the template definition, they are able to / / enough with current technology, therefore, test.obj symbol export table will have a A:: f the address of this symbol, so the connector will be able to complete the task.

)

The key is: separate compilation environment, the compiler compile one. Cpp file does not know the other. Cpp file exists, it will not find [When faced with hopes it will open symbols connected device]. This model case in the absence of the template works well, but the encounter template was stoned, because the template only when needed will come with modernization, so when the compiler can only see the template declaration, it can not a modernization of the template, can only create a symbolic link with the external connector and look forward to be able to sign out the address resolution.

However, when the realization of the template. Cpp file does not use the template with the current body, the compiler is too lazy to go with, so the whole project. Obj can not find a line on the template with the current body of binary code, then connect devices are dumbfounded! (CSDN)









Recommended links:



Operators burn punched 11 million users four Drama success



Convert mp3 to m4a



introduction Games Simulation



Mp3 to aac converter



mkv files



Picked Recreation



Eighth say C # sharp experience indexer and operator overloading



Ps3 Movie Formats



Sneak Peek! VideoStudio 10 Plus the first to EXPERIENCE



The Process Of Recording Impromptu Slide Show Reaction



SAC went to the Central Organization Department announced the REORGANIZATION of carrier appointment



Ali Mama Ma prove safety push over 1 million registered members Baidu



Job 10 kinds of unhealthy attitude towards students



Presentation slides can also use RealPlayer



Lists Mathematics Education



Jsp, servlet talk about Chinese issues



Thursday, July 15, 2010

The process of recording impromptu slide show reaction


As a report, you often need to make a list, and which lists your thoughts, comments, suggestions or operation. You can use PowerPoint instead of the traditional written form. Operation as follows:

In the slide show view, right click anywhere on the screen, click on the shortcut menu in the meeting.

Click impromptu response tab.

In the note, assigned to a period box, type the required information, then click Add.

If you need to add more action items, repeat Step 3, after click OK.

Impromptu response you specify will appear in the presentation of a new slide at the end. You can use this slide to review the slide show ideas or suggestions put forward by others.



Editor's Note: You can be an impromptu response to the Word or Outlook, Export. Operation as follows:

In PowerPoint's Tools menu, click on the minutes.

Click the Export dialog box minutes.

If you want to create the idea or action that contains Word document, select the ad hoc response to the Microsoft Outlook mail box.

If you want to put Outlook task list (and later assigned to the appropriate person), please select the details of the meeting and an impromptu response to be sent to Microsoft Word check box.

Finally click the output immediately.






Recommand Link:



Moyea SWF to Video Converter Pro



LasVegas Blackberry Converter



For You Games Sports



Flac to mp3



.ts File



Pop Video CONVERTER Plus Free Download



SATELLITE TV on your PC



Catalogs Access Control



Lohan MOBILE Converter



Professional CDA RA MP3 to WMA Convert



ps3 movie Formats



Merry MP3 ID3 Audio To WAV Recorder



3GP Video Converter Tool



Happiness CDA OGG MP3 to VQF Copier



Convert mov to flv



Friday, July 9, 2010

RER AVI Converter

RER AVI Converter is a powerful program, which supports almost all popular file extensions such as AVI, MPEG, WMV, ASF and 3GP as well as other available codecs. It is a powerful video format converter that can convert AVI to video and convert video to AVI. It is also a video to audio converter. It can be used like AVI to iPod converter, AVI to iPhone converter, AVI to Apple TV converter, AVI to 3GP converter. Easy to use and free to try.

Key Features:
1. Convert to AVI format
RER AVI Converter supports converting 3GP/3GPP, 3G2/3GP2, MJPEG, AVI, DivX, Xvid, MPG, MPEG(MPEG-1/2), DAT, FLV, MKV(Matroska), QuickTime(MOV,QT), MP4,?M4V, VOB, WMV, ASF, TS, MPEG-4 AVC, DVR-MS, H.263, H.264, X.264 to AVI format with ease.

2. Convert AVI to video/audio formats
Support converting AVI to video/audio formats such as MP4, MOV, 3GP, 3G2, MPEG, MPG, VOB, ASF, WMV, FLV, H.264 and MP3.

3. Easy to use
If you are a veteran, you will find everything can be called up with a simple mouse click, and the "learning curve" is near zero. Start working from the first launch with the simple and intuitive interface.

4. Customize output quality
Provide flexible output profiles, user can easily customize the video properties, such as file size, bit rate, NTSC/PAL, frame rate, audio codec, and sample rate. RER is easy to modify the name and path of the output file.

5. All decoders and encoders built in
Once you download and install RER AVI Converter, all supported formats can be converted without downloading any more codec.

6. Batch mode Video Converter
Convert several video files with task list at once with high output quality.

7. Safe to install, viruses-free
We respect your privacy. There are no spyware and adware.

8. Email reply within 24 hours
Lifetime free technical support, free upgrade and best quality service. Free to try!



相关链接:



Youtube Backup + Converter Software



COMMENTS Audio CD Burners



Merry MP3 Audio WMA to OGG Conversion



Shine Video Converter



X-CLONER DVD to MPEG



News about Hobby



Free Download Mp4 To 3gp



ImTOO Music CD Burner Pro New



Youtube to QuickTime Utility



YOUTUBE to AVI Plus



Flv



convert mpeg4 to avi



OJOsoft DVD to AVI Converter



convert MP4 to mp3



Easy Games Arcade



Friday, July 2, 2010

SuperBurner DVD Copy

SuperBurner DVD Copy Very easy 400% fast copy DVDs and CDs, Write your data to CD, DVD and even Blu-ray Discs quickly and easily with AVS DVD Copy for FREE. Manage your data storage and make most of it! Real perfectly copy by 1:1 or 1:2 without distortion,Copy DVD to DVD +R/RW,DVD -R/RW with no loss of quality within 10-30 mins.(depends on the spec of your computer). Supports NTSC and PAL Movies.Supports DVD-R/RW, DVD+R/RW. Supports all SCSI,IDE,USB DVD burners/recorder on the marketing.Supports both home / PC DVD Player. Lifetime FREE Technical Support and FREE upgrade for purchase user. Free trial download.30 day money back guarantee.

Supports copy CSS(Content Scrambling System) protected DVD movies (Need advanced Full Version). Copy a dual-layer (D9) movie into one dual-layer (D9) disc. Copy a dual-layer (D9) movie into one regular D5 DVD+R/RW DVD-R/RW Remove unwanted Subtitles/Audios to increase quality. Split DVD-9 into two blanks with all the Special Features,Menus, Subtitles /Languages. Copy DVD to Hard Disk and burn DVD disc from Hard disc. Copy episode DVDs(TV shows on DVD). Remove region protection(Region-free) and Macrovision Protection. Neat User Interface,very easy to use,without any complicated parameter settings . No ASPI drivers needed. You can get DVDs total same as the source DVD discs. Copy DVD very easy. SuperBurner DVD Copy is a best dvd copying software



Recommand Link:



Youtube FLV Backup + Player Professional



Youtube to Psion Pro



Elecard Converter Studio AVC HD Edition



Swift DVD to Divx WMV



Download video to Cowon O2PMP soft



DVD to SONY NWZ-E443 software



Picked Flash Tools



CheapestSoft MPEG4 Converter



Christmas-Idea MOV Encode



Power 3GP/MP4 Video Converter



Christmasgift DVD Editor



Open PS3 Converter



M2ts to vob



FTP Clients SPECIALIST



How do I convert video to iRiver Lplayer



Cartoons - Screen Savers Reviews



Merry WMA VQF to Midi Burner