News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

compilation problem under linux

Started by OkTekk, December 29, 2015, 11:57:29 AM

Previous topic - Next topic

OkTekk

Hi!
After a complete system reinstallation, i imported a previous project and since then, unable to compile.
While checking the logs i've seen that :


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

gcc -Wall -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/csv.c" -o obj/Debug/csv.o
gcc -Wall -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/index.c" -o obj/Debug/index.o
gcc -Wall -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/main.c" -o obj/Debug/main.o
gcc -Wall -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/management.c" -o obj/Debug/management.o
gcc -Wall -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/search.c" -o obj/Debug/search.o
gcc -Wall -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/system.c" -o obj/Debug/system.o
gcc -Wall -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/toolbox.c" -o obj/Debug/toolbox.o
g++  -o bin/Debug/FL_Projet2_v2 obj/Debug/csv.o obj/Debug/index.o obj/Debug/main.o obj/Debug/management.o obj/Debug/search.o obj/Debug/system.o obj/Debug/toolbox.o   
g++: error: obj/Debug/csv.o: Aucun fichier ou dossier de ce type
g++: error: obj/Debug/index.o: Aucun fichier ou dossier de ce type
g++: error: obj/Debug/main.o: Aucun fichier ou dossier de ce type
g++: error: obj/Debug/management.o: Aucun fichier ou dossier de ce type
g++: error: obj/Debug/search.o: Aucun fichier ou dossier de ce type
g++: error: obj/Debug/system.o: Aucun fichier ou dossier de ce type
g++: error: obj/Debug/toolbox.o: Aucun fichier ou dossier de ce type
g++: fatal error: no input files
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))



why the hell it try to use GCC and afterward G++ (this is a C terminal program) ?
And most important..anyone can help me solve this ?

Thanks..
Btw sorry for my poor english.

MortenMacFly

Please do a full re-build. Most likely your compiler changed.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

Please disable localization and post a long in English. No idea what the error means. Most probably the permissions in the obj folder are not set correctly (probably belonging to an old and different user).
(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!]

OkTekk

MortenMacFly: if you mean by that "rebuild workspace" the log come from it

oBFusCATed: "Aucun fichier ou dossier de ce type" the only one non-english sentence mean "no file or folder of this type"

OkTekk

just found the same problem -solved- but this was a gentoo issue and i'm on a debian-based system so..not usefull
http://forums.next.codeblocks.org/index.php/topic,6783.msg52004/topicseen.html#new

OkTekk

[b]lowlow@NuxStation:~/.../Projet 2/FL_Projet2_v2$[/b] ls -l
total 80
drwxr-xr-x 4 lowlow lowlow 4096 déc.  22 21:28 bin
drwxrwxr-x 2 lowlow lowlow 4096 déc.  29 12:29 bkp
-rw-rw-r-- 1 lowlow lowlow 6008 déc.  29 11:27 csv.c
drwxrwxr-x 2 lowlow lowlow 4096 déc.  22 21:14 database
drwxrwxr-x 2 lowlow lowlow 4096 déc.   2 13:03 export
-rw-rw-r-- 1 lowlow lowlow 1580 déc.  29 12:34 FL_Projet2_v2.cbp
-rw-rw-r-- 1 lowlow lowlow 1578 déc.  29 12:56 FL_Projet2_v2.layout
-rw-rw-r-- 1 lowlow lowlow 5792 déc.  29 11:27 global.h
drwxrwxr-x 2 lowlow lowlow 4096 déc.  22 21:14 import
-rw-rw-r-- 1 lowlow lowlow  636 déc.  29 11:27 index.c
drwxrwxr-x 2 lowlow lowlow 4096 déc.  22 21:14 log
-rw-rw-r-- 1 lowlow lowlow 6157 déc.  29 12:23 main.c
-rw-rw-r-- 1 lowlow lowlow  517 déc.  29 11:27 management.c
drwxr-xr-x 4 lowlow lowlow 4096 déc.  22 21:28 obj
-rw-rw-r-- 1 lowlow lowlow  552 déc.  29 11:27 search.c
-rw-rw-r-- 1 lowlow lowlow 4008 déc.  29 11:27 system.c
-rw-rw-r-- 1 lowlow lowlow 4002 déc.  29 11:27 toolbox.c
[b]lowlow@NuxStation:~/.../Projet 2/FL_Projet2_v2$[/b] ls -l obj/
total 8
drwxr-xr-x 2 lowlow lowlow 4096 déc.  22 21:26 Debug
drwxr-xr-x 2 lowlow lowlow 4096 déc.  22 21:28 Release
[b]lowlow@NuxStation:~/.../Projet 2/FL_Projet2_v2$[/b] ls -l obj/Debug/
total 0

oBFusCATed

What happens if you execute the gcc commands in a terminal at the root of the project?
(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!]

Jenna

Quote from: oBFusCATed on December 29, 2015, 03:59:06 PM
What happens if you execute the gcc commands in a terminal at the root of the project?
Or if you manually remove the "obj"-folder ?

OkTekk

#8
jens: tried, it didn't worked.

oBFusCATed: juste done that (simples c/p from my log). as seen here, all .o files were created successfully
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ ls obj/Debug/
csv.o  index.o  main.o  management.o  search.o  system.o  toolbox.o


the only thing i don't understand is why C::B execute afterward (the gcc -Wall -g -c commands) some g++ -o.
They are the ones who stops compilation but...aren't they c++ commands ? i have made a C program, not C++
from C::B log:

g++  -o bin/Debug/FL_Projet2_v2 obj/Debug/csv.o obj/Debug/index.o obj/Debug/main.o obj/Debug/management.o obj/Debug/search.o obj/Debug/system.o obj/Debug/toolbox.o 


besides, i tried create a new project (to be sure it was created as a C project) then imported my files in it...same problem as explained since the creation of this topic

oBFusCATed

C::B is mainly c++ ide, so it always uses g++ to link projects, no matter if they are c or c++. If you don't intend to make c++ project you can switch it to gcc. But I doubt it will make a difference.

Does the last command work if you execute it in the 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!]

OkTekk

#10
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc *.c -o test
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ ls -l test
-rwxrwxr-x 1 lowlow lowlow 29288 déc.  29 22:58 test

lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ ./test
------------------
------ Menu ------
------------------

1. Create Database
...etc


yes it does
and for the things who didn't in C::B (meaning, creating the .o files)
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/csv.c" -o obj/Debug/csv.o
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ ls -l obj/Debug/csv*
-rw-rw-r-- 1 lowlow lowlow 19192 déc.  29 23:01 obj/Debug/csv.o

oBFusCATed

"gcc *.c -o test" is not the command C::B is executing. This command doesn't use the object files produced by the previous commands. The proper command will be something like "gcc obj/*.o -o test".

Generally it is best to just copy-paste it from the full build log.
(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!]

Jenna

Quote from: OkTekk on December 29, 2015, 10:59:07 PM
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc *.c -o test
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ ls -l test
-rwxrwxr-x 1 lowlow lowlow 29288 déc.  29 22:58 test

lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ ./test
------------------
------ Menu ------
------------------

1. Create Database
...etc


yes it does
and for the things who didn't in C::B (meaning, creating the .o files)
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/csv.c" -o obj/Debug/csv.o
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ ls -l obj/Debug/csv*
-rw-rw-r-- 1 lowlow lowlow 19192 déc.  29 23:01 obj/Debug/csv.o


That's completely different and irrelevant.

Please try the exact same steps as shown in the build log on sommandline (from the same directories).
Everything else wastes your and our time !

OkTekk

#13
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/csv.c" -o obj/Debug/csv.o
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/index.c" -o obj/Debug/index.o
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/main.c" -o obj/Debug/main.o
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/management.c" -o obj/Debug/management.o
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/search.c" -o obj/Debug/search.o
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/system.c" -o obj/Debug/system.o
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ gcc -g  -c "/home/lowlow/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2/toolbox.c" -o obj/Debug/toolbox.o
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ g++  -o bin/Debug/FL_Projet2_v2 obj/Debug/csv.o obj/Debug/index.o obj/Debug/main.o obj/Debug/management.o obj/Debug/search.o obj/Debug/system.o obj/Debug/toolbox.o 
lowlow@NuxStation:~/Ecole/01_Programmation Procédurale/Projet 2/FL_Projet2_v2$ ls -l bin/Debug/

-rwxrwxr-x 1 lowlow lowlow 50280 déc.  30 00:46 FL_Projet2_v2


just tried the output, it works fine