Configuring C/C++ on eclipse on Fedora - c

I installed Eclipse in fedora and then installed the CDT plugin for developping C/C++ applications . All the installation are done !
So now i can create a C/C++ project but when it comes to running it i got this message
launch failed , Binary not found
and
unable to find full path to gcc.
gcc -O2 -g -Wall -c -fmessage-length=0 -o Rad1.o ../Rad1.c
Internal Builder: Cannot run program "gcc": Unknown reason
Error: Program "gcc" is not found in PATH
Is there any more configuration i must do so C/C++ runs?
Thanks.

Executing c/c++ program with eclipse+unix base plate-forme, it requied object file of the program to execute/run it. So first of all you need to build your program by just pressing Ctr+b to buid it. This will create an object file that was required. Now you enabled to run/execute your programe. Good luck :)

Related

process_begin: CreateProcess(NULL, g++ Hello.C -o Hello, ...) failed. make (e=2): The system cannot find the file specified

I'm trying to make a file into a program on VScode with the Bash terminal, but it reports the above error. I'm relatively new to programming as a whole and trying to follow along with the CS50 course uploaded online; please forgive any incompetence.
below is the entire problem
$ make Hello CC=gcc
g++ Hello.C -o Hello
process_begin: CreateProcess(NULL, g++ Hello.C -o Hello, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [<builtin>: Hello] Error 2
I installed Git and then downloaded chocolatey because I was missing the "make" cmd and I was then able to use the cmd but thats as far as I got before the aforementioned error showed up.
I've already made sure the file directory is correct in VScode via the explorer (Folder -> Hello.C)
I've been attempting this for a couple hours now and genuinely have no idea how to proceed; any advice is appreciated.
I am under the assumption you are using Windows.
Which is very likely your problem.
Under Windows, C Compilers aren't preinstalled, and the compiler you are trying to use (GCC/G++) is a Linux exclusive. MinGW is the Windows equivalent.
From personal experience, programming C under Windows is a hassle, so I can recommend you use WSL (Windows Linux Subsystem) and the corresponding VSCode extension, wich allows you to code in VSCode under Windows with the Terminal, Code and Filesystem running in Linux.
If you were watching this Video, the Prof is using Github codespaces an online cloud service his code runs on (also Linux).

CMake compilation failing on MSYS2

I'm trying to set up CMake for a project I'm working on, and I'm first trying to compile a simple Hello World program in C. I'm using Windows 10 with MSYS2. If I invoke the compiler (GCC) directly in Bash, it compiles fine without warnings or errors and gives an executable as output which prints "Hello, world!" exactly as expected. My problem comes in when I try to use CMake to compile my project. When I run cmake -G Ninja .. to compile my project, it throws this error:
CMake Error at C:/msys64/mingw64/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/msys64/mingw64/bin/cc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/dylanweber/Documents/C-Projects/webapp/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/msys64/usr/bin/ninja.exe cmTC_45340 && [1/2] Building C object CMakeFiles/cmTC_45340.dir/testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_45340.dir/testCCompiler.c.obj
C:\msys64\mingw64\bin\cc.exe -o CMakeFiles/cmTC_45340.dir/testCCompiler.c.obj -c testCCompiler.c
/bin/sh: C:msys64mingw64bincc.exe: command not found
ninja: build stopped: subcommand failed.
Notice how it mentions C:msys64mingw64bingcc.exe... there must be some kind of path delineation problem but I've tried setting the CC environmental variable to C:\\msys64\\mingw64\\bin\\gcc.exe and C:/msys64/mingw64/bin/gcc.exe. I have been clearing the CMake caches between runs.
Here is my CMakeLists.txt file:
cmake_minimum_required(VERSION 3.15)
project(webapp)
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
file(GLOB SOURCES "main/*.c")
add_executable(webapp ${SOURCES})
My code is in a "main" folder which is currently just one "main.c" file, in addition to a build directory used to keep all the temporary files in. The most frustrating part is that CMake was just working an hour ago, and I didn't change anything. What can I do to fix this problem?
The solution was not only installing the MinGW64 version of CMake, but also the MinGW64 version of Ninja as well. Since they have different pathing schemes compared to MSYS, they didn't play well together until they were both on the same POSIX-like platform.

Unable to attach GDB to process from Eclipse CDT

I'm building a plugin on Mac OS X using Eclipse CDT, which streams some data via libwebsockets to a browser websocket connection. The compilation process works fine, and I'm able to run my plugin in X-Plane and see data coming in on Google Chrome as expected.
I want to setup debugging with GDB, but I've been pulling my hair for about a week now without any success. I've created a launch configuration in Eclipse CDT to Attach to Application, but every time the debug session is supposed to start, I just get the following in the Eclipse debug perspective:
When starting the Debug, Eclipse shows me a popup list of running processes, and I select X-Plane, but when starting, it simply shows that the thread is suspended.
I've set up the launch configuration as follows:
As an alternative, I tried setting up a project using a makefile, which can be seen here:
https://gist.github.com/josefvanniekerk/690ad22160789c724490
The gcc and linker invocations from Eclipse CDT look as follows:
Building file: ../src/XPWebSocket.c
Invoking: GCC C Compiler
gcc -DAPL=1 -DIBM=0 -DLIN=0 -DXPLM210 -I../lib/xpsdk_v213/CHeaders/XPLM -I../lib/libwebsockets/lib -O3 -g3 -Wall -c -fmessage-length=0 -fvisibility=hidden -MMD -MP -MF"src/XPWebSocket.d" -MT"src/XPWebSocket.d" -o "src/XPWebSocket.o" "../src/XPWebSocket.c"
Finished building: ../src/XPWebSocket.c
Building target: xpwebsocket.xpl
Invoking: MacOS X C Linker
gcc -L../lib/libwebsockets/build/lib -F/{...omitted...}/Projects/xplane/XPWebSocketLib/lib/xpsdk_v213/Libraries/Mac -framework XPLM -shared -o "xpwebsocket.xpl" ./src/XPWebSocket.o -lwebsockets
Finished building target: xpwebsocket.xpl
I've made double sure that I've passed the -g option to enable debugging, but I just can't get this working.
I've tried pointing the C/C++ Application to /Applications/X-Plane/X-Plane.app/Contents/MacOS/X-Plane, changed it to Debug/xpwebsocket.xpl, tried pointing it to the .xpl file inside the X-Plane Resources/Plugins folder, quite frankly, I have no idea what I'm supposed to do to get debugging to work with X-Plane + GDB.
I've started reading up on trying to establish a GDB debug session from the command line, maybe if I understand that process, I can get around to get Eclipse to work. But who knows how many days of reading up that's going to involve.
Can anyone please offer some advice?
More info just in, GDB trace in Eclipse CDT is showing the following (just the error bits):
033,165 &".gdbinit: No such file or directory.\n"
033,165 13^error,msg=".gdbinit: No such file or directory."
037,222 19-target-attach --thread-group i1 197&
037,223 19^error,msg="Asynchronous execution not supported on this target."
After turning off: "Non-stop mode" in CDT, getting the following:
527,581 18^error,msg="Unable to find Mach task port for process-id 197: (os/kern) failure (0x5).\n (\
please check gdb is codesigned - see taskgated(8))"
Guessing I need to codesign X-Plane executable.
I managed to sort this out by signing gdb using the following guide:
http://ntraft.com/installing-gdb-on-os-x-mavericks/
However, fixing the above only reveals that there's possibly a LOT wrong with GDB on Yosemite.

compiling Vim 7.4 under AIX 6.1

I have a problem while compiling Vim 7.4 under AIX 6.1.
My options for the configure script are: "--prefix /opt/freeware/bin" and "--enable-pythoninterp".
There where no Errors while running the configure Script but when I try to run "make" I get the error message:
cd src && make first
cc -qlanglvl=extc89 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA -DFUNCPROTO=15 -g -o objects/regexp.o regexp.c "regexp_nfa.c"
line 4410.1: 1506-046 (S) Syntax error.
make: 1254-004 > The error code from the last command is
1.
Stop. make: 1254-004 The error code from the last command is 2.
Stop.
Does anyone know what to do?
I had compiled Vim 7.4 in my home directory so I know that there is a workaround but I can't find it anymore.
AIX's built in make (based on standard AT&T make) is not compatible with the Makefiles built by autoconf tools. Use GNU make (gmake) instead. You may already have it installed (check /opt/freeware/bin), install from the Linux Toolbox for AIX set (from IBM), or from one of the websites providing prebuilt GNU tools for AIX systems (perzl, bullfreeware, etc). Just provide an alias from make to gmake, or override the use of make in the Makefile itself.

Compiling an MPI program with mingw and MPICH2 in eclipse juno

Ive been trying to setup mpich2 to compile some programs using MPI on windows 7. The problem that I encounter is that it wont create the binary files when I build a project.
I use the stadard mpi program to test (hello world) and I get this message after building it:
13:33:29 ** Rebuild of configuration Debug for project mpitest **
Info: Internal Builder is used for build mpiCC "-IC:\MPICH2\include"
-O0 -g3 -Wall -c -fmessage-length=0 -o "src\mpitest.o" "..\src\mpitest.c"
The Open MPI wrapper compiler was unable to find the specified
compiler cl.exe in your PATH.
Note that this compiler was either specified at configure time or in one of several
possible environment variables.
13:33:29 Build Finished (took 78ms)
I tried to search for cl.exe but it doesn't exist. I have to say that I also installed openMPI but I didn't use it cause the cluster that I am gonna target run the program is using MPICH2. I have already installed 32bit minGW, 32bit MPICH2 and 32bit openMPI.
Is it normal to not create binaries since i run the .c file in the cluster? If its normal how am i going to check if the program is ok even for 1 process?
Thanks in advance! Cheers!
I found the answer by luck... In the project preferences, select C/C++ build-> Tool Chain editor-> choose cygwin and its done. For some reason i had mingw in that option and wouldnt create binaries, i suppose it needs some other tools that can be found only in the cygwin and not mingw... Still trying to set it and run on the cluster... so many options :/

Resources