Results 1 to 2 of 2

Thread: Geany C++ Problem?

  1. #1
    Join Date
    Oct 2008
    Location
    INDIA
    Beans
    331
    Distro
    Ubuntu 12.04 Precise Pangolin

    Thumbs down Geany C++ Problem?

    Hello there,

    I had just installed Geany for my C++ needs. I have created a new project and added two files main.cpp and main.h

    Contents of main.cpp:
    Code:
    #include <stdio.h>
    #include <main.h>
    
    int main()
    {
        printf(HEADERTXT);
    }
    Contents of main.h:
    Code:
    const HEADERTXT "Hello World...";
    But, Geany is showing me the following error on compilation:

    g++ -Wall -c "main.cpp" (in directory: /.../test-cpp)
    main.cpp:2: fatal error: test-cpp/main.h: No such file or directory
    compilation terminated.
    Compilation failed.

    NOTE: main.h is in the same folder as main.cpp

    Anybody, please help and tell me how to add custom files and folders (complete project management)...
    Last edited by etdsbastar; February 9th, 2011 at 09:01 PM. Reason: added note
    Controlling complexity is the essence of computer programming. - Brian

  2. #2
    Join Date
    Sep 2009
    Location
    Canada, Montreal QC
    Beans
    1,809
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Geany C++ Problem?

    The include line should be:

    Code:
    #include "main.h"
    I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones.
    Freedom is measured in Stallmans.
    Projects: gEcrit

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •