LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-04-2007, 11:20 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
Cygwin & makefiles - not finding files in -I'd directory


This is a bit cryptic, but here's the info I have...

My Makefile looks something like:
Code:
INCDIR = -I~/HDKProjects/Hydrous2/WaveTools2/WaveTools/ \
         -I~/HDKProjects/MLInclude/ \
	 -I~/HDKProjects/Hydrous2/OPs/Standalone

 # ....

%.o: %.C
	$(CC) $(OBJFLAGS) $(INCDIR) -DMAKING_DSO $(TAGINFO) $< $(OBJOUTPUT)$@

#.....
... there's more to it, but those are the important bits & what I'm currently trying to compile.

The first file it tries to compile has an include like so:

Code:
#include <SampledWave.h>
Where SampledWave.h is in ~/HDKProjects/Hydrous2/WaveTools2/WaveTools/

However, when I try to compile, I get a "fatal error, can not open included file 'SampledWave.h': No such file or directory."

I've checked that I have read permissions. I've copy/pasted all paths from the make file into cygwin to be sure there are no spelling/capitalization errors, I've tried removing the '~' & using the full path, I've tried with a space after the "-I" & without. I've tried putting a link to ~/HDKProjects/Hydrous2/WaveTools2/WaveTools/ in /usr/include & then changed the #include to be <foo/SampledWave.h>. Nothing seems to work.

If it helps, this is what the makefile spits out for the compile line:

Code:
> make
c:/Progra~1/Micros~1.net/Vc7/bin/cl -TP -MD -GX -GR -c -DVERSION="8.0.383" -DI38
6 -DWIN32 -DSWAP_BITFIELDS -DDLLEXPORT="__declspec(dllexport)" -DSESI_LITTLE_END
IAN -DOFSTREAM_PERMISSIONS=", 0666"  -Ic:/HFS80~1.383/toolkit/include -Ic:/HFS80
~1.383/custom/include -Ic:/Progra~1/Micros~1.net/Vc7/include  -Od -I/home/BrianK
_Labs/HDKProjects/Hydrous2/WaveTools2/WaveTools/ -I~/HDKProjects/MLInclude/ -I~/
HDKProjects/Hydrous2/OPs/Standalone -DMAKING_DSO -DUT_DSO_TAGINFO='"3262197cbf3f
480637af0c866b3b93ef0b43d0e2cc37cbbd73a8c3063d69ee812b972985db32267a5946d9fd22da
42591beee110fdd3e354470c2fe1779ae5d85bac55b0e8b84994a3268d0847ba11bef254d59d8ef0
8d6df2b8711915198141fe4ce6558d2b83"' HT_Ocean.C -FoHT_Ocean.o
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

HT_Ocean.C
c:\cygwin\home\BrianK_Labs\HDKProjects\Hydrous2\Vex\HT_Liquid.h(25) : fatal erro
r C1083: Cannot open include file: 'SampledWave.h': No such file or directory
ideas?
 
Old 09-05-2007, 05:13 AM   #2
carl.waldbieser
Member
 
Registered: Jun 2005
Location: Pennsylvania
Distribution: Kubuntu
Posts: 197

Rep: Reputation: 32
It's been a while, but could the cl compiler not like the UNIX style paths you give it for the include files?
 
Old 09-05-2007, 01:07 PM   #3
purplerice
LQ Newbie
 
Registered: Nov 2004
Location: SF Bay Area
Distribution: Fedora
Posts: 11

Rep: Reputation: 0
I have not touched C for a while. I wonder if you have tried
#include "SampledWave.h"
or
#include "full path to SampledWave.h"

I remember that C compiler uses different algorithms to search for <xyz.h> than "xyz.h". (check the reference of cl)
 
Old 09-19-2007, 11:50 PM   #4
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by carl.waldbieser View Post
It's been a while, but could the cl compiler not like the UNIX style paths you give it for the include files?
That was it. Thanks!
 
Old 09-20-2007, 04:45 AM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
In Makefile, instead of ~, you could use the HOME environment variable, i.e.
Code:
INCDIR = -I$HOME/HDKProjects/Hydrous2/WaveTools2/WaveTools/ \
         -I$HOME/HDKProjects/MLInclude/ \
	 -I$HOME/HDKProjects/Hydrous2/OPs/Standalone
...
 
Old 09-20-2007, 06:10 AM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
The expansion of '~' to equal your $HOME directory is a BASH feature and is not supported by 'make'.
Sometimes you may need to set LD_LIBRARY_PATH or, more to your case, C_INCLUDE_PATH when using Mingw32 or cygwin
 
Old 09-20-2007, 11:46 AM   #7
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by gnashley View Post
The expansion of '~' to equal your $HOME directory is a BASH feature and is not supported by 'make'.
Sometimes you may need to set LD_LIBRARY_PATH or, more to your case, C_INCLUDE_PATH when using Mingw32 or cygwin
I'm guessing you're speaking of cygwin? '~' in makefiles works fine on my Debian, Ubuntu, and Suse machines.

Either way, using the full path (i.e. c:/cygwin/home/...) or $HOME works, so I'm all set.

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Autozipping files from 1 directory & dropping them in other directory ??? amitsharma_26 Linux - Networking 5 10-22-2005 06:09 AM
finding size of total files in a directory blackzone Linux - Newbie 3 01-07-2005 03:01 AM
finding number of files in a directory pantera Programming 2 08-20-2004 10:17 AM
finding the number of files in each directory ridertech Programming 1 06-02-2004 10:26 PM
Creating driver files from Makefiles bluseychris Linux - Software 3 05-04-2004 05:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration