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...
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 <=...
Program this using C please The program will read from standard input two things - a...
Program this using C please The program will read from standard input two things - a string str1 on the first line of stdin (this string may be an empty string) - a string str2 on the second line of stdin (this string may be an empty string) Note that stdin does not end with '\n'. The program will output a string that is the concatenation of string str1 and string str2 such that any lower-case alphabet character (a-z) will...
Write a C++ code using while loop which is getting the two integers from the user,...
Write a C++ code using while loop which is getting the two integers from the user, and output how many numbers are multiples of 5, and how many numbers are multiples of 7 between the two integers (inclusive).
Write using C++ a) Inputs two 1D arrays of doubles A[i] and B[i] from the keyboard...
Write using C++ a) Inputs two 1D arrays of doubles A[i] and B[i] from the keyboard with a maximum size of 1000. The elements are input one at time alternating between A and B (ie A[0],B[0],A[1],B[1], …, A[i],B[i]) until a value of less than -1.0e6 is input or i >= 1000. Then the program continues to part b). b) Calculates C = A + B, where + is vector addition (ie C[i] = A[i] + B[i]), and prints each element...
C&A makes two types of products using four machines from 9 a.m. to 5 p.m. each...
C&A makes two types of products using four machines from 9 a.m. to 5 p.m. each day. Product A visits machines 1, 2, and 4. Product B only visits machines 1 and 3. The capacity is 0.4 unit per minute at machine 1, 0.12 unit per minute at machine 2, 0.2 unit per minute at machine 3, and 0.3 unit per minute at machine 4. The demand per day is 40 units for Product A and 160 units for Product...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT