Author Topic: compilation problem under linux  (Read 4610 times)

Offline OkTekk

  • Single posting newcomer
  • *
  • Posts: 7
compilation problem under linux
« on: December 29, 2015, 11:57:29 am »
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 :

Code
-------------- 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: compilation problem under linux
« Reply #1 on: December 29, 2015, 01:16:19 pm »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: compilation problem under linux
« Reply #2 on: December 29, 2015, 01:38:45 pm »
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!]

Offline OkTekk

  • Single posting newcomer
  • *
  • Posts: 7
Re: compilation problem under linux
« Reply #3 on: December 29, 2015, 01:49:08 pm »
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"

Offline OkTekk

  • Single posting newcomer
  • *
  • Posts: 7
Re: compilation problem under linux
« Reply #4 on: December 29, 2015, 01:51:34 pm »
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.codeblocks.org/index.php/topic,6783.msg52004/topicseen.html#new

Offline OkTekk

  • Single posting newcomer
  • *
  • Posts: 7
Re: compilation problem under linux
« Reply #5 on: December 29, 2015, 01:58:04 pm »
Code
[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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: compilation problem under linux
« Reply #6 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?
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: compilation problem under linux
« Reply #7 on: December 29, 2015, 04:51:44 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 ?

Offline OkTekk

  • Single posting newcomer
  • *
  • Posts: 7
Re: compilation problem under linux
« Reply #8 on: December 29, 2015, 05:09:08 pm »
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
Code
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++
Code
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
« Last Edit: December 29, 2015, 05:12:13 pm by OkTekk »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: compilation problem under linux
« Reply #9 on: December 29, 2015, 05:26:10 pm »
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!]

Offline OkTekk

  • Single posting newcomer
  • *
  • Posts: 7
Re: compilation problem under linux
« Reply #10 on: December 29, 2015, 10:59:07 pm »
Code
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)
Code
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
« Last Edit: December 29, 2015, 11:04:21 pm by OkTekk »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: compilation problem under linux
« Reply #11 on: December 29, 2015, 11:07:24 pm »
"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!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: compilation problem under linux
« Reply #12 on: December 29, 2015, 11:07:42 pm »
Code
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)
Code
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 !

Offline OkTekk

  • Single posting newcomer
  • *
  • Posts: 7
Re: compilation problem under linux
« Reply #13 on: December 30, 2015, 12:48:04 am »
Code
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
« Last Edit: December 30, 2015, 12:54:04 am by OkTekk »