I'm new in programming and exited to learn new things!
I wanted to create and run makefile in c, to see how it's working, but I'm having the same problem again and again. I will send the picture and the source (from geeksforgeeks) that I'm using.... Thanks a lot 🙏.
https://www.geeksforgeeks.org/how-to-use-make-utility-to-build-c-projects/
I tried to run makefile and then I wanted to use the commands in makefile to see how they r working.
You need to install make, or if it's already installed, update you search path for commands to where it's installed.
Related
I want to make a "hello world" C program using Eclipse IDE on Linux. then I want to compile with my raspberry pi 4 making a cross compiling. I searched some websites but i can´t find anything.
this is what i made but I don´t know what else I need. I tried following this tutorial:
https://www.gurucoding.com/eclipse_as_ide_for_raspberry_pi/04_cross_compilation_setup/
I created a new C program in Eclipse IDE using cross GCC:
https://i.stack.imgur.com/VVGKY.jpg
I Set cross-compiler prefix as "arm-linux-gnueabihf-" and cross-compiler path as "C:\rpi-eclipse\rpi-cross-toolchain\arm-linux-gnueabihf".
https://i.stack.imgur.com/WK59S.jpg
3.When I create the project, gets those 2 errors:
https://i.stack.imgur.com/86AKZ.jpg
4.I made sure to follow this step:
Open "C/C++ Build" -> "Settings" on the left side, then in the "Tool Settings" tab, in the "Cross Settings" screen, make sure Path is "C:\rpi-eclipse\rpi-cross-toolchain\arm-linux-gnueabihf\bin;C:\rpi-eclipse\rpi-cross-toolchain\mingw-make". You may copy and paste it for your convenience (select with mouse, Ctrl+C, Ctrl+V). Click "OK" when done:
https://i.stack.imgur.com/v1ocS.jpg
5.When I build the Debug doesn´t go the errors.
https://i.stack.imgur.com/Os8fN.jpg
CONCLUSION:
I am forgetting something? I need to install something else?
I have team-viewer and Discord so if anyone wants to help me I would appreciate a lot.
Thanks.
ONE ERROR SOLVED: "arm-linux-gnueabihf-gcc" not found in PATH
this error is gone installing this in via console:
apt-get install gcc-arm-linux-gnueabihf
SECOND ERROR SOLVED: "arm-linux-gnueabihf-g++" not found in PATH
this error is gone installing this in via console:
apt-get install g++-arm-linux-gnueabihf
I'm new on Xcode.
I need to make some files run:
they are the implementation of a model that I'd like to apply on my dataset, but at the moment I cannot use them.
Inside the folder there are:
main.cc, Makefile, README
and other files with extentions
.cc,
.c,
.h,
.yld,
.lt
How do I put them on Xcode? And how can I run them from the Terminal?
I have:
OS X El Capitan;
Xcode Version 7.3.1 (7D1014)
Thank you in advance for your help! :)
You can set your build target to be the makefile, but, this will not give you all of Xcode's benifits as an IDE. As far as I know, importing a Makefile based project into Xcode is not easy.
Here is a blog post detailing one example.
You could create a new project with your desired language, and add files to it.
As for how to run from terminal, you cd to project directory, and then you type make. Then you find name of the program created, and you type ./[PROGRAM] to execute it.
I have the MinGW install previously working fine with MSYS. They are installed properly and functioning just well.
I installed the PortAudio library and did the install and got the success message after:
./configure
make
make install
When I try to compile samples:
c:\c>gcc patest_mono.c -o pa.exe
patest_mono.c:50:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
^
compilation terminated.
I'm new. I have a feeling I might be doing something fundamentally wrong with the way I'm trying to create the exe from compiling. It's been somewhat of a puzzle quest so far, but I've tried to figure it out and think I am close but completely missing something.
PATH variable ?
In the PortAudio MinGW build instructions I noticed
"The above should create a working version though you might want to
provide '–prefix=<path-to-install-dir>' to configure. "
I've tried adding C:\MingW\PortAudio into the user path. Doesn't work.
I've also tried running the commands in Bash and they come back with an error message "No Rule to make target 'paexpink'" either with the make command, and with gcc .c -o .exe I just get the same error message as compiling straight from the cmd prompt.
I found another source on stack overflow thread with no answers, but the user had commented that http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio provided them a solution but I tried installing the 5 cpython binaries and under the assumption I did it right, it didn't work either.
Thanks for your help,
Julian
To build and install portaudio, you need to add -prefix=/c/<"path to base of the MinGW directory"> to the ./configure line.
For example: ./configure -prefix=/c/MinGW/
then continue the installation by doing
make
After that, do the
make install
and that should install the portaudio files into MinGW.
After it has finished installing, you need to add -lportaudio to the compile command whenever you compile any programs that you want to use PortAudio in.
For example: gcc -o test test.c -lportaudio
I just figured out how to do this today, so I may have accidentally forgotten a few steps.
I just installed Dev C++ and I am learning C programming.
the code i used was
#include <stdio.h>
int main()
{
printf("Hello world");
getch();
}
I saved it as a .c file. When I compile it works fine, but when I compile and run it says source file not compiled. So I googled buncha things and came across this video on youtube which shows you how to fix it. I also saw other forums on google which suggest the same thing... However, after doing whats asked, Now I can't even compile my code. I get this error
Compiler: Default compiler
Executing C:\Dev-Cpp\bin\gcc.exe...
C:\Dev-Cpp\bin\gcc.exe "C:\Users\ubaid\Documents\C\Untitled1.c" -o "C:\Users\ubaid\Documents\C\Untitled1.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
gcc.exe: Internal error: Aborted (program collect2)
Please submit a full bug report.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.
Execution terminated
I have also used what is asked on this link, and still no luck..
http://learntogeek.com/miscellaneous/solved-source-file-not-compiled-error-in-dev-cpp/
I am using windows 8
I was having this issue and fixed it by going to:
C:\Dev-Cpp\libexec\gcc\mingw32\3.4.2
, then deleting collect2.exe
Install new version of Dev c++. It works fine in Windows 8. It also supports 64 bit version.
Download link is http://sourceforge.net/projects/orwelldevcpp/ .
I guess you're using windows 7 with the Orwell Dev CPP
This version of Dev CPP is good for windows 8 only. However on Windows 7 you need the older version of it which is devcpp-4.9.9.2_setup.exe
Download it from the link and use it.
(Don't forget to uninstall any other version already installed on your pc)
Also note that the older version does not work with windows 8.
This maybe because the c compiler is designed to work in linux.I had this problem too and to fix it go to tools and select compiler options.In the box click on programs
Now you will see a tab with gcc and make and the respective path to it.Edit the gcc and make path to use mingw32-c++.exe and mingw32-make.exe respectively.Now it will work.
The reason was that you were using compilers built for linux.
You can always try doing it manually from the command prompt. Navigate to the path of the file and type:
gcc filename.c -o filename
I found a solution. Please follow the following steps:
Right Click the My comp. Icon
Click Advanced Setting.
CLick Environment Variable. On the top part of Environment Variable Click New
Set Variable name as: PATH then
Set Variable Value as: (" the location of g++ .exe" )
For ex. C:\Program Files (x86)\Dev-Cpp\MinGW64\bin
Click OK
This error occurred because your settings are not correct.
For example I receive
cannot open output file Project1.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe: *** [Project1.exe] Error 1
Because I have no permission to write on my exe file.
After some investigation, and with Dr.Topaz's help, I have learned that you will want to confirm that the program set for g++ in the Compiler Options really does compile the source code. In my case, the C:\Dev-Cpp\bin\g++.exe program did not create an exe, but the C:\Dev-Cpp\bin\c++.exe program did. Either program appears to be intended to take the same arguments and options as GNU g++. I would love to find an actual doc on the Dev-C++ compiler programs, but I have not so far.
You can test the compiler program with a simple example like this:
C:\Dev-Cpp\bin\c++.exe hello.cpp -o hello.exe
Currently in 2021, the Dev-C++ site invites you to download either original Dev-C++ or a newer fork by a group named Embarcadero.
I decided to try the Embarcadero version and the experience was slightly better. The UI is still a tad dated, but the g++.exe program it came with was able to compile programs without issue. Again, take note of where the program is being installed, but in my case, the Embarcadero compiler programs were in C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin.
Both original Dev-C++ and Embarcadero come with mingw-32 versions of the compiler programs that from what I see do work in a Git Bash console, with slight differences such as not recognizing a default locale when using the command std::cout.imbue(std::locale("")).
I faced this similar error, and none of the solutions worked.
so I tried to download the latest version from here, https://www.bloodshed.net/
I rerun the program.
and everything is now working correctly.
I was facing the same issue as described above.
It can be resolved by creating a new project and creating a new file in that project.
Save the file and then try to build and run.
Hope that helps. :)
I know it can sound as a pretty dumb question, but I do not have a great experience with installing downloaded libraries...
Anyhow I downloaded the source code of JudyArrays (which is a C library for a 256-trie for those who doesn't know it) from sourceforge and the installation instructions refers to the make command. I tried to download this utility, but I can't get it work. Which is the correct target makefile? All I managed to get was:
"..path\Makefile.in":15: *** missing separator. Stop.
I tried googling for some help but didn't find anything, either I'm searching with the wrong query string or I'm the only dumb person in the whole planet that can't manage to install it...
Any help? Is there any simpler method?
Thanks everyone
Run your Visual Studio Command Prompt to get a cmd.exe with the proper paths set. cd into the src directory of the JudyArrays source code and run build.bat. This'll compile Judy and produce a .lib and a .dll and a Judy.h header file file you'll have to use in your projects as any other 3. party library.