Code::Blocks Forums

User forums => Help => Topic started by: trip on March 18, 2017, 06:11:43 pm

Title: c error
Post by: trip on March 18, 2017, 06:11:43 pm
Hello everyone ,
I'm trying to learn the d c language by himself.
As the First IDE I'm using codeblock but I get the following error:

mingw32-gcc.exe -Wall -g -c C:\Users\Lucky\Desktop\pp\main.c -o obj\Debug\main.o
C:\Users\Lucky\Desktop\pp\main.c:3:5: warning: return type defaults to 'int' [-Wimplicit-int]
main()
^
mingw32-g++.exe -o bin\Debug\pp.exe obj\Debug\main.o
Execution of 'mingw32-g++.exe -o bin\Debug\pp.exe obj\Debug\main.o' in 'C:\Users\Lucky\Desktop\pp' failed


thank'u
Title: Re: c error
Post by: Jenna on March 18, 2017, 09:13:31 pm
General programming questions are not allowed in this forum/website.

Please (re-)read the forum rules (http://forums.codeblocks.org/index.php/topic,9996.0.html).

When registering here you accepted to follow these rules.

Topic locked !
Title: Re: c error
Post by: Jenna on March 19, 2017, 02:08:19 am
I unlocked this topic.
Sorry for  not reading it correctly.
It's indeed not a general programming, but a configuration error.

The topic still violates our forum rules (in my opinion), because it asks a question that has already be answered several times and the rules clearly say: read befor you ask.
But it's not a general programming error and it's sometimes hard to find the correct solution for a beginner.
Title: Re: c error
Post by: stahta01 on March 19, 2017, 03:28:14 am
See http://forums.codeblocks.org/index.php?topic=18231.0 (http://forums.codeblocks.org/index.php?topic=18231.0)

FYI: I found it using google to search with these terms "site:http://forums.codeblocks.org link with C Compiler" without the double quotes.

Tim S.
Title: Re: c error
Post by: trip on March 19, 2017, 09:35:36 am
thanks for your answer.
how do I replace the gcc compiler.
I'm new.
Help me.
thank you
Title: Re: c error
Post by: stahta01 on March 19, 2017, 01:29:28 pm
From http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler#Compiler-neutral_setup_steps (http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler#Compiler-neutral_setup_steps)

Quote
"Settings->Compiler and Debugger->Global Compiler settings->Toolchain executables"

Which is under Code::Blocks 16.01 is now
"Settings->Compiler->Global Compiler settings->Toolchain executables"

Change the "Linker for Dynamic Libs" from the C++ Compiler command to C Compiler command.
This often means changing it from "mingw32-g++.exe" to "mingw32-gcc.exe" on windows.

And, please read the first two General FAQs http://wiki.codeblocks.org/index.php/FAQ#General (http://wiki.codeblocks.org/index.php/FAQ#General)
And, how to report an compiler problem http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
And, remember to follow the rules http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)

Tim S.
Title: Re: c error
Post by: trip on March 19, 2017, 03:11:49 pm
Now it work!!
thank you