Author Topic: First time run trouble on codeblocks 16.01 in linux mint  (Read 1024 times)

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
First time run trouble on codeblocks 16.01 in linux mint
« on: May 04, 2020, 03:21:49 pm »
Hello forum people, im a newbie, its my first post and before of all thank you for stopping here and reading me.

I have read the instructions for first posting, and i saw a post involving a trouble similar to mine, that its called "Cant build and run" on Help section. As it is a 2007 post and my OS is different than the one who that post talks about, i decided to create this new post (sorry if i should not have do this)

Well, issue is that i downloaded CodeBlocks 16.01 on linux mint, downloaded the build-essentials , g++-8 and xterm packages and installed all of it. My problem is that when i try to debug and run any project, log says:

Code: [Select]
-------------- Build: Debug in dungeon (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions -g -Iinclude -I/home/pelu/Escritorio/dungeon/src -c /home/pelu/Escritorio/dungeon/src/GameMap.cpp -o obj/Debug/src/GameMap.o
execvp(./home/pelu/Fundamentos, de, , g++ -Wall -fexceptions -g -Iinclude -I/home/pelu/Escritorio/dungeon/src -c /home/pelu/Escritorio/dungeon/src/GameMap.cpp -o obj/Debug/src/GameMap.o) failed with error 2!
Process terminated with status -1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

 :'( :'( :'(

Truly appreciate your time and suggests.
 


 
« Last Edit: May 04, 2020, 05:32:02 pm by thadart »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2730
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #1 on: May 04, 2020, 05:07:34 pm »
Hi, welcome to the forum.
1) Please use code tags if you post logs (the # symbol in the new post editor)
2) What are you trying to do?
Debug your application or run your application?

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #2 on: May 04, 2020, 05:37:49 pm »
Oh sorry about the log format, already changed it.

Im trying to run my application with the "build and run" button. A pop up window displays with the message:

Code: [Select]
It seems that this project has not been built yet. Do you want to build it now?
I press "Yes" and then i get the log message.

Thank you for your time  :)
« Last Edit: May 04, 2020, 05:40:36 pm by thadart »

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 438
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #3 on: May 04, 2020, 05:49:32 pm »
The spaces in "Fundamentos de.." are causing the trouble.

Como la boina, es funda...mental

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #4 on: May 04, 2020, 06:06:34 pm »
I see this piece of path you mention in the log

Code: [Select]

execvp(./home/pelu[b]/Fundamentos, de, ,[/b] g++-8 -Wall -fexceptions -g  -I/home/pelu/Escritorio/HolaMundo -c /home/pelu/Escritorio/HolaMundo/main.cpp -o /obj/Debug/main.o) failed with error 2!
 

But i dont understand why that appears, because the actual route where my projects are is:
Code: [Select]
/home/pelu/desktop/project_folder

(Note im trying to run and build the example project here, not even one of my creation)
It's maybe the configured destination folder for the output files? If so, and the void spaces in the path name are the problem, where i can set a new destination folder?
 
Also now i have an extra pop up window, saying:

Code: [Select]
Can't create output directory /bin/debug
Thank you dude :)
« Last Edit: May 04, 2020, 06:09:02 pm by thadart »

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 438
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #5 on: May 04, 2020, 07:15:18 pm »
The "/bin/debug" problem suggest you have "/bin/debug" as Execution working dir in Project options/Build targets, try removing the leading /

The "/home/pelu/Fundamentos, de, ," part looks like a corruption in the configuration.

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #6 on: May 04, 2020, 07:46:06 pm »
Ok Miguel, found the option you have talked about, its in Project -> Properties.. -> Build target.
Didn't see any leading '/' char on the text fields.

Changed the Execution dir to "bin/debug". Pop up doesnt show now, still i get the log error and its not running.

I attach a pic of how i have set it, hope its usefull (Execution Dir is now "bin/debug", differs from the photo).
« Last Edit: May 04, 2020, 08:17:31 pm by thadart »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #7 on: May 04, 2020, 08:07:07 pm »
Are you sure that /home/pelu/desktop is an actual path and not a symlink?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #8 on: May 04, 2020, 08:12:21 pm »
Hello OBFusCATed, ty for passing by.

I don't even know what a symlink is, but yes, the folders are on my desktop.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #10 on: May 05, 2020, 02:20:37 am »
Sorry, should have googled that before reply   :-X

I knew what it is, just its a 2 words name in my language and i wasnt associating.
Hope the file attached is enough to know that its not a symlink. It shows the Properties window of the folder that contains the project im trying to build and run.

I am being more specific and i also attach the error that shows on console when i choose "No" in the pop up window that appears saying "It seems that your project has not been built yet. Do you want to build it now?"

I have looked for information about error 127, it should be a path issue or a typo issue. As well as i have tryed with different projects, incluiding HelloWorld, i think we can discard it's a typo error.

« Last Edit: May 05, 2020, 04:30:16 pm by thadart »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #11 on: May 05, 2020, 07:31:45 pm »
What happens if you paste the whole line after 1: in a terminal and try to run it?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #12 on: May 05, 2020, 08:30:46 pm »
You mean to write "./home/pelu/Escritorio/dungeon/bin/Debug/dungeon" on a terminal ?
When I do that, this line appears:
bash: ./home/pelu/Escritorio/dungeon/bin/Debug/dungeon : File or folder doesn't exist

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #13 on: May 05, 2020, 10:21:33 pm »
".", means current folder; ".." means the parent folder. Try without them.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #14 on: May 06, 2020, 12:23:01 pm »
I tried without the "." character, just "/home/pelu/Escritorio/dungeon/bin/Debug/dungeon" and enter.
I got the same message: "bash: /home/pelu/Escritorio/dungeon/bin/Debug/dungeon: File or folder doesnt exist".
« Last Edit: May 06, 2020, 01:51:10 pm by thadart »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #15 on: May 06, 2020, 12:48:36 pm »
Does this file actually exists? Is it executable?
If you cannot run it in terminal you won't be able to run in in C::B.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #16 on: May 06, 2020, 01:59:17 pm »
I have a dungeon.exe file on that path. I gave it 777, opened C::B and tryed to run the project and I still get the same "status -1" error on log and "127 (0x7F)" error if i choose not to build.

If I add the extension ".exe" at the end of the path and try to run in terminal, i have this:

Code: [Select]
bash: /home/pelu/Escritorio/dungeon/bin/Debug/dungeon.exe: it cant execute binary file: Incorrect executable format
« Last Edit: May 06, 2020, 02:04:43 pm by thadart »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #17 on: May 06, 2020, 02:05:23 pm »
Can you post the full rebuild log?
It is getting confusing.

The original report was that your linker was failing to link.
If this is the case then it is obvious that you won't have an executable which you can run.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #18 on: May 06, 2020, 02:50:03 pm »
I'm sorry if I am not expressing myself very clearly, I still don't understand properly the features of C::B and english it's not my native language, appreciate the comunication struggle.

I've been looking for a place where logs are fully displayed, not only in the bottom tab, but I didnt came to any point. If this place exists, please correct me and i will repost the full log.

Code: [Select]
-------------- Clean: Debug in dungeon (compiler: GNU GCC Compiler)---------------

Cleaned "dungeon - Debug"

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

g++-8 -Wall -fexceptions -g -Iinclude -I/home/pelu/Escritorio/dungeon -c /home/pelu/Escritorio/dungeon/main.cpp -o obj/Debug/main.o
execvp(./home/pelu/Fundamentos, de, , g++-8 -Wall -fexceptions -g -Iinclude -I/home/pelu/Escritorio/dungeon -c /home/pelu/Escritorio/dungeon/main.cpp -o obj/Debug/main.o) failed with error 2!
Process terminated with status -1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #19 on: May 06, 2020, 03:32:33 pm »
Wild guess. Run this command in command line outside Code::Blocks.

Code: [Select]
g++-8 --version

What is the result.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #20 on: May 06, 2020, 04:42:43 pm »
It displays this

