make, gcc path issue.

This is a discussion on make, gcc path issue. within the Tech Board forums, part of the Community Boards category; I feel retarded asking this, but I've never really written code under windows before, and I'm a little confused. If ...

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    1

    make, gcc path issue.

    I feel retarded asking this, but I've never really written code under windows before, and I'm a little confused.

    If I run this command:

    Code:
    gcc -o flasher flasher.c -IC:\cygwin\usr\include\mingw
    I get a linking error. (I'm a little confused as to why that happens since I have all of the directories in question in my path, but that's a separate issue.)

    However, if I run that exact same command inside of a makefile:
    Code:
    all:
    	gcc -o flasher flasher.c -IC:\cygwin\usr\include\mingw
    it tells me that it can't find conio.h and doesn't get to the linking at all.

    Can anyone point me to how I might resolve this?

    Thanks.

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    I use something like:
    Code:
    gcc.exe file.c -lshlwapi -lgdi32  -I"C:/Program Files/Dev-Cpp/include" -L"C:/Program Files/Dev-Cpp/lib"
    Note that the paths are quoted and that a library directory is also provided. The required import libraries are listed after the file.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    I'm guessing that you run the command from cmd.exe, i.e. the Windows command shell, whereas make uses sh.exe, i.e. the port of the Bourne shell. They behave differently. sh probably can't handle the backslashes. (Or rather, it sees them as escape characters.)
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GCC Installation Help
    By Dae in forum C++ Programming
    Replies: 5
    Last Post: 06-15-2005, 09:53 PM
  2. gcc
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 10-22-2003, 03:46 PM
  3. 'functions' in make?
    By mart_man00 in forum C Programming
    Replies: 1
    Last Post: 06-21-2003, 02:16 PM
  4. using MAKE with makefile to create executable file
    By sballew in forum C Programming
    Replies: 1
    Last Post: 11-19-2001, 11:49 AM
  5. creating make files
    By Unregistered in forum Linux Programming
    Replies: 4
    Last Post: 09-22-2001, 01:58 AM

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