User forums > Help
Process Terminated?...
Carver:
Hey!
I sometimes get theese errors when I use Code::Blocks. Right now I've only been using Console Application, but I am pretty sure that it's the same anyways.
It keep saying this after the build:
--- Code: ---Project : Console application
Compiler : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\----\My Documents\CodeBlocks Projects\My Console Application project that SOMETIMES work\
--------------------------------------------------------------------------------
Switching to target: default
Linking console executable: C:\Documents and Settings\----\My Documents\CodeBlocks Projects\My Console Application project that SOMETIMES work\my.exe
.objs\Third program - Variables Data Types.o:Third program - Variables Data Types.cpp:(.text+0x100): multiple definition of `main'
.objs\main.o:main.cpp:(.text+0x100): first defined here
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End code ---
I am using Code::Blocks V. 1.0 (If it helps) on Windows XP. This sometimes automaticly solves itself. I don't know what happens. I've been searching this forum around, but the only things I see is topics with no answers/replies.
Does someone know what to do?
Best Regards,
Carver
Pecan:
I've had this happen also. I've searched google, found no answers; just more questions.
And yes, wierdly, on occasion, the problem seems to fix itself.
But I think that's because I add or delete source statements or compile/link the source in a different order.
Even when it gives a line number for the error, the location is incorrect.
This is not a CodeBlocks problem, because I get the same error when compiling from the MSWindows cmd console.
I believe this is a compiler/linker bug. Or at least a very bad message/explanation.
I'm using:
mingw32-g++ (GCC) 3.4.4 (mingw special)
Copyright (C) 2004 Free Software Foundation, Inc.
I've found no answer to this problem except to search manually.
I do usually find multiple definitions somewhere. Or something that could be construed as multiple definitions.
Or, in my case, an "extern statement" that doesn't exactly match a signature;
Or a definition that works in C code but not in C++.
I get it alot when mixing my old C modules with new C++ code.
Or a definition in an included header (STL, wxWidgets, or the like) that duplicates one of my own functions.
Or a static definition in one module and a none static definition in another.
Pecan:
Do a "Find in files" for "main" (search on project) and see if there's a definition for it in both types.h/cpp and main.h/cpp
Carver:
Well I found out that it couldn't figure how to have two cpp's in one group. Might be because I was working with a console application, but I have anotherquestion:
Example:
--- Code: ---#include <iostream>
using namespace std;
int a;
int main()
{
int b;
int c;
cout << "Enter the hours you spent on your PC at day: ";
cin >> a;
cout << You use<<a<< hours on your PC each day.\n\n";
--- End code ---
All this =
--- Code: ---Enter the hours you spent on your PC at day:(Example)1
You use<<a<<(No number?) hours on your PC each day.
--- End code ---
What did I do wrong? I mean; I can't do that. Then I tried copying a whole command from a website and it WORKED? O_o
When I type << a << or << b << it doesn't cahnge it at all, in output.
I am a bit new to C++, so might be me, but I did as my tutorial told me to. This was going to be my own very little Nerd test :|
All that I wrote is only a fraction of what I wrote in the complete.
Best Regards,
Carver
stg:
--- Quote from: Carver on June 15, 2007, 06:32:45 pm ---
--- Code: ---cout << You use<<a<< hours on your PC each day.\n\n";
--- End code ---
--- End quote ---
Where is your initial " ? Did this compile, or did you have something like:
--- Code: ---cout << "You use<<a<< hours on your PC each day.\n\n";
--- End code ---
--- Code: ---cout << "You use " <<a<< " hours on your PC each day.\n\n";
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version