March 29, 2024, 14:25
bigger smaller reset     1020px Wide width Full width Reset   * *

Gildor's Forums

  Homepage Facebook Read news on Twitter Youtube channel Github page
Welcome, Guest. Please login or register.
Did you miss your activation email?

« previous next »
Print
Author Topic: Problems building code from Visual Studio  (Read 1148 times)
Cyreal
Newbie
*
Posts: 15


View Profile
« on: October 03, 2020, 12:47 »

Hello! I am having trouble with running your code in Visual Studio 2017. I am using Windows 10. Here is what I did:

As per instructions I downloaded the source as a zip and then I put UEViewer-master on Desktop, then I downloaded BuildTools and put it in C:\. I went to System->Advanced System Settings->Environment Tables-> and then I added C:\BuildTools-master\bin to the Path.

After that I opened Visual Studio 2017 -> File -> Open -> Folder -> and then I chose UEViewer-master folder that I put on the Desktop. At this point I wasn't really sure what to do, so I selected a random .cpp file -> Right Click -> Build: I get error: "bash.exe": build.sh: No such file or directory

So then I decided to copy and paste the build.sh file to C:\BuildTools-master\bin and build again. This time build succeeded. Have I done everything properly up to this point? Nevertheless, I still have problems:

First - what should I select for debugging I have: x86-Debug, x86-Release, x64-Debug and x-64-Release. I assume I need to choose x86-Debug?

Second - from the Select Startup Item dropdown I have the following options - No arguments, UI_Dev.sln, UI_Dev.vcxproj and Use cmdline.cfg. I assume the UI_ ones are for the UI testing you mentioned in the readme that shouldn't be touched. So should I use "No arguments" or "cmdline.cfg"?

And my biggest problem - when I launch the program I get "The code execution cannot proceed because SDL2.dll was not found. Reinstalling the program may fix the problem.".

I am not really sure how to properly build and then debug the code? For example when I open Core.h inside it the line #include "Build.h" is underlined in red saying "cannot open source file "Build .h"". But when I open the Build.h header, the error is gone. And also, I opened multiple .cpp and .h files and Visual Studio starts acting weird - it would underline a lot of code marking it for errors but then after a while the errors disappear. I am not sure what's going on?

Thanks!
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #1 on: October 03, 2020, 13:06 »

After that I opened Visual Studio 2017 -> File -> Open -> Folder -> and then I chose UEViewer-master folder that I put on the Desktop. At this point I wasn't really sure what to do, so I selected a random .cpp file -> Right Click -> Build: I get error: "bash.exe": build.sh: No such file or directory
I'm using VS2019, probably VS2017 wasn't mature enough for using custom project? It is possible that your Desktop folder has spaces somewhere, and bash or VS can't handle that.

Quote
So then I decided to copy and paste the build.sh file to C:\BuildTools-master\bin and build again. This time build succeeded.
That's not a solution ...

Quote
First - what should I select for debugging I have: x86-Debug, x86-Release, x64-Debug and x-64-Release. I assume I need to choose x86-Debug?
"Release" has much less possibilities for debugging due to compiler optimizations.

Quote
Second - from the Select Startup Item dropdown I have the following options - No arguments, UI_Dev.sln, UI_Dev.vcxproj and Use cmdline.cfg. I assume the UI_ ones are for the UI testing you mentioned in the readme that shouldn't be touched. So should I use "No arguments" or "cmdline.cfg"?
"No arguments" should launch UModel's startup UI. "cmdline.cfg" will use command line parameters from Docs/cmdline.cfg file, if you'll make one.

Quote
And my biggest problem - when I launch the program I get "The code execution cannot proceed because SDL2.dll was not found. Reinstalling the program may fix the problem.".
build.sh copies SDL2.dll next to umodel.exe. If you have this file missing, then build didn't go well.

Quote
I am not really sure how to properly build and then debug the code? For example when I open Core.h inside it the line #include "Build.h" is underlined in red saying "cannot open source file "Build .h"". But when I open the Build.h header, the error is gone. And also, I opened multiple .cpp and .h files and Visual Studio starts acting weird - it would underline a lot of code marking it for errors but then after a while the errors disappear. I am not sure what's going on?
I don't have this problem with VS2019. By the way, custom build support in VS is very buggy - even in VS2019, so I'm using it VSCode for most of development, unless I need a better debugger.

