Code::Blocks Forums

User forums => Help => Topic started by: Smokesr on November 16, 2013, 01:02:47 pm

Title: Segfault only with Project
Post by: Smokesr on November 16, 2013, 01:02:47 pm
I am running Code::Blocks version 12.11 on LMDE (based on Debian Testing).
The compiler I use is g++
version (Debian 4.7.3-4) 4.7.3

I have two classes in header files and cpp files as the c++ reference book recommend it and also have a main.cpp which use the classes.
I set the headers path to project build options > search directories > compiler, so i dont need to write the full path of headers when i include them.
The classes have some pointer inside them.

My problem is when i compile this as a project, i've got segmentation fault, but if i make it without a project, and include the full path of headers its works fine.
And of course, when i copy the class implementations and specifications to the main file and compile its work fine.

Build log:
Code
||=== Build finished: 0 errors, 0 warnings (0 minutes, 0 seconds) ===|

When i try to run:
Code
Segmentation fault

Process returned 139 (0x8B)execution time    0.054 s
Build log:
Code
Checking for existence: /home/smoke/sdl2/2d_test/bin/Debug/2d_test
Executing: xterm -T 2d_test -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.:/home/smoke/sdl2/2d_test/:/usr/lib/x86_64-linux-gnu /home/smoke/sdl2/2d_test/bin/Debug/2d_test  (in /home/smoke/sdl2/2d_test/.)
Process terminated with status 0 (0 minutes, 1 seconds)

I have already tried compile it from terminal with headers on same directory and worked. So i think the problem causes the header search.
Title: Re: Segfault only with Project
Post by: BlueHazzard on November 16, 2013, 01:41:18 pm
I set the headers path to project build options > search directories > resource compiler

why resource compiler? You have to set it in search directories-> compiler...
does it even compile?

pleas read also this: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

and report a full build log
greetings
Title: Re: Segfault only with Project
Post by: Smokesr on November 16, 2013, 02:20:43 pm

why resource compiler? You have to set it in search directories-> compiler...
does it even compile?

pleas read also this: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

and report a full build log
greetings

Thank you for your help. I modified my post.

I tried your recommendation but the problem is still exist.
Title: Re: Segfault only with Project
Post by: stahta01 on November 16, 2013, 03:11:31 pm
pleas read also this: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F


You should post a full build log; this requires you to re-build the whole project!

And, post a full build log
or expect no more help!
Title: Re: Segfault only with Project
Post by: oBFusCATed on November 16, 2013, 03:14:35 pm
Or try to use a debugger to understand where and why it is crashing.