News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

First time run trouble on codeblocks 16.01 in linux mint

Started by thadart, May 04, 2020, 03:21:49 PM

Previous topic - Next topic

oBFusCATed

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!]

thadart

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:

bash: /home/pelu/Escritorio/dungeon/bin/Debug/dungeon.exe: it cant execute binary file: Incorrect executable format

oBFusCATed

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!]

thadart

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.


-------------- 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))



stahta01

Wild guess. Run this command in command line outside Code::Blocks.


g++-8 --version


What is the result.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

thadart

It displays this

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.


oBFusCATed

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!]

oBFusCATed

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!]

thadart

Went to the path the .cbp file is, tryed to execute ./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 bash: ./home/pelu/Fundamentos,: File or folder doesn't exist
Again 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.


stahta01

FYI: This is the command that was to be ran.

Edit: The CD command is a guess by me.


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
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

thadart

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

I went there, did that and i got this as response:
/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.


oBFusCATed

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!]

thadart

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)

sodev

Quote from: thadart on May 04, 2020, 03:21:49 PM

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.

Quote from: thadart on May 06, 2020, 05:22:55 PM
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.

thadart

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