News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Segfault only with Project

Started by Smokesr, November 16, 2013, 01:02:47 PM

Previous topic - Next topic

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:

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


When i try to run:

Segmentation fault

Process returned 139 (0x8B)execution time    0.054 s

Build log:

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.

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

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

#2
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

Thank you for your help. I modified my post.

I tried your recommendation but the problem is still exist.

stahta01

#3
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


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!
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

Or try to use a debugger to understand where and why it is crashing.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]