Author Topic: Can't get any compiler to work  (Read 7912 times)

Vin_Tanner

  • Guest
Can't get any compiler to work
« on: November 28, 2009, 10:39:50 pm »
Quick background is that I have been working a lot with web development and want to go into actual programming. I found Code::Blocks through a website with tutorials. I downloaded it and it looked like a nice program. I say it looks like a nice program because I can't use the build feature. I have attempted to use 3 different compilers and have been unsuccessful with all.

I started with the mingw one that was included with Code Blocks. This one gave an error about a file not being on D:/ I tracked that problem to some configurations that I was unable to find and change.

So I uninstalled it and tried to use the compiler that comes with Visual Basic Express which I used for a bit. This one simply said on the build
log that I was using an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] and that it was going to skip it. Looked at the compiler settings, but could not find anything to change.

I uninstalled code blocks and mingw and tried fresh with the code blocks only .exe and no mingw. Then downloaded mingw seperately from their site. Still no luck, same error.
 
So I downloaded the free borland compiler. This was tells me that it is also an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. I checked the settings, found that it was pointing to the wrong folder, corrected all the paths that i could find, but to no avail, I still get that error.

I'm running Code::Blocks 8.02
Windows XP SP3
Visual Express 2008
Borland 5x something
and mingw I'm not sure the version.

Any help would be appreciated. I would very much like to use this program, but there is no point in using it if I can't link it to a compiler.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Can't get any compiler to work
« Reply #1 on: November 29, 2009, 01:41:07 am »
Edit: In case you did NOT know the 8.02 build was the last official release; but, the nightly builds are released every few days to weeks. The nightly builds have many bug fixes and some more features. http://forums.codeblocks.org/index.php/board,20.0.html

Have you already read this link?
http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler

If not, do so.

After reading the link and trying it yourself; pick a single compiler to try to use.

Record the installation folder.

Post the info about the Compiler Name and Version and installation Path.

If I have time I will try to help you set up one compiler. Note, I do NOT use a debugger most of the time; so, you will need someone else to set that up past the default settings.

The order of best to least support of Compilers under Code::Blocks and Windows XP.

1. MinGW GCC
2. MS Visual C++
3. ? There is no obvious compiler that rates in third place.
X. Borland C++

NOTE: This site does NOT support learning programing or the basics of using a Compiler. This site support Configuring Code::Blocks to work with an Compiler that support C/C++ Language.

Tim S.

« Last Edit: November 29, 2009, 02:53:54 am by stahta01 »
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

Vin_Tanner

  • Guest
Re: Can't get any compiler to work
« Reply #2 on: November 29, 2009, 02:13:20 pm »
Thanks for the reply. I had read the wiki article where it pertained to MinGW and the TDm one, but didn't bother reading the other sections. I had not tried the nightly builds. I uninstalled all the compilers and codeblocks and all settings that i could find. Started fresh.

I downloaded the nightly build
CB_20091111_rev5911_win32.7z
mingwm10_gcc421.7z
wxmsw28u_gcc_cb_wx2810.7z

I unzipped all to
C:\Program Files\codeblocks

The program opened up but obviously could not find a compiler. So I downloaded the MinGW from their site.
MinGW-5.1.6.exe and it got installed to C:\MinGW

Deleted the codeblocks folder in the application data folder so that it would re-detect for compilers. It found the GNU GCC Compiler.

Now when trying to build and run the typical "Hello World" it tells me that "It seems that this project has not been built yet. Do you want to build it now?" I click yes, and the box never goes away and it never gets built. There is something that gets blipped in the log box down below, but it is so fast I cannot read it. Thanks for the idea to use the nightly build. Any ideas on why it won't let me build?

Note: I completely understand, there are plenty of forums for learning programming and such, I just want to get Code::Blocks working, then I'll go back to my newbie tutorials, haha.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Can't get any compiler to work
« Reply #3 on: November 29, 2009, 07:14:21 pm »
Step 1 to trouble shoot compiler problem; turn on full logging

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Note: A beginner mistake is NOT to install all of MinGW GCC files.

Please try my batch file to check that most of MinGW Exists and which one it is
Edit: Just place the batch file in the MinGW Folder normally c:\MinGW and on XP it should not need edited.

My file version-of-gcc.bat
Code
@echo off
REM credit to Peter Ward work in ReactOS Build Environment RosBE.cmd it gave me a starting point that I edited.
::
:: Display the current version of GCC, ld, make and others.
::

REM %CD% works in Windows XP, not sure when it was added to Windows
REM set GCCBASEDIR=C:\MinGW
set GCCBASEDIR=%CD%
ECHO GCCBASEDIR=%GCCBASEDIR%
SET PATH=%GCCBASEDIR%\bin;%SystemRoot%\system32

REM ECHO %PATH%
REM ECHO %GCCBASEDIR%\bin\pic30-gcc.exe

ECHO "Looking For g++"
if exist "%GCCBASEDIR%\bin\g++.exe" (g++.exe -v 2>&1 | find "version")
ECHO "Looking For gcc"
if exist "%GCCBASEDIR%\bin\gcc.exe" (gcc.exe -v 2>&1 | find "gcc version")
if exist "%GCCBASEDIR%\bin\ld.exe" (ld.exe -v)
REM  2>&1 | find "gcc version")

if exist "%GCCBASEDIR%\bin\pic30-gcc.exe" (pic30-gcc.exe -v 2>&1 | find "gcc version")
if exist "%GCCBASEDIR%\bin\pic32-gcc.exe" (pic32-gcc.exe -v 2>&1 | find "gcc version")
if exist "%GCCBASEDIR%\bin\msp430-gcc.exe" (msp430-gcc.exe -v 2>&1 | find "gcc version")
if exist "%GCCBASEDIR%\bin\arm-elf-gcc.exe" (arm-elf-gcc.exe -v 2>&1 | find "gcc version")

REM if exist %GCCBASEDIR%\bin\pic32-gcc.exe pic32-gcc.exe -print-search-dirs
if exist %GCCBASEDIR%\bin\pic32-ld.exe (pic32-ld.exe -melf32pic32mx -v)
if exist %GCCBASEDIR%\bin\windres.exe (windres --version | find "GNU windres")
if exist %GCCBASEDIR%\bin\dlltool.exe (dlltool --version | find "GNU dlltool")
if exist %GCCBASEDIR%\bin\pexports.exe (pexports | find "PExports" )
if exist %GCCBASEDIR%\bin\mingw32-make.exe (mingw32-make -v | find "GNU Make")
if exist %GCCBASEDIR%\bin\make.exe (ECHO It is not recommended to have make.exe in mingw/bin)
REM ECHO "The minGW runtime version is the same as __MINGW32_VERSION"
if exist "%GCCBASEDIR%\include\_mingw.h" (type "%GCCBASEDIR%\include\_mingw.h" | find "__MINGW32_VERSION" | find "#define")
if exist "%GCCBASEDIR%\include\w32api.h" (type "%GCCBASEDIR%\include\w32api.h" | find "__W32API_VERSION")

:_end
PAUSE

The output I get

Code
GCCBASEDIR=D:\GreenApps\MinGW
"Looking For g++"
gcc version 3.4.5 (mingw-vista special r3)
"Looking For gcc"
gcc version 3.4.5 (mingw-vista special r3)
GNU ld (GNU Binutils) 2.18.50.20080109
GNU windres (GNU Binutils) 2.18.50.20080109
GNU dlltool (GNU Binutils) 2.18.50.20080109
#define __MINGW32_VERSION           3.15.2
#define __W32API_VERSION 3.13
Press any key to continue . . .

Tim S.
« Last Edit: November 29, 2009, 07:18:55 pm by stahta01 »
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