Compiling question

This is a discussion on Compiling question within the C Programming forums, part of the General Programming Boards category; Okay this isn't going to easy to explain but i wanted to simply my question I wanna be able to ...

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    192

    Compiling question

    Okay this isn't going to easy to explain but i wanted to simply my question

    I wanna be able to compile a program main.c in
    /Desktop/file

    in main.c theres a header queue.h
    Desktop/file/h

    for queue.h the source file queue.c is in
    Desktop/file/source

    whats the command line to compiles together since the source and header are in different locations to where the main is and beable to run cuz right now i get
    (.text+0xa23): undefined reference to ' .........'

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    gcc -I./h main.c source/queue.c
    ought to do it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  2. Question about linux compiling with GCC
    By elsheepo in forum C++ Programming
    Replies: 23
    Last Post: 03-07-2008, 10:36 PM
  3. Design layer question
    By mdoland in forum C# Programming
    Replies: 0
    Last Post: 10-19-2007, 04:22 AM
  4. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 08:22 PM
  5. Simple Compiling question ...
    By hypertension in forum C++ Programming
    Replies: 2
    Last Post: 02-16-2003, 12:02 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21