• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Having a mare with gcc compiler switches"

Collapse

  • suityou01
    replied
    got it

    bearing in mind this is windoze

    gcc -IC:\projects\myapp\ -o main.exe main.c

    The problem was apart from as was correctly mentioned using #include "" and not <> was that the -o switch was before the -I switch. Moving it to after the path did the trick.

    Thanks for your help mate.

    Leave a comment:


  • suityou01
    replied
    Originally posted by voodooflux View Post
    Just guessing really, but do you need to use #include "..." rather than #include <...> alongside the -I flag?
    Yep, just spotted that, thanks. Still fooked tho.

    Leave a comment:


  • voodooflux
    replied
    Just guessing really, but do you need to use #include "..." rather than #include <...> alongside the -I flag?

    Leave a comment:


  • suityou01
    started a topic Having a mare with gcc compiler switches

    Having a mare with gcc compiler switches

    Let's say for argument's sake I have some code that is structured like

    c:\projects\myapp - main.c global.h

    c:\projects\myapp\subsection\somemorecode.c somemorecode.h

    Now I want somemorecode.h to #include global.h, which is in the parent directory.

    I could use #include <c:\\projects\myapp\global.h> but I don't want hard coded paths

    rather I would like to add a search path to the compiler

    eg

    gcc -o -Ic:\projects\myapp\ main.exe main.c

    However it still can't find the header.

    What am I doing wrong? Why even though the search path is specified can it still not find the global.h?
Working...
X