Immediate Segfault

Hey guys,

I'm trying to start a new project using C++ (in eclipse 3.6.2 with CDT). I have another c++ project that is working just fine, but I created a new empty c++ project that is crashing with a SegFault seemingly before it even enters the main(..) function :S

Here's the code..

Test.cpp:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * Test.cpp
 *
 *  Created on: 2011-05-05
 *      Author: jarrett
 */

#include "Test.h"

//#include "linux/OSLinux.h"
//#include <iostream>

Test::Test() {
}

Test::~Test() {
}

int main(/*int argc, char* argv[]*/) {
	//std::cout << "TESTING" << std::endl;

	//icee::linuxos::OSLinux* opSys = new icee::linuxos::OSLinux();
	//opSys->test();

	//delete opSys;

	return 0;
}


Test.h:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * Test.h
 *
 *  Created on: 2011-05-05
 *      Author: jarrett
 */

#ifndef TEST_H_
#define TEST_H_

class Test {
public:
	Test();
	virtual ~Test();
};

#endif /* TEST_H_ */ 


I was adding a bunch of functionality with a new class (OSLinux.h) but got a seg fault, so I commented out just about EVERYTHING (literally, it only returns 0 now) but it STILL seg faults!

Any ideas anyone?
Try cleaning and rebuilding the whole project.
Tried that, no dice :S
Did you by chance mean ~test instead of -test?
Try putting main() into a seperate .cpp rather than in Test.cpp.
Hi ultifinitus,

I'm not quite sure what you mean..where did I use -test?
Right, well I copied the source code, created a new project, copied the source into that new project and it compiles and runs just fine now. I have no freaking idea what happened there..

Thanks guys for taking time to look at this issue :)

Cheers

Jarrett
Topic archived. No new replies allowed.