Question

In: Computer Science

compile and link two c programs from cmd prompt: using command gcc program1.c program2.h -o main...

compile and link two c programs from cmd prompt: using command gcc program1.c program2.h -o main

but getting error undefined reference to scheduleFCFS not sure how to correct issue.

Solutions

Expert Solution

Steps to compile and link 2 C programs from cmd Prompt are :-

Step 1 : create your 2 C program source files.

Example : "file1.c" and "file2.c". file1.c will contain your main function and file 2.c will contain function definition i.e. actual body of the function.

Step 2 : save your both the files in same location

Example : C:\Users\windows\Desktop

Step 3 : Open command prompt and run the following two commands -

a) navigate the location where you stored your files by using cd (change directory) command.

Example : assume you have placed your files on desktop - cd Desktop

b) run the C-compiler gcc : this will help you to compile your program and also create a executable file that will combine our both the programs. Run the following command and make sure both programs are in same directory

gcc file1.c file2.c -o combined

combined is the name of executable file.

c) run your executable file : make sure you are in the command from n in the same directory, type the name of the executive will file and your program will run

combined

Step 4 : Finish

Thank-You


Related Solutions

> gcc -c lab5.c -lm In file included from lab5.c:8: lab5.h:12: error: expected identifier or ‘(’...
> gcc -c lab5.c -lm In file included from lab5.c:8: lab5.h:12: error: expected identifier or ‘(’ before ‘{’ token > In file included from lab5.c:8: In: Command not found. ]> lab5.h:12: error: expected identifier or ‘(’ before ‘{’ token Too many ('s. > make: *** [lab5.o] Error 1 make:: Too many arguments. #include #include #include #define IN_FILE "lab5.dat" #define OUT_FILE "lab5.txt" /* function prototype */ void find_two_radii (double a, double b, double c, double*radius_inside, double*radius_outside); { *s = 1/2*(a+b+c); *radius_inside...
A compound containing only C, H, and O, was extracted from the bark of the sassafras...
A compound containing only C, H, and O, was extracted from the bark of the sassafras tree. The combustion of 48.9 mg produced 133 mg of CO2 and 27.2 mg of H2O. The molar mass of the compound was 162 g/mol. Determine its empirical and molecular formulas.
A compound containing only C, H, and O, was extracted from the bark of the sassafras...
A compound containing only C, H, and O, was extracted from the bark of the sassafras tree. The combustion of 34.7 mg produced 94.2 mg of CO2 and 19.3 mg of H2O. The molar mass of the compound was 162 g/mol. Determine its empirical and molecular formulas.
An organic compound containing C, H, O, and S is subjected to two analytical procedures. In...
An organic compound containing C, H, O, and S is subjected to two analytical procedures. In the first procedure a 9.33 mg sample is burned which gives 19.50 mg of C02 and 3.99 mg of H20. In the second procedure, a separate 11.05 mg sample is fused (melted) with Na202 and the resulting sulfate is precipitated as BaS04, which (when washed and dried) weighs 20.4 mg. (Appropriate amounts of Na202 and a compound containing barium ion are added.) The amount...
using c plus plus: THE PROGRAMS SHOULD 3 DIFFERENT PARTS AS MAIN, STUDENTTYPE.H AND STUDENTTYPELMP.CPP. I...
using c plus plus: THE PROGRAMS SHOULD 3 DIFFERENT PARTS AS MAIN, STUDENTTYPE.H AND STUDENTTYPELMP.CPP. I ALWAYS GRADE MY ANSWERS. THANKS. Chapter 9 defined the struct studentType to implement the basic properties of a student. Define the class studentType with the same components as the struct studentType, and add member functions to manipulate the data members. (Note that the data members of the class studentType must be private.) Write a program to illustrate how to use the class studentType. Struct...
Aspirin can be prepared from salicylic acid ( C 7 H 6 O 3 ), which...
Aspirin can be prepared from salicylic acid ( C 7 H 6 O 3 ), which has a molar mass of 138.12 g/mol, and acetic anhydride ( C 4 H 6 O 3 C 4 H 6 O 3 ), which has a molar mass of 102.04 g/mol. The density of acetic anhydride is 1.082 g/mL. C 7 H 6 O 3 + C 4 H 6 O 3 ⟶ C 9 H 8 O 4 + C 2 H...
write these programs in c++ using getch() function Write a program that reads 20 integers from...
write these programs in c++ using getch() function Write a program that reads 20 integers from a user using a while loop and determines and prints whether each of those integers is an even number. Write a program that uses a while statement to read integers from a user and prints the sum, average, and largest of these numbers. The input should terminate if the user enters -1.
in C programing language Two numbers entered from the command line (example: calculate.exe 2 + 2)...
in C programing language Two numbers entered from the command line (example: calculate.exe 2 + 2) Add, subtract, divide and multiply by (+, -, /, *) operators Write the C program that makes the calculation using switch-case. hint: operator [2][0] comes from index .
I want flowchart process for this code c++ _____________________ #include<bits/stdc++.h> using namespace std; int main() {...
I want flowchart process for this code c++ _____________________ #include<bits/stdc++.h> using namespace std; int main() { char repeat = 'Y'; for (;repeat == 'Y';){ char empname[222]; float basicSalary, h_r_a, DearnessAllow, tax, netSalary; int e_id; cout<<"\nEmployee Name :"; cin>>empname; cout<<"\nEmployee Id :"; cin>>e_id; cout << "Enter Basic Salary : "; cin >> basicSalary; DearnessAllow = 0.30 * basicSalary; h_r_a= 800; switch (1) { case 1: if (basicSalary <= 2,50,000) tax = 0; case 2: if (basicSalary > 250000 && basicSalary <=...
can you convert this cod from C++ to C language #include<bits/stdc++.h> using namespace std; // Function...
can you convert this cod from C++ to C language #include<bits/stdc++.h> using namespace std; // Function for finding sum of two large numbers string addThese(string a,string b){    // Before proceeding further, make sure length // of a is larger. if(a.size() < b.size()) swap(a,b); int j = a.size() - 1; // Traverse from end of both strings and add (b[i] - '0') to a[j]. for(int i = b.size() - 1; i >= 0; i--, j--) //(b[i] - '0') is nothing...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT