Author Topic: Empty programs  (Read 5533 times)

Offline Zodiac

  • Single posting newcomer
  • *
  • Posts: 5
Empty programs
« on: June 12, 2010, 06:39:52 pm »
I'm running on Windows XP SP3
Codeblocks 8.02

I could never run a simple Hello World program. So I tried uninstalling codeblocks and reinstalling, this time a Full install... still no use.

I can only use GNU GCC as the compiler because all the other ones tell me that there is no output to be printed when I compile.


I don't know why it always creates the executable as G:\WINDOWS\temp\as.exe
Reinstalling didn't help for that either.
No matter what I do, I can't run main().


that's all I get when running it through the command line:
Code
G:\Documents and Settings\Zodiac>G:\WINDOWS\temp\as.exe
main
{standard input}: Assembler messages:
{standard input}:1: Error: no such instruction: `main'

Any help would be appreciated.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Empty programs
« Reply #1 on: June 12, 2010, 07:06:26 pm »
Turn on full commandline logging : change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline" and post the content of the "Build log" here.

Just for the users with slow internet connectionS (like me):
Please copy and paste it and do not use screenshots if not absolutely necessary.

Offline Zodiac

  • Single posting newcomer
  • *
  • Posts: 5
Re: Empty programs
« Reply #2 on: June 12, 2010, 09:36:21 pm »
Code
-------------- Build: Debug in tester ---------------

mingw32-g++.exe -Wall -fexceptions  -g     -c G:\tester\main.cpp -o obj\Debug\main.o
mingw32-g++.exe  -o bin\Debug\tester.exe obj\Debug\main.o   
mingw32-g++.exe: obj\Debug\main.o: No such file or directory
mingw32-g++.exe: no input files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

Other than that I can't read before it tries compiling as it disappears as soon as the program runs.

As for the record I'm stuck with 56k too. I always compress my images before I upload them. You should try PngOptimizer; it can reduce your avatar to 83% of its original size, without losing quality of course. It's not very spectacular in this case, but normally it drops to 50-60% unless the image is a picture.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Empty programs
« Reply #3 on: June 13, 2010, 12:07:14 am »
It tries to create the exe, but does not find the object-file.
as.exe is not the file you created, but the gnu assembler.

I don't know why it is called or why it is in the temp directory (it should be in MinGW's bin directory).

It looks like you messed up your settings.

I suggest uninstalling C::B and MinGW, removing all remaining MinGW and C::B files and folders and the C::B configuration.
The C::B conf-files are in %APPDATA%\codeblocks.

After that you should install C::B 10.05 with MinGW bundle.

C::B is "just" an IDE that can work with many compilers.
On windows we provide a bundle with the MinGW compiler suite (TDM's gcc in 10.05) for  the users convenience.
If you do not install any other compiler you can (of course) not use it.

By the way, I compress my png's with pngnq on linux.
It's not totally lossless, because it creates a 8bit palette png, but the png's are about 40% smaller than yours and the visual difference is nearly unnoticeable.
It uses the neuquant algorithm and works pretty good.

Offline Zodiac

  • Single posting newcomer
  • *
  • Posts: 5
Re: Empty programs
« Reply #4 on: June 14, 2010, 04:18:56 am »
Thanks for the upload.

But man, I was so full of hope. I uninstalled everything and removed the folder in application data, reinstalled with the newest version only to find the same, exact, problem.

When installing it detected the GNU GCC Compiler, so I don't understand why this is happening.

I searched in the registry and couldn't find anything related to the G:\WINDOWS\temp\ path.  I'm getting really clueless here. There are just so much settings in codeblocks that I'm unsure where to look; that is if codeblocks is the problem and not the compiler.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Empty programs
« Reply #5 on: June 14, 2010, 05:04:44 am »
I searched in the registry and couldn't find anything related to the G:\WINDOWS\temp\ path.
You don't need to do that.

What I suggest is:
Go to these folders, like:
C:\Documents and Settings\XXXXXX\Application Data\codeblocks

Note: XXXXXX is just your user name. Then, you will see the config files named: *.conf.

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Empty programs
« Reply #6 on: June 14, 2010, 05:36:34 am »
Did you verify that the compiler detected by C::B is the one you installed together with C::B and not another (older) installation on your hdd ?

Offline Zodiac

  • Single posting newcomer
  • *
  • Posts: 5
Re: Empty programs
« Reply #7 on: June 14, 2010, 01:59:29 pm »
Couldn't be: I uninstalled CB and MinGW.

Also ollydbg, there doesn't seem to be anything relevant in default.conf (and that's my only .conf file).