Author Topic: Compiling on Windows in Visual C++ Express 2010  (Read 10072 times)

Marnick

  • Newbie
  • *
  • Posts: 8
    • View Profile
Compiling on Windows in Visual C++ Express 2010
« on: February 09, 2013, 04:21:35 AM »
I have cloned the repository of openFrameworks, then cloned openTSPS in that folder (so it is /openFrameworks/openTSPS/), then opened /openTSPS/standalone/basic/openTSPS.sln in Visual C++ Express 2010 in Windows 7 64-bit and I get the following error:

"Unable to start program '....openFrameworksLibDebug.lib'. The specified file is an unrecognized or unsupported binary format."

I fixed this by changing the start-up project to "openTSPS". But now I get the following errors (amongst others) while compiling:

1>------ Build started: Project: openTSPS, Configuration: Debug Win32 ------
1>  tspsApp.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\standalone\opentsps-gestures\src\customdelegate.h(11): fatal error C1083: Cannot open include file: 'TSPSDelegate.h': No such file or directory
1>  main.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\standalone\opentsps-gestures\src\customdelegate.h(11): fatal error C1083: Cannot open include file: 'TSPSDelegate.h': No such file or directory
1>  TuioTcpXmlServer.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxtuiowrapper\src\tuiotcpxmlserver.h(14): fatal error C1083: Cannot open include file: 'ofxNetwork.h': No such file or directory
1>  ofxTuioServer.cpp
1>  ofxTuioClient.cpp
1>  TuioTime.cpp
1>  TuioServer.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxtuiowrapper\src\core\tuioserver.cpp(180): warning C4101: 'e' : unreferenced local variable
1>  TuioClient.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxtuiowrapper\src\core\tuioclient.cpp(82): warning C4101: 'e' : unreferenced local variable
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxtuiowrapper\src\core\tuioclient.cpp(449): error C2664: 'CreateMutexW' : cannot convert parameter 3 from 'LPCSTR' to 'LPCWSTR'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxtuiowrapper\src\core\tuioclient.cpp(450): error C2664: 'CreateMutexW' : cannot convert parameter 3 from 'LPCSTR' to 'LPCWSTR'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>  WebSocketSender.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxlibwebsockets\libs\libwebsockets\include\libwebsockets.h(38): fatal error C1083: Cannot open include file: '../win32port/win32helpers/websock-w32.h': No such file or directory
1>  Utils.cpp
1>  TUIOSender.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\libs\openframeworks\graphics\ofpixels.h(155): warning C4003: not enough actual parameters for macro 'max'
1>c:\users\mentingdesign\documents\github\openframeworks\libs\openframeworks\graphics\ofpixels.h(156): warning C4003: not enough actual parameters for macro 'max'
1>  TCPSender.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxtsps\libs\ofxtsps\include\ofxtsps\communication\tcpsender.h(13): fatal error C1083: Cannot open include file: 'ofxNetwork.h': No such file or directory
1>  Settings.cpp
1>  Scene.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxosc\src\ofxoscarg.h(76): error C2371: 'int32_t' : redefinition; different basic types
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(19) : see declaration of 'int32_t'
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxtsps\libs\ofxtsps\src\scene.cpp(20): warning C4244: 'argument' : conversion from 'unsigned __int64' to 'int32_t', possible loss of data
1>  Person.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxosc\src\ofxoscarg.h(76): error C2371: 'int32_t' : redefinition; different basic types
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(19) : see declaration of 'int32_t'
1>  PeopleTracker.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxosc\src\ofxoscarg.h(76): error C2371: 'int32_t' : redefinition; different basic types
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(19) : see declaration of 'int32_t'
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxxmlsettings\src\ofxxmlsettings.h(6): fatal error C1083: Cannot open include file: 'tinyxml.h': No such file or directory
1>  OscSender.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxosc\src\ofxoscarg.h(76): error C2371: 'int32_t' : redefinition; different basic types
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(19) : see declaration of 'int32_t'
1>  GuiManager.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxxmlsettings\src\ofxxmlsettings.h(6): fatal error C1083: Cannot open include file: 'tinyxml.h': No such file or directory
1>  Processor.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxxmlsettings\src\ofxxmlsettings.h(6): fatal error C1083: Cannot open include file: 'tinyxml.h': No such file or directory
1>  Events.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\..\addons\ofxTSPS\libs\ofxTSPS\src\Events.cpp': No such file or directory
1>  Generating Code...
1>  Compiling...
1>  CvProcessor.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxosc\src\ofxoscarg.h(76): error C2371: 'int32_t' : redefinition; different basic types
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(19) : see declaration of 'int32_t'
1>  CvPerson.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxosc\src\ofxoscarg.h(76): error C2371: 'int32_t' : redefinition; different basic types
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(19) : see declaration of 'int32_t'
1>  ofxCvCoordWarpingGui.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxxmlsettings\src\ofxxmlsettings.h(6): fatal error C1083: Cannot open include file: 'tinyxml.h': No such file or directory
1>  ofxCvCoordWarping.cpp
1>  CPUImageFilter.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxopencv\libs\opencv\include\opencv2\flann\flann.hpp(233): warning C4996: 'cv::flann::Index_<T>': was declared deprecated
1>          c:\users\mentingdesign\documents\github\openframeworks\addons\ofxopencv\libs\opencv\include\opencv2\flann\flann.hpp(278) : see reference to class template instantiation 'cv::flann::Index_<T>' being compiled
1>  ofxMSAInteractiveObject.cpp
1>  Server.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxlibwebsockets\libs\libwebsockets\include\libwebsockets.h(38): fatal error C1083: Cannot open include file: '../win32port/win32helpers/websock-w32.h': No such file or directory
1>  Reactor.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxlibwebsockets\libs\libwebsockets\include\libwebsockets.h(38): fatal error C1083: Cannot open include file: '../win32port/win32helpers/websock-w32.h': No such file or directory
1>  Protocol.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxlibwebsockets\libs\libwebsockets\include\libwebsockets.h(38): fatal error C1083: Cannot open include file: '../win32port/win32helpers/websock-w32.h': No such file or directory
1>  Events.cpp
1>  Connection.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxlibwebsockets\libs\libwebsockets\include\libwebsockets.h(38): fatal error C1083: Cannot open include file: '../win32port/win32helpers/websock-w32.h': No such file or directory
1>  Client.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxlibwebsockets\libs\libwebsockets\include\libwebsockets.h(38): fatal error C1083: Cannot open include file: '../win32port/win32helpers/websock-w32.h': No such file or directory
1>  jsoncpp.cpp
1>  ofxLabGui.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxxmlsettings\src\ofxxmlsettings.h(6): fatal error C1083: Cannot open include file: 'tinyxml.h': No such file or directory
1>  ofxKinect.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\addons\ofxxmlsettings\src\ofxxmlsettings.h(6): fatal error C1083: Cannot open include file: 'tinyxml.h': No such file or directory
1>  tinyxmlparser.cpp
1>  tinyxmlerror.cpp
1>  tinyxml.cpp
1>  ofxOscSender.cpp
« Last Edit: February 09, 2013, 04:33:26 AM by Marnick »

robotconscience

  • Administrator
  • Full Member
  • *****
  • Posts: 161
    • View Profile
Re: Compiling on Windows in Visual C++ Express 2010
« Reply #1 on: February 09, 2013, 05:19:03 PM »
Hey Marnick,

it looks like from the errors below that you're trying to compile openTSPS-gestures? Do you have the same errors from just the standalone app? The gestures app is under pretty heavy dev right now (primarily in OS X), so I can't promise that it will work on windows any time in the super near future. Definitely a plan in the next couple months.

Can you pull the repo and test the standalone/basic app?

Best,

brett

Marnick

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiling on Windows in Visual C++ Express 2010
« Reply #2 on: February 11, 2013, 06:16:14 AM »
Yes, you were right, thanks.

When compiling openTSPS/standalone/basic/openTSPS.sln I get the following error:

...\openframeworks\opentsps\addons\ofxtsps\libs\ofxtsps\include\ofxtsps\communication\websocketsender.h(9): fatal error C1083: Cannot open include file: 'ofxLibwebsockets.h': No such file or directory

Where should this ofxLibwebsockets.h be located?

robotconscience

  • Administrator
  • Full Member
  • *****
  • Posts: 161
    • View Profile
Re: Compiling on Windows in Visual C++ Express 2010
« Reply #3 on: February 11, 2013, 12:59:03 PM »
Hey Marnick,

You'll need to checkout all of the git submodules (ofxLibwebsockets is one of them):

From your command line + in the TSPS directory, call:

git submodule init
git subodule update

Try compiling now!


