Author Topic: c error  (Read 3695 times)

Offline trip

  • Single posting newcomer
  • *
  • Posts: 6
c error
« 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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: c error
« Reply #1 on: March 18, 2017, 09:13:31 pm »
General programming questions are not allowed in this forum/website.

Please (re-)read the forum rules.

When registering here you accepted to follow these rules.

Topic locked !

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: c error
« Reply #2 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: c error
« Reply #3 on: March 19, 2017, 03:28:14 am »
See 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline trip

  • Single posting newcomer
  • *
  • Posts: 6
Re: c error
« Reply #4 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: c error
« Reply #5 on: March 19, 2017, 01:29:28 pm »
From 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
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
And, remember to follow the rules http://forums.codeblocks.org/index.php/topic,9996.0.html

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

Offline trip

  • Single posting newcomer
  • *
  • Posts: 6
Re: c error
« Reply #6 on: March 19, 2017, 03:11:49 pm »
Now it work!!
thank you