Geany Problem
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Geany Problem
Exit code 127: Something wrong with the machine?
That was what I got on my search for why my Hello World program didn't run. My code matches everyone else's on the examples. Anyone else had this problem on Geany?
That was what I got on my search for why my Hello World program didn't run. My code matches everyone else's on the examples. Anyone else had this problem on Geany?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Geany Problem
I think I found my problem but I'm not sure how to fix it. Do I need a newer version of GTK+ than what Mint comes with?
Re: Geany Problem
You must provide more information. Is it a c project or C++ or something else?Josh138 wrote:Exit code 127: Something wrong with the machine?
Please link to the code or paste it in here.My code matches everyone else's on the examples.
You are compiling sourcecode. When you compile you get errors. Allmost all the time...Anyone else had this problem on Geany?
Re: Geany Problem
Hi Josh,
Yea, also, we sorta need to know what version & flavour of Mint you are running, what version of Geany, and what version of GTK it is requesting ?
And of course the standard/always asked question; do you have build-essentials installed ?
richy
Yea, also, we sorta need to know what version & flavour of Mint you are running, what version of Geany, and what version of GTK it is requesting ?
And of course the standard/always asked question; do you have build-essentials installed ?
richy
Re: Geany Problem
Sorry I am a little new to Linux so I just kind of assume that everyone is running the same OS lol. I am running Linux Mint 10 (Julia) and all I have done is install the latest patches. ) 0.20 Geany and it requests a 2.8 or higher GTK but I am not sure how to check what I have or understand the update manual becuase I'm not sure if I should update or doing a fresh instal of GTK+. This may sound really stupid but I'm not exactly sure what biuld-essentials are. I've only had one programming class and it used Visual Studio 10 with C++. Thank you for your time.
I am trying to do the C++ "Hello World" with
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World";
return 0;
}
I am trying to do the C++ "Hello World" with
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World";
return 0;
}
Re: Geany Problem
http://forums.linuxmint.com/viewtopic.php?f=90&t=9234Josh138 wrote:t I'm not exactly sure what biuld-essentials are.
I don't you need it for this example though. When you compile something like "gnome" from source you need build-essentials and more...
I just compiled it from the command line and it works fine. I also got error 127 in geany though. I don't remember how geany works but#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World";
return 0;
}
in my case right now it compiled just fine but couldn't execute the program because it only made me an object file.
That's the compiled code that hasn't gone through the final fase called linking.
For this exercise you can skip geany and do it from the commandline instead. Like a real pirate.
1. Save the file and give it a name ending with cpp or cxx.
2.
Code: Select all
g++ hello.cpp
To run a.out:
Code: Select all
./a.out
Good luck...
Re: Geany Problem
Ok. You need to press F9 to build (compile, link... whatever!) and F5 to run the executable in a terminal. You probably pressed F8 for compile no?
Re: Geany Problem
I just hit the biuld on the menu and that's what I got. When I tried doing it from the terminal I got this:
josh@fatman2 ~ $ g++ HelloWorld.ccp
HelloWorld.ccp: file not recognized: File format not recognized
collect2: ld returned 1 exit status
josh@fatman2 ~ $
josh@fatman2 ~ $ g++ HelloWorld.ccp
HelloWorld.ccp: file not recognized: File format not recognized
collect2: ld returned 1 exit status
josh@fatman2 ~ $
Re: Geany Problem
.ccp -> .cppjosh@fatman2 ~ $ g++ HelloWorld.ccp
Re: Geany Problem
After I installed build essentials and tried it both ways:
josh@fatman2 ~ $ g++ HelloWorld.cpp
g++: HelloWorld.cpp: No such file or directory
g++: no input files
josh@fatman2 ~ $ ./a.out
bash: ./a.out: No such file or directory
josh@fatman2 ~ $
In Geany
make (in directory: /home/josh/Desktop)
make: *** No targets specified and no makefile found. Stop.
Compilation failed.
josh@fatman2 ~ $ g++ HelloWorld.cpp
g++: HelloWorld.cpp: No such file or directory
g++: no input files
josh@fatman2 ~ $ ./a.out
bash: ./a.out: No such file or directory
josh@fatman2 ~ $
In Geany
make (in directory: /home/josh/Desktop)
make: *** No targets specified and no makefile found. Stop.
Compilation failed.
Re: Geany Problem
Ok. If you're in Home go:
Code: Select all
g++ ~/HelloWorld.cpp
Re: Geany Problem
Sorry, I read it through once more.
gives me the same message.
Under:
The label "build" has this code on my setup:
I wan't to see your related files in Home:Josh138 wrote: josh@fatman2 ~ $ g++ HelloWorld.cpp
g++: HelloWorld.cpp: No such file or directory
g++: no input files
josh@fatman2 ~ $ ./a.out
bash: ./a.out: No such file or directory
josh@fatman2 ~ $
Code: Select all
cd;ls -l HelloWorld*
The compiler is telling you that you don't have a makefile. You really don't. Pressing <shift> F9 does that on my Geany andIn Geany
make (in directory: /home/josh/Desktop)
make: *** No targets specified and no makefile found. Stop.
Compilation failed.
gives me the same message.
Under:
Code: Select all
Build > Set Build Commands
Code: Select all
g++ -Wall -o "%e" "%f"
Re: Geany Problem
When I compile I get this in Geany:
g++ -Wall -c "HelloWorld.ccp" (in directory: /home/josh/Desktop)
Compilation finished successfully.
g++: HelloWorld.ccp: linker input file unused because linking not done
When I biuld I get this:
g++ -Wall -o "HelloWorld" "HelloWorld.ccp" (in directory: /home/josh/Desktop)
Compilation failed.
HelloWorld.ccp: file not recognized: File format not recognized
collect2: ld returned 1 exit status
g++ -Wall -c "HelloWorld.ccp" (in directory: /home/josh/Desktop)
Compilation finished successfully.
g++: HelloWorld.ccp: linker input file unused because linking not done
When I biuld I get this:
g++ -Wall -o "HelloWorld" "HelloWorld.ccp" (in directory: /home/josh/Desktop)
Compilation failed.
HelloWorld.ccp: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Re: Geany Problem
josh@fatman2 ~ $ cd;ls -l HelloWorld*
-rw-r--r-- 1 josh josh 96 2011-05-06 05:11 HelloWorld.ccp
josh@fatman2 ~ $
Is what it gave me.
-rw-r--r-- 1 josh josh 96 2011-05-06 05:11 HelloWorld.ccp
josh@fatman2 ~ $
Is what it gave me.
Re: Geany Problem
From my earlier post. Please check the spelling on the file endings. It's still wrong.dagon wrote:.ccp -> .cppjosh@fatman2 ~ $ g++ HelloWorld.ccp
In the unix/linux world you mostly don't care about file endlings. When you compile something, suddenly you do.
Here is a link to a bookpage that describes the case. The example is in plain old c though...
http://www.network-theory.co.uk/docs/gc ... ro_95.html
Re: Geany Problem
josh@fatman2 ~ $ g++ HelloWorld.cpp
g++: HelloWorld.cpp: No such file or directory
g++: no input files
josh@fatman2 ~ $
Even after I have I have changed the name to cpp in the file and resaved it as a cpp.
g++: HelloWorld.cpp: No such file or directory
g++: no input files
josh@fatman2 ~ $
Even after I have I have changed the name to cpp in the file and resaved it as a cpp.
Last edited by Josh138 on Wed May 11, 2011 9:47 pm, edited 1 time in total.
Re: Geany Problem
...because:Josh138 wrote:josh@fatman2 ~ $ g++ HelloWorld.cpp
g++: HelloWorld.cpp: No such file or directory
g++: no input files
josh@fatman2 ~ $
solution:Josh138 wrote:josh@fatman2 ~ $ cd;ls -l HelloWorld*
-rw-r--r-- 1 josh josh 96 2011-05-06 05:11 HelloWorld.ccp
josh@fatman2 ~ $
Code: Select all
mv HelloWorld.ccp HelloWorld.cpp
Re: Geany Problem
Thank you dagon! Switching it in the properties didn't change it but that did! I got it to run in the terminal and Geany!!!!!! Thank you so much I understand my mistake I just wasn't sure because I've never done anything like that while using Visual Studio 08 or 10. Oops
Re: Geany Problem
Yes. I've found programming rather easy but keeping track of the software you use to aid you is one of the biggest challenges, at least for me.
The link above to the on-line book on the gcc compiler is a good place to start. I recommend it warmly.
The link above to the on-line book on the gcc compiler is a good place to start. I recommend it warmly.