Compiling Source Code on Linux (MINT) - Assistance Needed!

In summary, the user is having trouble compiling source code in Linux and is receiving an error message stating that the C compiler cannot create executables. They are asking for help and have been asked for the command they are using, to which they replied with "configure". The error message is checking for a build system and host system type, and suggests checking the config.log for more details. Other users have suggested potential solutions, such as ensuring the user has write permissions and installing necessary packages. The user is also asked if they tried running the command as a superuser.
  • #1
okwatia
15
0
Whenever i try to compile source code of programs in linux (MINT) it tells me that it cannot compile executables. Can someone help me?
 
Physics news on Phys.org
  • #2
What is the command line you are typing?
 
  • #3
'configure' is a special command script that works out what kind of Unix you have and builds a makefile.
I've never heard of that error - can you post the exact error message?
Did you write the config script - where was it from
 
  • #4
This is the error message:

checking build system type... i686-pc-linux-gnulibc1
checking host system type... i686-pc-linux-gnulibc1
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
 
  • #5
Check the command in config.log
It could be that you don't have write permission to the dir that you are running this in.
Other people suggested that it occurs if you don't have gcc AND g++ installed, or have a faulty install.
On ubuntu/debian try "apt-get install build-essentials"
 
  • #6
Did you try running it as a superuser (using sudo) ?
 

1. What is compiling source code on Linux?

Compiling source code on Linux is the process of converting human-readable source code into machine-readable code that the computer can understand and execute.

2. Why is compiling source code necessary?

Compiling source code is necessary because it allows the computer to understand and execute the instructions written in the source code. It also allows for optimization and customization of the code for the specific computer and operating system it is being compiled on.

3. How do I compile source code on Linux (MINT)?

To compile source code on Linux (MINT), you will need to have a compiler installed on your system. Then, open the terminal and navigate to the directory where the source code is located. Use the appropriate compiler command, such as "gcc" or "g++", followed by the name of the source code file and any necessary flags. For example: gcc mycode.c -o myprogram

4. What if I encounter errors while compiling source code?

If you encounter errors while compiling source code, it could be due to syntax errors in the code, missing dependencies, or incompatible code for your system. Check the error message for more information and try to resolve the issue. You may need to consult online resources or seek assistance from others.

5. Can I automate the process of compiling source code on Linux?

Yes, you can automate the process of compiling source code on Linux by using a build system like make or CMake. These tools allow you to specify the dependencies and commands needed to compile your code, making it easier to compile multiple files or update your code in the future.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Programming and Computer Science
Replies
0
Views
233
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
824
  • Programming and Computer Science
Replies
29
Views
2K
  • Computing and Technology
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
12
Views
3K
  • Programming and Computer Science
Replies
7
Views
651
  • Nuclear Engineering
Replies
6
Views
1K
Back
Top