Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Problems with ctime when including Audio  (Read 2434 times)

0 Members and 1 Guest are viewing this topic.

CharlieLima

  • Newbie
  • *
  • Posts: 4
    • View Profile
Problems with ctime when including Audio
« on: February 17, 2014, 02:22:17 am »
Hey all,

I am working as part of a dev team for a university course. We have been tasked with building a game engine, and have elected to use SFML for our audio component. However we are getting strange behavior whenever we attempt to integrate SFML. Hopefully someone has seen this before and can offer some insight.

Whenever we attempt to built with SFML, we get a bunch of errors along the lines of:

error C2039: 'clock_t' : is not a member of '`global namespace''        c:\program files (x86)\microsoft visual studio 11.0\vc\include\ctime    18

We have complied with the instructions here, but are still having problems. We have determined that this is related to us including SFML, as the project builds fine sans audio. Has anyone seen this issue before/any suggestions for troubleshooting?


For those interested we are building on:
  • Windows 7
  • Visual Studio 2012 (yes we are using the C++ 11 library)

Any help is much appreciated!



Hapax

  • Hero Member
  • *****
  • Posts: 3370
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Problems with ctime when including Audio
« Reply #1 on: February 17, 2014, 03:01:58 am »
I don't think this is a problem that is related to SFML.
However, I'd try:
std::clock_t time
instead of:
clock_t time

Would help next time if you posted some code :P
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

CharlieLima

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problems with ctime when including Audio
« Reply #2 on: February 17, 2014, 03:13:51 am »
Quote
However, I'd try:
std::clock_t time

Yes, we thought this too. However, we are not actually using clock_t anywhere in our project :P. In fact, nowhere in our project are we even including ctime!

Quote
Would help next time if you posted some code :P

I understand haha. However, our project is currently several hundred lines long. And since these errors are stemming from system headers, not sure how much use our code would be :P. I know this looks like potentially corrupted system files, however we can replicate this on machines both at home and in the lab. The odds of both machines being corrupted in the same way seems crazy.

This SEEMS very much like a configuration problem, but for the life of me I can not find anyone who has had issues like this. What is even crazier is that we can get the thing to build if we first create a new project with only SFML and then import the rest of our code :(.

Here's hoping someone has screwed up similarly before and save us a few hours debugging!

Hapax

  • Hero Member
  • *****
  • Posts: 3370
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Problems with ctime when including Audio
« Reply #3 on: February 17, 2014, 03:40:11 am »
we can get the thing to build if we first create a new project with only SFML and then import the rest of our code
Why not just do that then?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

CharlieLima

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problems with ctime when including Audio
« Reply #4 on: February 17, 2014, 04:18:18 am »
Quote
Quote
we can get the thing to build if we first create a new project with only SFML and then import the rest of our code
Why not just do that then?

Well, of course we could do that. But the lab machines remove all local files whenever we log out. Kind of annoying to have to create a whole new project, build SFML and then import. Would be nice if we could simply checkout our code and get rolling.

CharlieLima

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problems with ctime when including Audio
« Reply #5 on: February 17, 2014, 04:28:33 am »
No worries if you haven't seen this before. We're going to put our heads together tomorrow at scrum. Will post solution if we find one.

dabbertorres

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • website/blog
Re: Problems with ctime when including Audio
« Reply #6 on: February 17, 2014, 06:25:02 am »
I did a search for "clock_t" and "ctime" on the github, didn't find anything. No results for "clock_t", and only place "ctime" was found was in the Pong example.

In Issues however, I found this.

Are you using prebuilt binaries for SFML? I'd try compiling SFML and using the resulting libraries.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10920
    • View Profile
    • development blog
    • Email
Re: Problems with ctime when including Audio
« Reply #7 on: February 18, 2014, 12:44:25 am »
You should post the full build command.

If one of your (or some other library) file is called "time.h" and you've put it somewhere in a global include directory it could happen that the wrong "time.h" gets included.
Other issues can be a wrongly selected project file or a miss matching bracket.

Btw. it's really easy to find such possible causes yourself, by simply typing in (parts of) the error message, at least that's how I got all the information above, without having ever seen that error before. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything