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

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 »