For instance ...
- When I'm using "devenv.exe <umodel-folder>" command in a shortcut, VS2019 always starts with Solution Explorer closed, I need to manually open this window. If I'm starting VS2019 with no parameters, and then select previously opened UModel's directory, Solution Explorer appears as it should. This problem didn't exist before, so this is a newly introduced "feature" (like Microsoft does with Skype, Windows etc - they're adding more and more bugs to software).
- A few days ago, I used UModel with Fortnite, with no problems. Changed a line of code - then opening of Fortnite started to crash UModel. I even updated the game, it didn't help. Using older umodel.exe didn't help. I've closed all VS2019 instances (including my WORK project, not just UModel), started again - crash disappeared.
- Sometimes "launch options" do not appear. I have 2 .sln options there, but no "cmdline" or "no arguments" options. I've restarted VS a few times, etc - after 30 minutes of "fight" I've got these options again, and I have no idea why they appeared again.
- Previously (and may be now), editing of "cpp properties json" file from VS2019 crashed the editor. It displayed an exception message, then file started to be displayed without any syntax highlighting, with no possibility to put any cursor for editing (or even copy-pasting) anything.
- And so on ...
Logged
Cyreal
Newbie
*
Posts: 15


View Profile
« Reply #2 on: October 03, 2020, 22:23 »

I'm using VS2019, probably VS2017 wasn't mature enough for using custom project? It is possible that your Desktop folder has spaces somewhere, and bash or VS can't handle that.

I deleted the build tools and the UIviewer-master. I redownloaded them and put them in C:\Github\, then I deleted the old environment path and set a new one to match the new path: C:\Github\BuildTools-master\bin

So now my UEViewer-master folder is in C:\Github\

The path to the build.sh looks like this C:\Github\UEViewer-master\build.sh

As you can see, there are no empty spaces. I opened the UEViewer-master folder from the new place now in Visual Studio, I right click a random folder like Unreal or UModelTool and then click Build, but I still get:

Code:
"bash.exe": build.sh: No such file or directory

Build failed.

Not sure what's going on? I see other people managed to run it in Visual Studio 2017, I don't understand why I can't. I never toyed with any particular options in my IDE ever, other than changing the theme to dark.

I do have a theory though. I must inform you that I opened .vs\tasks.vs.json
And I have 2 warnings and 2 messages



Maybe this is the culprit?
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #3 on: October 03, 2020, 22:27 »

Open .vs/tasks.vs.json
Try replacing all
Code:
"args": [ "build.sh ...
with
Code:
"args": [ "./build.sh ...

I.e. adding "./" before build.sh.
Logged
Cyreal
Newbie
*
Posts: 15


View Profile
« Reply #4 on: October 03, 2020, 22:33 »

Open .vs/tasks.vs.json
Try replacing all
Code:
"args": [ "build.sh ...
with
Code:
"args": [ "./build.sh ...

I.e. adding "./" before build.sh.

Same problem. This time it says:

Code:
"bash.exe": ./build.sh: No such file or directory

Build failed.

Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #5 on: October 03, 2020, 22:37 »

Well, for debug reasons - insert "pwd; ls; ./build.sh..." there.
This will print current directory name and its contents - the directory where "build.sh" is attempted to run. May be the directory is wrong, or may be build.sh is not recognized.
Logged
Cyreal
Newbie
*
Posts: 15


View Profile
« Reply #6 on: October 03, 2020, 22:40 »

Same thing  :'(
Nothing is being printed.
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #7 on: October 03, 2020, 22:42 »

I need to know OUTPUT Smiley

If build.sh will be in "ls" output, use "ls -l" instead, it will print attributes of all files. "x" means "executable" there - Unix has this as a separate flag. For me, all files are listed as executable on Windows and Linux (VM), but if not - bash won't run the script, I think.

Also take a look at WHICH bash.exe is executed. May be you have another one, which doesn't work?

I'm actually lost ...
Logged
Cyreal
Newbie
*
Posts: 15


View Profile
« Reply #8 on: October 03, 2020, 22:47 »

Well this is all I get:

Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #9 on: October 03, 2020, 22:52 »

Damn, nice ... Bash can't recognize BUILTIN command.

Try the following then. Open command prompt, "cd" to the umodel's directory. Check that it is correct (e.g. using "dir" command, see "build.sh" etc there).

Start bash.exe

In bash, type "./build.sh" and run.
Logged
Cyreal
Newbie
*
Posts: 15


View Profile
« Reply #10 on: October 03, 2020, 23:02 »





I don't even...  sad
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #11 on: October 03, 2020, 23:15 »

Try "ls" and "pwd" commands in bash ...
(I'll separate discussion to own thread)
Logged
Cyreal
Newbie
*
Posts: 15


View Profile
« Reply #12 on: October 03, 2020, 23:20 »



I will double check to see if I don't have another bash.exe somewhere, but could this really be the problem in this case?
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #13 on: October 03, 2020, 23:26 »

The problem here is that when you started bash, it points to the wrong directory.
When I use CMD and "cd" to umodel's directory, then run bash - it will keep current directory. In your case, starting bash points to bash.exe directory, what's wrong.
Logged
Cyreal
Newbie
*
Posts: 15


View Profile
« Reply #14 on: October 03, 2020, 23:33 »

Uhh, any idea how to fix this?
Logged
Print 
« previous next »
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS