Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 7th, 2007, 04:49 AM
Buddy_99 Buddy_99 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 28 Buddy_99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 46 m 18 sec
Reputation Power: 0
MS Visual C++ not recognising headers

PHP Code:
// Time_Temp_Test.cpp : Defines the entry point for the console application.
//

#include <stdio.h>
#include <time.h>
#include "stdafx.h"

int _tmain(int argc_TCHARargv[])
{
    
time_t rawtime;
  
struct tm timeinfo;

  
time ( &rawtime );
  
timeinfo localtime ( &rawtime );
  
printf "Current local time and date: %s"asctime (timeinfo) );
  
  return 
0;


Compiling...
Time_Temp_Test.cpp
Time_Temp_Test.cpp(13) : error C3861: 'time': identifier not found, even with argument-dependent lookup
Time_Temp_Test.cpp(14) : error C3861: 'localtime': identifier not found, even with argument-dependent lookup
Time_Temp_Test.cpp(15) : error C3861: 'asctime': identifier not found, even with argument-dependent lookup


Am F'd by the compiler failing to recognize the time and date functions. Is there something about MS Visual C++ which makes this difficult. I have the same code in other compilers and no probs. Any help appreciated.

Reply With Quote
  #2  
Old December 11th, 2007, 07:04 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,975 Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 5 Days 15 h 27 m 54 sec
Reputation Power: 1556
try have the #include "stdafx.h" as the first line, I remember
having some issues when it wasn't first line.

Reply With Quote
  #3  
Old December 11th, 2007, 05:40 PM
Buddy_99 Buddy_99 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 28 Buddy_99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 46 m 18 sec
Reputation Power: 0
Quote:
Originally Posted by Shadow Wizard
try have the #include "stdafx.h" as the first line, I remember
having some issues when it wasn't first line.


Thanks shemzilla. Often wondered about that and will keep it first, but found problem which approaches a bug in the way the project dialog works.

The problem was Visual Studio was creating project files to use pre-compiled headers.

However, the version of XP I was using did not have the control time language for dot Net.

I think this resulted in the option to use pre-compiled headers, always being turn on, with the option to turn off, never appearing in the dialog box.

When I ran the project on an XP system with a full installation of dot Net, the problem became apparent.

I'm not familiar with all the options in MS VC++ and this was a real trap.

Last edited by Buddy_99 : December 13th, 2007 at 11:45 PM. Reason: Make clearer

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > MS Visual C++ not recognising headers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway