Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exe build does not starts correctly #35

Open
muratulashozturk opened this issue Jul 15, 2023 · 20 comments
Open

Exe build does not starts correctly #35

muratulashozturk opened this issue Jul 15, 2023 · 20 comments

Comments

@muratulashozturk
Copy link

Hello, I've compiled an exe version for the bot and I've moved the files to my Windows 2019 server, I run, and after that, I got the The application was unable to start correctly (0xc0000142) error.

I already installed vc++ redistributable 2022, what else should I install to run the exe build?

Note: the exe works on my main computer which I had the build on.

Bot.exe
Bot.pdb
discordcoreapi.dll
libcrypto-3-x64.dll
libsodium.dll
libssl-3-x64.dll
opus.dll
@RealTimeChris
Copy link
Owner

Did you copy the .dll files to whichever folder you are running the .exe from?

@muratulashozturk
Copy link
Author

Did you copy the .dll files to whichever folder you are running the .exe from?

Well, I mean I got the export and I copied files to the server. What files else do I need to copy?

@RealTimeChris
Copy link
Owner

This list of .dll files

Bot.exe
Bot.pdb
discordcoreapi.dll
libcrypto-3-x64.dll
libsodium.dll
libssl-3-x64.dll
opus.dll```

@muratulashozturk
Copy link
Author

This list of .dll files

Bot.exe
Bot.pdb
discordcoreapi.dll
libcrypto-3-x64.dll
libsodium.dll
libssl-3-x64.dll
opus.dll```

Yes, they are in the directory with the exe.

@RealTimeChris
Copy link
Owner

@muratulashozturk
Copy link
Author

Have you tried any of these fixes? https://helpdeskgeek.com/how-to/how-to-fix-the-application-was-unable-to-start-correctly-0xc0000142-error-in-windows/

It didn't work, I will deeply analyze the issue with the dependency walker.

@muratulashozturk
Copy link
Author

Still couldn't find the issue. There are a lot of missing dependencies when in VCRUNTIME140.dll when I look it through Dependency walker.

@RealTimeChris
Copy link
Owner

RealTimeChris commented Jul 18, 2023

Hmm interesting. Which version of Visual Studio are you building it with?
Maybe try building it with VS2019 instead to see if it runs on Server 2019 more easily?

@muratulashozturk
Copy link
Author

Prolly the issue is because of Server 2019, tried with home pc win 10, worked without an issue. Will try with server 2022 today.

@muratulashozturk
Copy link
Author

Same result on server 2022 too, I am for sure missing some libraries but I don't know which

@RealTimeChris
Copy link
Owner

Interesting - this sounds inconvenient.

@muratulashozturk
Copy link
Author

Windows reports that the discordcoreapi.dll is faulty. There are missing dependencies for discordcoreapi.dll I think. I'll look on it more

@muratulashozturk
Copy link
Author

muratulashozturk commented Jul 22, 2023

        const auto _Max_storage_buckets               = static_cast<size_type>(1) << _Max_storage_buckets_log2;

^ Unhandled exception at 0x00007FFE8B9BAC1D (discordcoreapi.dll) in Bot.exe: 0xC000001D: Illegal Instruction.

When I debug the app on the server, It throws the error above. This is really strange. The app works on my friend's computer but on the server not. I don't know which dependencies are missing and can't really locate it too.

@RealTimeChris
Copy link
Owner

I think this must be due to the AVX instructions that are being used. "Illegal instruction" is what you get when you call one that is not supported.

@RealTimeChris
Copy link
Owner

I think this means I need to set it up so that you can easily select, at compile time, which instruction set gets used.

@muratulashozturk
Copy link
Author

I will try it on Linux too

@RealTimeChris
Copy link
Owner

Are you running it in a VM by chance?

@muratulashozturk
Copy link
Author

Are you running it in a VM by chance?

Nope

@muratulashozturk
Copy link
Author

muratulashozturk commented Sep 29, 2023

Hello, I saw that you published a new version, could you please try to build an exe and launch it in your free time? It could be helpful if there is an example project and documentation for publishing console exe to host bots on windows servers. @RealTimeChris

@RealTimeChris
Copy link
Owner

RealTimeChris commented Dec 12, 2023

Hello, I saw that you published a new version, could you please try to build an exe and launch it in your free time? It could be helpful if there is an example project and documentation for publishing console exe to host bots on windows servers. @RealTimeChris

https://github.com/RealTimeChris/Bot-Template-For-DiscordCoreAPI
This should help you. I just succesfully built and run an executable on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants