xyzmu
Posts: 8
Joined: Sun May 15, 2016 8:17 pm

CodeBlocks Not Running Properly?

Tue May 02, 2017 5:29 am

Today, I installed CodeBlocks.

Created a simple helloWorld program just to see if everything was working find but alas.. I got the following when I hit build/run. A console should've popped up and printed the string but I just got this.

There is one other post on here and a guy somehow fixed his issue. He left his solution which I tried to use in the console but it didn't solve my problem.

Also noticed that I have no libraries in my linker settings but I'm not sure how to fix that yet. Currently looking into it.

Code: Select all

-------------- Run: Debug in helloWorld (compiler: GNU GCC Compiler)---------------  Checking for existence: /home/xymu/Code/helloWorld/bin/Debug/helloWorld Executing: xterm -T helloWorld -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/xymu/Code/helloWorld/bin/Debug/helloWorld  (in /home/xymu/Code/helloWorld/.) Process terminated with status -1 (0 minute(s), 0 second(s))

sunnyflunk
Development Team
Posts: 3007
Joined: Sun Mar 13, 2016 11:35 pm

Re: CodeBlocks Not Running Properly?

Tue May 02, 2017 12:55 pm

xyzmu wrote:
Tue May 02, 2017 5:29 am
Today, I installed CodeBlocks.

Created a simple helloWorld program just to see if everything was working find but alas.. I got the following when I hit build/run. A console should've popped up and printed the string but I just got this.

There is one other post on here and a guy somehow fixed his issue. He left his solution which I tried to use in the console but it didn't solve my problem.

Also noticed that I have no libraries in my linker settings but I'm not sure how to fix that yet. Currently looking into it.

Code: Select all

-------------- Run: Debug in helloWorld (compiler: GNU GCC Compiler)---------------  Checking for existence: /home/xymu/Code/helloWorld/bin/Debug/helloWorld Executing: xterm -T helloWorld -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/xymu/Code/helloWorld/bin/Debug/helloWorld  (in /home/xymu/Code/helloWorld/.) Process terminated with status -1 (0 minute(s), 0 second(s))
I don't see the other thread, but you will need the Base Development Tools https://solus-project.com/articles/pack ... ment-tools

And likely change the default terminal as there is no xterm

xyzmu
Posts: 8
Joined: Sun May 15, 2016 8:17 pm

Re: CodeBlocks Not Running Properly?

Tue May 02, 2017 1:01 pm

Ah that helped. The problem was that the Code Blocks was not using the Gnome Terminal.

dschinn1001
Posts: 161
Joined: Mon Mar 20, 2017 5:31 pm

Re: CodeBlocks Not Running Properly?

Tue May 09, 2017 9:37 am

This is same issue here too.
g++ is working, with listing below, when g++ is used in terminal only.

In terminal I type:

g++ -ggdb -Wall main.cpp -o main

and main.cpp is compiled without errors.

But together with codeblocks and this listing below, there is somehow a library error.

here is trivial listing as main.cpp - it is calculating Celsius into Fahrenheit :

------------------------------------------------------------

//
// Conversion - Programm zur Umwandlung der Temperatur von
// Grad Celsius in Fahrenheit:
// Fahrenheit = Celsius * (212 - 32)/100 + 32
//
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
// Eingabe der Temperatur in Celsius
int celsius;
cout << "Geben Sie die Temperatur in Celsius ein: ";
cin >> celsius;

// Umwandlung von Celsius- und Fahrenheit-Werte
int fahrenheit;
fahrenheit = celsius * 9/5 + 32;

// Ausgabe der Ergebnisse (gefolgt von einem Neuezeile-Zeichen)
cout << "Der Fahrenheit-Wert ist: ";
cout << fahrenheit << endl;

// Warten, bis der Benutzer bereit ist, bevor das Programm
// beendet wird, sodass der Benutzer die Programmergebnisse
// sehen kann
cout << "Eingabetaste fuer Weiter..." << endl;

cin.ignore(10, '\n');
cin.get();
return 0;
}

-------------------------------------------------------------------

sunnyflunk
Development Team
Posts: 3007
Joined: Sun Mar 13, 2016 11:35 pm

Re: CodeBlocks Not Running Properly?

Tue May 09, 2017 10:31 am

dschinn1001 wrote:
Tue May 09, 2017 9:37 am
This is same issue here too.
g++ is working, with listing below, when g++ is used in terminal only.

In terminal I type:

g++ -ggdb -Wall main.cpp -o main

and main.cpp is compiled without errors.

But together with codeblocks and this listing below, there is somehow a library error.

here is trivial listing as main.cpp - it is calculating Celsius into Fahrenheit :

------------------------------------------------------------

