Archív značiek: code

How to setup project in KDevelop

novy projekt:

zalozka vpravo – Automake manager
 – v hornej casti klikni na ikonku ‚add new subproject‘ a zadaj jeho meno, napriklad ‚src‘. Bez subprojektu by sa linky
    na cpp subory pridavali priamo do projektoveho adresara. Takto budu pridavane do podadresara ‚src‘
 – v hornej casti vyber projekt ‚src‘ a klikni na ikonku ‚add target‘ a zadaj meno cieloveho executable
 – v dolnej casti sa zobrazi <meno exe>( Program in bin ), okrem povodneho (header in noinst) (ale ten tam nebude kedze sme v podprojekte)
 – cpp ktore pridas do tohoto noveho itemu sa budu kompilovat
 – v menu / Project /  Project Options nastav Configure Options pre tvoj config, pravdepodobne ‚debug‘. Do C/C++
    preprocessor daj cesty ku libkam, do Linker flags daj libky. V zalozke C++ mozes pridat definy,
    napr "-O0 -g3 -D_UNIX -D_DEBUG"
    Tieto nastavenia netreba nastavovat v Automake manageri cez ikonku kluca. Netreba tam nic vyplnat, vsetko
    sa nastavuje v Project options.
 – spusti Build / run Automake & friends
 – spusti Build / run Config
 – spusti Build / Build project
 – po kompilacii nastav v zalozke Run options nastav parametre pre spustanie. Napriklad
    executable: /home/mirex/work/biturn_svn/BiturnGtkmmKdev/debug
    Debug arguments: 002131080.C3 002131080.lwo -log 3 –general-owauto 1
    Working directory: /home/mirex/work/biturn_svn/BiturnGtkmmKdev/debug/src

2010-02-12 23:43:44
Error: "collect2: ld returned 1 exit status"
Can mean: you don’t have disk space left for linking the library.

Segfaults in MSVC9, does not in KDevelop

Biturn segfaulted on 3d file preview, but only in winxp. Solved by setting main class to static in main(). Reason ? There is some memory allocation at the place where it segfaults, and it probably taken up all memory.

http://www.experts-exchange.com/Programming/Languages/C/Q_20577736.html

malloc() are using memory from stack. They should be replaced with calls to new() which allocs from heap.

2009-06-03 18:01:30
< tdb> mirex: Windows has a considerably smaller stack than Linux, so
             it’s very much possible that your object is causing a stack
             overflow.  Static local variables go in the data section and not
             stack.