Marnick

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiling on Windows in Visual C++ Express 2010
« Reply #4 on: July 30, 2013, 05:24:43 PM »
Thanks so far. This program is great for many applications, if only I can get it compiled. For the previous project I used another solution, but now there is a new project in which I can play with computer vision  :) I am trying to compile again, but I get errors. I have attached them, otherwise I had too many characters.

I am using Visual C++ 2010 Express on a Windows 7 64 bit machine. I have Git the repositories openFrameworks and openTSPS, and did the 'git submodule update --init --recursive'  command in Git for Windows.

robotconscience

  • Administrator
  • Full Member
  • *****
  • Posts: 161
    • View Profile
Re: Compiling on Windows in Visual C++ Express 2010
« Reply #5 on: July 30, 2013, 06:12:50 PM »
Hey Marnick,

Glad you've gotten the chance to give it another try! Firstly, which project are you working from? The standalone/basic project is the best to start with (and has the most up-to-date Windows code). Can you try pulling again and seeing if you get the same errors? I was able to just compile fine; I'm hunting to see if there's a bad path somewhere in there!

Make sure all of the submodule directories (e.g. openTSPS/addons/ofxKinect) are populated with files as well.

Let me know how it looks! Can't seem to find the problem yet but confident we can track it down.


Marnick

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiling on Windows in Visual C++ Express 2010
« Reply #6 on: July 31, 2013, 09:04:32 AM »
Thank you!

I have downloaded everything again. It still doesn't build, but I get different messages, so maybe we are on track. I have attached a screenshot, maybe I am doing something terribly wrong. This is the output I get after trying to build the solution:

1>------ Build started: Project: openTSPS, Configuration: Debug Win32 ------
1>  core.c
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxkinect\libs\libfreenect\src\core.c(79): error C2079: 'timeout' uses undefined struct 'timeval'
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxkinect\libs\libfreenect\src\core.c(80): error C2228: left of '.tv_sec' must have class/struct/union
1>          type is 'int'
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxkinect\libs\libfreenect\src\core.c(81): error C2228: left of '.tv_usec' must have class/struct/union
1>          type is 'int'
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxkinect\libs\libfreenect\src\core.c(82): error C2664: 'freenect_process_events_timeout' : cannot convert parameter 2 from 'int *' to 'timeval *'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>  libusbemu.cpp
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxkinect\libs\libfreenect\platform\windows\libusb10emu\libusb-1.0\libusbemu.cpp(651): error C2027: use of undefined type 'timeval'
1>          c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxkinect\libs\libfreenect\platform\windows\libusb10emu\libusb-1.0\libusb.h(103) : see declaration of 'timeval'
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxkinect\libs\libfreenect\platform\windows\libusb10emu\libusb-1.0\libusbemu.cpp(651): error C2227: left of '->tv_sec' must point to class/struct/union/generic type
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxkinect\libs\libfreenect\platform\windows\libusb10emu\libusb-1.0\libusbemu.cpp(651): error C2027: use of undefined type 'timeval'
1>          c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxkinect\libs\libfreenect\platform\windows\libusb10emu\libusb-1.0\libusb.h(103) : see declaration of 'timeval'
1>c:\users\mentingdesign\documents\github\openframeworks\opentsps\addons\ofxkinect\libs\libfreenect\platform\windows\libusb10emu\libusb-1.0\libusbemu.cpp(651): error C2227: left of '->tv_usec' must point to class/struct/union/generic type
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

robotconscience

  • Administrator
  • Full Member
  • *****
  • Posts: 161
    • View Profile
Re: Compiling on Windows in Visual C++ Express 2010
« Reply #7 on: July 31, 2013, 10:51:39 AM »
OK! Figured it out for real this time! Unfortunately, it's a conflict between ofxKinect and ofxLibwebsockets that I haven't figured out a clean solution to. For now, you have to modify the windows libusb header that lives here:
openTSPS/addons/ofxKinect/libs/libfreenect/platform/windows/libusb10emu/libusb-1.0/libusb.h

Where it says (around line 40 or so)

Code: [Select]
// We need struct timeval.
  #include <winsock.h>

add this quick struct definition:

Code: [Select]

  struct timeval {
        long    tv_sec;         /* seconds */
        long    tv_usec;        /* and microseconds */
  };

That's it!

Marnick

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiling on Windows in Visual C++ Express 2010
« Reply #8 on: August 01, 2013, 04:53:09 AM »
That's it indeed, it is working now! I changed libusb.h and I also had to upgrade to Visual Studio 2010 SP1 to prevent some other errors popping up. Thank you very much. When the project is ready I'll post a video with the result :)