Code: [Select]
g++-8 (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It's that OK? I notice its Ubuntu version, while my OS is Linux Mint 19.3 Cinnamon.

« Last Edit: May 06, 2020, 04:47:27 pm by thadart »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #21 on: May 06, 2020, 04:45:11 pm »
Next step is to cd to the place where your cbp is placed and run the command from the log (all this must happen in a terminal).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #22 on: May 06, 2020, 04:46:41 pm »
I'm not sure why you're using 16.01. There are two releases after it. And we have binaries for the latest one in a ppa https://launchpad.net/~codeblocks-devs/+archive/ubuntu/release (but you have to find the matching ubuntu release to the release of mint you're using).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #23 on: May 06, 2020, 05:01:14 pm »
Went to the path the .cbp file is, tryed to execute
Code: [Select]
./home/pelu/Fundamentos, de, , g++-8 -Wall -fexceptions -g -Iinclude -I/home/pelu/Escritorio/dungeon -c /home/pelu/Escritorio/dungeon/main.cpp -o obj/Debug/main.o
both ways, with and without the starting "." char. It showed the same message the both ways
Code: [Select]
bash: ./home/pelu/Fundamentos,: File or folder doesn't existAgain i don't know were this path comes from or why it is here.

Edit: if i have to change my C::B version it's not a problem.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #24 on: May 06, 2020, 05:05:45 pm »
FYI: This is the command that was to be ran.

Edit: The CD command is a guess by me.

Code: [Select]
cd /home/pelu/Fundamentos
g++-8 -Wall -fexceptions -g -Iinclude -I/home/pelu/Escritorio/dungeon -c /home/pelu/Escritorio/dungeon/main.cpp -o obj/Debug/main.o
« Last Edit: May 06, 2020, 05:07:23 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #25 on: May 06, 2020, 05:22:55 pm »
The Fundamentos folder is named "Fundamentos\ de\ Programación/"

I went there, did that and i got this as response:
Code: [Select]
/home/pelu/Escritorio/dungeon/main.cpp:2:10: fatal error: Player.h: File or folder doesn't exist
 #include "Player.h"
          ^~~~~~~~~~

That "Player.h" is a class of my project.

« Last Edit: May 06, 2020, 05:50:50 pm by thadart »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #26 on: May 06, 2020, 05:24:56 pm »
It is still mightily confusing. Also pasting messages not in English doesn't help.

What is this "Fundamentos\ de\ Programación/"? Where it is coming from?

It seems that source file is in "/home/pelu/Escritorio/dungeon/". Where is the cbp file placed?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #27 on: May 06, 2020, 06:01:26 pm »
Sorry again, I forgot to translate that part of the console output this time. Now it's done.

I really don't know how this folder "Fundamentos de Programación" has got to C::B log,  it is ubicated in my user folder, "/home/pelu", but i don't know why this is an input to C::B, since my project ".cbp" file is in "/home/pelu/Escritorio/dungeon/dungeon.cbp". (Note: "Escritorio" is "Desktop" in my language, i dont know if its appropiate to translate folder names so i leave it as it is)

Offline sodev

  • Regular
  • ***
  • Posts: 382
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #28 on: May 06, 2020, 07:23:03 pm »
Code: [Select]
g++ -Wall -fexceptions -g -Iinclude -I/home/pelu/Escritorio/dungeon/src -c /home/pelu/Escritorio/dungeon/src/GameMap.cpp -o obj/Debug/src/GameMap.o
execvp(./home/pelu/Fundamentos, de, , g++ -Wall -fexceptions -g -Iinclude -I/home/pelu/Escritorio/dungeon/src -c /home/pelu/Escritorio/dungeon/src/GameMap.cpp -o obj/Debug/src/GameMap.o) failed with error 2!

It looks like these two lines are created by actually one call to the compiler, most probably CodeBlocks "pretty-prints" the first line and the second line is the actual execvp call that CodeBlocks tries to execute. The first parameter of that call is the path to the executable and this one seems to be corrupted.

The Fundamentos folder is named "Fundamentos\ de\ Programación/"

This looks like this is the path that the execvp call gets passed in, with spaces and non-ASCII letters and this seems to get wrongly inserted into the execvp call. I don't know how CodeBlocks constructs the compiler call but i would guess this path must be specified somewhere in the toolchain settings of the compiler configuration and im pretty sure this is not the path where gcc is installed. At first i would look there and correct that path (should be /usr/bin or something like that). If it's not part of the toolchain settings then hopefully someone else with more knowledge about CodeBlocks internals know which other locations contribute to the creation of the compiler call command.

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #29 on: May 07, 2020, 12:12:53 pm »
In Settings ->  Compiler... -> Toolchain executable I have:
Compiler's installation directory: /usr

In the Program Files tab of Toolchain executables:
C compiler: gcc
C++ compiler: g++-8
Linker for dynamic libs: g++-8
Linker for static libs: ar
Debugger: GDB / CDB debugger: Default
Resource compiler: empty
Make program: make
« Last Edit: May 07, 2020, 12:14:49 pm by thadart »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #30 on: May 07, 2020, 12:25:27 pm »
Sorry again, I forgot to translate that part of the console output this time. Now it's done.

Please do not translate the output of the console.
It makes it next to impossible to help you.
NOTE: Adding a translated version of the output will help; but, we need the untranslated version.

NOTE: I am not a CB Dev team member. So, they may overrule me on this.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline thadart

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: First time run trouble on codeblocks 16.01 in linux mint
« Reply #31 on: May 08, 2020, 03:28:29 pm »
When I pasted a console output untranslated by mistake, i got adviced that "pasting messages not in English doesn't help", so that's why i continued with the translation.
Anyways I updated C::B and it works fine now, so i guess we won't know what was happening with that damn path, but i can continue working.
Thanks to anyone who spent a minute trying to help me.