Problem when trying to build VS project for Windows.

52 views
Skip to first unread message

Insurikai

unread,
Sep 23, 2018, 9:47:53 PM9/23/18
to psmove
Following the instructions from here to try and build the VS project but when running " call scripts/visualc/build_msvc.bat 2017 x64 " I get this
output.PNG. A file called "core.crt", among other files, are missing from libusb_static_2017.vcxproj and i have no idea how to fix this. Any help is appreciated.

Alexander Nitsch

unread,
Sep 25, 2018, 5:18:34 PM9/25/18
to psm...@googlegroups.com
Which version of psmoveapi are you trying to build? Please provide the
release version or the Git commit hash, respectively.

Insurikai

unread,
Sep 27, 2018, 2:32:24 AM9/27/18
to psmove
The most recent one. So 30f17054ddec8a5dea243075971ea9c3d6a73347 (i think, not quite sure what a git hash is. Fairly new to github.)

Alexander Nitsch

unread,
Sep 29, 2018, 4:33:32 AM9/29/18
to psm...@googlegroups.com
> The most recent one. So 30f17054ddec8a5dea243075971ea9c3d6a73347 (i think,
> not quite sure what a git hash is. Fairly new to github.)

Yes, that commit hash matches the latest release (psmoveapi 4.0.6), so
that seems alright.

I do not currently have a Windows machine available for testing, but
maybe we can track this problem down anyway. Additionally, we have the
CI build of the latest release (also built on x64 using Visual Studio
2017) available for comparison:


https://ci.appveyor.com/project/thp/psmoveapi/build/1.0.514/job/u5h9cgl2eg3obhxf


There is already a problem in the first line of your log. Visual
Studio's vcvarsall.bat setup script was not found. I am not sure if this
has to do with the fact that you are already running this from the
Developer Command Prompt (which makes calling this script superfluous).
Can you check where in your installation the vcvarsall.bat is located?
Does the error still occur if you run the script from a normal command
prompt, i.e. not the VS 2017 Developer Command Prompt?

On to the libusb issues. As noted in the log, the patch could not be
applied possibly because libusb was not checked out. Please have a look
in psmoveapi's external/ directory. There should be a couple of
subdirectories, including libusb-1.0/. If they are missing or are empty,
you need to fetch these external repositories first. From the psmoveapi
root directory run

git submodule update --init

to do that.

Insurikai

unread,
Sep 29, 2018, 11:56:06 PM9/29/18
to psmove

output.PNGRunning from a normal cmd gave me this. From what i've read this is a byproduct of not running it from the developer cmd. vcvarsall.bat is in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build" for me. I have all the externals, except the PS3EYEDriver one as the github in the readme doesn't exist anymore.

Alexander Nitsch

unread,
Sep 30, 2018, 5:24:39 AM9/30/18
to psm...@googlegroups.com
> vcvarsall.bat is in "C:\Program Files (x86)\Microsoft Visual
> Studio\2017\Community\VC\Auxiliary\Build" for me.

Looks like they shuffled the location of that script around. Maybe this
is a Windows 10 thing.

We have to modify the script to take that into account. For now, you
need to run from developer command prompt (as you did initially).


> I have all the externals, except the PS3EYEDriver one as the github
> in the readme <https://github.com/thp/PS3EYEDriver> doesn't exist
> anymore.

It sound as if you put the externals there manually. Don't do that. Each
of them references a specific point in the external repositories. You
were likely trying to build the the wrong version of libusb.

Remove the subdirectories

external/hidapi/
external/libusb-1.0/
external/PS3EyeDriver/

Then run

git submodule update --init

in the psmoveapi root directory. The output should match what you see in
the first couple of lines in the CI build log:


https://ci.appveyor.com/project/thp/psmoveapi/build/1.0.514/job/u5h9cgl2eg3obhxf

Insurikai

unread,
Sep 30, 2018, 3:15:18 PM9/30/18
to psmove
Reinstalled VS and the neccessary modules and got past most of the issues, this is the output. 

That was before running "git submodule update --init " which doesn't seem to do anything, the external folder doesn't change. 
Tried running it from a git cmd, regular cmd, and the vs dev cmd all with admin privileges.

Alexander Nitsch

unread,
Sep 30, 2018, 3:44:40 PM9/30/18
to psm...@googlegroups.com
> Reinstalled VS and the neccessary modules and got past most of the issues,
> this <https://pastebin.com/47b9gW6s> is the output.

Is the vcvarsall.bat still in the same location after the reinstall?

Building libusb and OpenCV succeeded. Only the actual psmoveapi lib
could not be built. The output is rather strange: Firstly, the
configuration step is missing nearly all of its usual output (following
the line "Generating PSMoveAPI solution"). Secondly, build files have
been successfully created, yet the script aborts with an error.

Does the script always terminate at the same place, with the same message?

Have a look at the directory
C:/Users/Insur/Downloads/psmoveapi-master/build-x64. Does it contain any
.vcxproj files? If it does, you can try to run the build step manually.
From that directory, run

msbuild.exe ALL_BUILD.vcxproj /p:Configuration=Release
/property:Platform=x64

Does that work?


> That was before running "git submodule update --init " which doesn't seem
> to do anything, the external folder doesn't change.

That probably means you already fetched the submodules earlier.


> Tried running it from a git cmd, regular cmd, and the vs dev cmd all with
> admin privileges.

You do not neet to run the psmoveapi build with admin privileges. And
you probably *should* not run builds as admin either.

Insurikai

unread,
Sep 30, 2018, 4:36:15 PM9/30/18
to psmove
Managed to get it to build successfully
What appeared to be my problem from the beginning was that something was wrong with my VS installation, either i didn't have some of the necessary modules or maybe it was wrong by some other means.
I manually retrieved the submodules from either the links located in the ".gitmodules.txt" file in the root folder or by looking for the other githubs online.
Thanks for all the help Alexander Nitsch.
Reply all
Reply to author
Forward
0 new messages