//
// Conversion - Programm zur Umwandlung der Temperatur von
// Grad Celsius in Fahrenheit:
// Fahrenheit = Celsius * (212 - 32)/100 + 32
//
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
// Eingabe der Temperatur in Celsius
int celsius;
cout << "Geben Sie die Temperatur in Celsius ein: ";
cin >> celsius;

// Umwandlung von Celsius- und Fahrenheit-Werte
int fahrenheit;
fahrenheit = celsius * 9/5 + 32;

// Ausgabe der Ergebnisse (gefolgt von einem Neuezeile-Zeichen)
cout << "Der Fahrenheit-Wert ist: ";
cout << fahrenheit << endl;

// Warten, bis der Benutzer bereit ist, bevor das Programm
// beendet wird, sodass der Benutzer die Programmergebnisse
// sehen kann
cout << "Eingabetaste fuer Weiter..." << endl;

cin.ignore(10, '\n');
cin.get();
return 0;
}

-------------------------------------------------------------------
Can you post the error? it is likely to be more informative

If it is the same error, then the solution would be the same

dschinn1001
Posts: 161
Joined: Mon Mar 20, 2017 5:31 pm

Re: CodeBlocks Not Running Properly?

Tue May 09, 2017 6:00 pm

The error in codeblocks with Celsius listing above is as follows :

----------------------------------------------------------------
-------------- Run: Debug in Conversion (compiler: GNU GCC Compiler)---------------

Checking for existence: /home/$user/C++/Conversion/bin/Debug/Conversion
Executing: xterm -T Conversion -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/$user/C++/Conversion/bin/Debug/Conversion (in /home/$user/C++/Conversion/.)
Process terminated with status -1 (0 minute(s), 0 second(s))

sunnyflunk
Development Team
Posts: 3007
Joined: Sun Mar 13, 2016 11:35 pm

Re: CodeBlocks Not Running Properly?

Wed May 10, 2017 1:31 am

dschinn1001 wrote:
Tue May 09, 2017 6:00 pm
The error in codeblocks with Celsius listing above is as follows :

----------------------------------------------------------------
-------------- Run: Debug in Conversion (compiler: GNU GCC Compiler)---------------

Checking for existence: /home/$user/C++/Conversion/bin/Debug/Conversion
Executing: xterm -T Conversion -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/$user/C++/Conversion/bin/Debug/Conversion (in /home/$user/C++/Conversion/.)
Process terminated with status -1 (0 minute(s), 0 second(s))
Yeah, so same solution. It is calling xterm which doesn't exist on Solus. You'll need to edit the CodeBlocks settings to use gnome-terminal (or other preferred terminal).

dschinn1001
Posts: 161
Joined: Mon Mar 20, 2017 5:31 pm

Re: CodeBlocks Not Running Properly?

Fri May 12, 2017 2:28 pm

Perfectly running now.

In "settings" and there in menu-entry "environment" - I as gnome - user - have set
"shell to run commands in:" to : /bin/bash
and have set
"Terminal to launch console programs" to : gnome-terminal -t $TITLE -x

I think this thread can then be marked as solved.
Thank you. :!:

object-Undefined
Posts: 16
Joined: Tue Mar 14, 2017 4:51 pm

Re: CodeBlocks Not Running Properly?

Sun Aug 12, 2018 3:56 pm

dschinn1001 wrote:
Fri May 12, 2017 2:28 pm
Perfectly running now.

In "settings" and there in menu-entry "environment" - I as gnome - user - have set
"shell to run commands in:" to : /bin/bash
and have set
"Terminal to launch console programs" to : gnome-terminal -t $TITLE -x

I think this thread can then be marked as solved.
Thank you. :!:
I had the same problem but after editing the environment preferences to the above, I'm getting the following error message

Code: Select all

-------------- Build: Debug in Intro (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions -g -Wall -std=c++11  -c /home/object-undefined/Documents/Intro/main.cpp -o obj/Debug/main.o
as: error while loading shared libraries: libopcodes-2.29.1.so: cannot open shared object file: No such file or directory
Process terminated with status 1 (0 minute(s), 1 second(s))
1 error(s), 0 warning(s) (0 minute(s), 1 second(s))
 
Build & Run gives the following error:

Code: Select all

-------------- Build: Debug in Intro (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions -g -Wall -std=c++11  -c /home/object-undefined/Documents/Intro/main.cpp -o obj/Debug/main.o
/bin/bash: g++ -Wall -fexceptions -g -Wall -std=c++11  -c /home/object-undefined/Documents/Intro/main.cpp -o obj/Debug/main.o: No such file or directory
Process terminated with status 127 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

Return to “Tutorials”