Solved

nmake IFDEF

Posted on 2008-06-16
9
1,696 Views
Last Modified: 2012-05-05
i have a make file which contains following lines

fndef CFLAGS
CFLAGS = -MMD -O2 -Wall
endif

when i used nmake (on windows platform )  to run this makefile  , it shows error
***********************
makefile(17) : fatal error U1034: syntax error : separator missing
Stop.
***************************




0
Comment
Question by:karana
  • 5
  • 3
9 Comments
 
LVL 53

Expert Comment

by:Infinity08
ID: 21793119
I assume that fndef is a typo, and that it actually says ifndef ?
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 21793121
>> makefile(17) : fatal error U1034: syntax error : separator missing

Which line is that ?
0
 
LVL 53

Accepted Solution

by:
Infinity08 earned 125 total points
ID: 21793136
>> nmake

Ah. If I'm not mistaken, you have to use this instead :

!IFNDEF CFLAGS
CFLAGS = -MMD -O2 -Wall
!ENDIF
0
 
LVL 7

Expert Comment

by:cybrexus
ID: 21793166
depends on the version of nmake but sometimes you'll need two !! with endif - so !!endif
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:karana
ID: 21800144
i tried some trail and error


fndef CFLAGS:
CFLAGS = -MMD -O2 -Wall
endif:

now it shows no error ...is it correct ?


0
 
LVL 53

Expert Comment

by:Infinity08
ID: 21800418
>> now it shows no error

Again fndef instead of ifndef.

Also, can you tell which line exactly the syntax error refers to ? (as I asked earlier)


>>  ...is it correct ?

I would think not, as the :'s at the end of the line signify labels rather than conditionals.


Did you read our suggestions ?
0
 

Author Comment

by:karana
ID: 21810723
we tried the below

!IFNDEF CFLAGS
CFLAGS = -MMD -O2 -Wall
!ENDIF

but , it show the same error on first line .
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 21810749
Are you sure that line is in a position where it is allowed to be ? Can you show the entire makefile ?
0
 

Author Comment

by:karana
ID: 21811876
i was wrong ....
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now