Talk about several pats of TC and BC

zhaozj2021-02-16  71

[Original] http://www.programfan.com/club/showbbs.asp?id=19980

[This piece of things is that I have been caught out in order to reply to this forum. For it, I have missed the dinner, but also dedicated. To remind you to pay attention, it is specially posted, and I'm doing it! Welcome to presented precious opinion! 2003.10.9 nights] What is TC IDE ????? IDE means that the window you see when you open TC, and its science name is integrated with the development environment (Integrated Development Environment). The IDE mentioned below is its abbreviation. Tc IDE is of course TC integrated development environment, and you will see VC IDE, etc., all refers to this. If you use TC3.0 or BC3.1, I will introduce you to N paths first: 1. TC path: ???? is the installation path of the TC, the default installation is installed under C:, there will be C: / TC, if the drive has changed, it can be modified. Even the subfolders under the drive, such as D: / Work, the TC path at this time is D: / Work / TC. 2. BIN path: ???? This path contains all required executables in TC work, such as Tc.exe, Tcc.exe, make.exe, link.exe, and more. The reason why these files are called executable files, of course, is binary (BIN is the abbreviation of bin ") files, and their feature is that they can run in the command line mode, but some files need to enter command line parameters. . For C or C programmers who have written with Main parameters, they are the meaning and function of the command line parameters. About this issue can be discussed specifically for a topic. However, this can be explained herein is that Tcc.exe, make.exe, link.exe is a typical need for command line parameters, which is the main parameter that can be executed correctly. 3. Work path: Work Directory ???? The default is currently open. This issue is a bit complicated, but it is very simple to say. Complex is complicated in the default. What is it default? First of all, I said this problem is related to the Open mode of the IDE. One way is to click Tc.exe directly in the bin directory, or set the command line path to the bin directory, and then enter the TC (Enter). This is called a standard method inappropriately. If you first open the IDE after installing TC, then the IDE interface after this way will be a very clean, that is, the file window that does not appear last time. The working path in this way is the BIN path. Because you are TC IDE that opens to the BIN path. The second type is very special, that is, you create TC.EXE in other paths (how to build shortcuts belong to basic operations in the system, I temporarily assume everyone, if not, I can discuss it separately), of course This shortcut can also be in the BIN path, this is not unequal, it seems that the shortcut in the BIN path often generates automatically. Regardless of the shortcut, as long as it is valid, then click it to open the TC IDE, and this open IDE's work path is the path where this shortcut is located, not a bin path, although the Ide that actually opens is still bin. There is also an open way. This is the easiest way to operate. That is to set the file association. For example, if you want to click .c or .cpp file to open with Tc.exe, you can use the .txt file to open it directly with Notepad, the method is to set the file default open mode for tc.exe.

The way is related to the operating system, but the Windows series is similar, that is, right-click .c or .cpp file selection file open mode, find the executable, browse the bin directory, find Tc.exe, then select this program to open this program Document ", determined to be both. After you finish, you may find that the file icon that is .c or .cpp is changed, this doesn't matter, this shows that your settings have taken effect. If the icon has no change, it doesn't matter. Since then, you can see the TC IDE window and file source code each time you click .c or .cpp file. Said so many irrelevant words, actually a purpose, open in the current position of the file, the working path of the open IDE is the path to the current source file. The above three ways Open the file after the IDE will give you the current path, but if you forget how to do what you open? Of course, there is a place to see, that is, the display path under the Change Dir under the IDE's File menu. You may also find it here, or you can modify it at any time? you're so smart! That's right, you can change it! After the path, the path is the current working path. Said so much, about what you want to know most is what this path is? Do you need anything necessary? Yes, your question asked someone. I left this post to answer you in this post. Remember! 4. Include path: include Directories ???? The default is the TC path / include, otherwise the program will report an error in compile, such as a few posts a few posts, how to find stdio.h, etc., The reason is not set as required here. Reflexible, if you move the include folder under TC to Siberia, then you will write Siberia / Include.5. Static Library Path: Library Directories ???? Uniquely contains the path to change the incrude to the lib, if you call the lib path to name John, then you should change to the TC path / John.6. Output path: Output Directory, is the path to which your source program is generated. Obj, .exe, etc., the default is the working path, of course, you can modify the path you specified. Modifying how I will explain. 7. Source code path: Source Directory. ??? English meaning: it is the directories where the integrated debugger Looks for source code to libraries That Do Not Belong to the open project. Meansing using the connection library in the integrated debugger The source code path for the connection library specified by the debugger is debugging. Because the engineering used the connection library is originally not an open library program source code. This path is only used when debugging the connection library, so there is a big reason for beginners, especially if not involving programming programs. [2004.5.14 Revision] ???? The following four paths You can see in the window under Options / Directories, of course, you can also modify here. The process of the source file to the executable: ???? After writing the completed code on the window, click the Compile child under the Compile menu or press the prompt to perform shortcuts (Alt F9) is compiling source files, after which this process is completed, You will see the .Obj file under the "Output Path", which is the result of the compilation. Then you need to connect (LINK), the third item is the order in this menu. Only after the first step is successful, you can do this, otherwise this step is impossible to succeed. After this step is successful, your program can be run.

This step is successful, you will see the corresponding .exe file under the "Output Path". For two steps above, you can click Compile / Make (f9) once, of course, if it is wrong, you will also see the prompt information given in the Ide's Message window. Here I inserted a sentence, I would like to ask the questions on the question in the forum. I will give this Message's information together. After doing the above steps, do you not see the program running results? By the way, you have to see the ghost! I told you what to do, you can see the .exe file after the two steps above, indicating that your text source code has been processed by TC's integrated development package, that is, you have seen your labor results, It is that .exe file. As for this file how to handle, if it is very powerful, you can use it to manipulate unmanned aircraft, launch missiles, if you are weak, you can only see "Hello World!". Said so much, then tell you the words of the heart, what is the difference between EXE with tc.exe? Isn't it the name of the file? Isn't it the implementation effect? So, it is a real executable, you can click on it to run, and then look at the results, you can also run in the command line mode, and you will see the results. However, in order to debug, in order to see the execution result after the source file compilation connection, IDE provides you with the convenient operation interface, which is the Run / Run (Ctrl F9) command, click on it or press the shortcut Ctrl F9 you It can be equivalent to seeing the same execution effect as the executable file outside. ???? There are still some need to add: About the View window (Window / User Screen (Alt F5)) function. Because this is the case, it will automatically turn it off after execution of the output function, will not wait for you to see the results, so you need to execute this command to view. But you don't want a mature program, you can't leave IDE. It is like a child, I have to have a child who left my mother, otherwise it will ask people the same age to joke "bad odor unsained", so, in order to avoid this problem, There is a "curve saving country" method that uses the program statement control, you should see more getch () or getchar () in the process code code, is "dry this". Of course, use them not white, can not be less #include (for getch ()), and getChar () is included in stdio.h, this file is generally not lost, but if it is true to find Less than getchar errors, you should think of what is the reason. I am not talking here for specific use methods and differences about their brothers. Otherwise, it will be called - this simple question is still so nonsense! I think some people will still stand out for me: I still want to ask him to say two sentences, you will have a long time!

Oh, so, I'm being compromised, just say half! Don't you marry me on both sides? Then I will lose it!

???? Said so much, remember that there is a promise that it has not been fulfilled: it is about that work path.

???? Ok, here is simple to say, this path-related file contains and read and write related to files.

such as

#include

with

#include "conoe.h"

The difference is that the former is the current first lookup "containing path" and the latter is currently the first lookup work path, so for the compilation system header file like Conio.h, you are using the former, and don't use the latter, and For user-defined such as MyFile.h, myfile.cpp, you are using the latter. This improves the connection speed. ???? Then there is still a little, that is, the situation encountered in the initialization of graphics mode,

INITGRAPH (int *, int *, char *);

The third parameter here is the path to the BGI file, which you may be first spoken, "Isn't it written here?" Yes! " You think about it.

???? Like this class like the code of writing file paths, there are usually two ways, one is absolute path, this is not to say, then relative path, the first-time programming people may come here, so much Path, who is it? Or you know a lot more, say "probably that one is that", I said for a long time, you still don't dare to determine, in case I reload this file or other files next time? Is it difficult to change?

There is this idea is right, no idea is unforgivable, because programming, or more general points, learning computer, must be called true, one is one, two is two, can't come to hurt! I don't tell you nonsense, tell you the answer directly, this relative path is the "work path" I mentioned above!

???? Some things are different in TC2.0 this classic car. For example, using some functions does not need to include header files (Printf, getch, etc.), BGI relative path is the current path, etc., which cannot be moved with the above mode. Everything is going to learn, learn to live, you know how to deal with thousands of changes!

???? Another thing to emphasize is: Fill in the path to IDE environment settings, directory separators "/" only need a single roller, and the program source code, including the file path in the precompilation instruction #include, once required Use the directory separator to replace it with "//". "." Indicates the current directory, ".." indicates the upper class, "..//bgi" means the BGI subdirectory in the superior directory, actually BGI is the same level as the current directory (if it is bin) is the same level, they Both in the TC directory.

The English materials below ??? The following English materials are my cute girlfriend to help me sort it out, spend a few hours.

It is now available to you. I have time to translate them and refer to the place where I have expressed in the article above.

??? Friends, thank my girlfriend for me! Let us bless her!

[2004.3.31]

===================================================

?????????? Director Dialog Box

=============================================================================================================================== Tell

Turbo C Where to Find the Files It Needs to

Compile, Link, And Output Executable Files.

??? 1. Include Directories

The include Director Input Box Specifies INPECIFIES

The Directory That Contains Your Standard

INCLUDE FILES.

??? 2. Library Directories

Library Director Specifies The Directories, THE DIRECTORIES

That Contain your Turbo C Startup Object

FILES AND RUN-TIME LIBRARY FILES.

??? 3. Output Directory

The Output Directory Input Box Specifies THE

Directory That Stores Your .Obj .exe, and

.Map file

??? 4. Source Directories

The Source DirectorIs Input Box Specifies INPECIFIES

The Directories Where The Integrated Debugger

Looks for Source Code to Libraries That Do

NOT Belong to the open provject.

===================================================

???? Guidelines to Entering Directories

===================================================

Use the folowing guidiness when entering

DIECTORIES in The Input Boxes of The Input

Directories Dialog Box:

1. You Must Separate Multiple Directory Path

Names (if allowed) with a semicolon (;). you

Can Use upto a maximum of 127 characters

Including Whitespace.

2.Whitespace Before and After the Semicolonis allowed but not required.

3. Relative and Absolute Path Names Are

Allowed, Including Path Names Relative To The

Logged Position in Drives Other Than THE

Current One. for Example, You Can Enter

?? c: / c / lib; ../ c / mylib; A: bc / math; b: ../ grfx

[Notice: Do not oppose the reprinted article, but the premise is to indicate the original author and the original, thank you! ]

转载请注明原文地址:https://www.9cbs.com/read-16543.html

New Post(0)