User forums > Help

Segfault only with Project

(1/1)

Smokesr:
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) ===|

--- End code ---

When i try to run:

--- Code: ---Segmentation fault

Process returned 139 (0x8B)execution time    0.054 s

--- End code ---
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)


--- End code ---
I have already tried compile it from terminal with headers on same directory and worked. So i think the problem causes the header search.

BlueHazzard:

--- Quote from: Smokesr on November 16, 2013, 01:02:47 pm ---I set the headers path to project build options > search directories > resource compiler

--- End quote ---

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

Smokesr:

--- Quote from: BlueHazzard on November 16, 2013, 01:41:18 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

--- End quote ---

Thank you for your help. I modified my post.

I tried your recommendation but the problem is still exist.

stahta01:

--- Quote from: BlueHazzard on November 16, 2013, 01:41:18 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

--- End quote ---


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!

oBFusCATed:
Or try to use a debugger to understand where and why it is crashing.

Navigation

[0] Message Index

Go to full version