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

Unable to compile helloworld.cpp example (from Visual Studio Code doc) #358

Open
slolo2000 opened this issue Jan 4, 2025 · 7 comments
Open

Comments

@slolo2000
Copy link

Hello,

I have created a post on github for "Vs Code cpptools".
You can find the post here : microsoft/vscode-cpptools#13086

As you can see, I am not able to compile a simple helloworld with the last version on MYSYS2 msys2-x86_64-20241208.exe
Available here (msys2-x86_64-20241208.exe

But I can compile a simple helloworld in c (with gcc)

Is there any minimum requirement with the last version which make the error message appears?
image

With a previous install program (msys2-x86_64-20230526.exe) I have no problem.
Available here : https://github.com/msys2/msys2-installer/releases/download/2023-05-26/msys2-x86_64-20230526.exe

Thanks in advance for your help.

@Biswa96
Copy link
Member

Biswa96 commented Jan 4, 2025

Can you compile the helloworld file in ucrt64 environment without vscode?

@slolo2000
Copy link
Author

I am rather new to Msys2 but after some research here is what I did:
I Double clicked on the file "D:\Dvpt\msys64\ucrt64.exe" => It opened a command window.

I have test 2 command lines (because I have 2 test projects.
The first one (c project)
gcc.exe -fdiagnostics-color=always -g D:\\Project\\c\\helloworld.c -o D:\\Project\\c\\helloworld.exe
It works very well 👍

The second one (c++ helloworld project)
g++.exe -fdiagnostics-color=always -g D:\\Project\\cpp\\helloworld.cpp -o D:\\Project\\cpp\\helloworld.exe
It works very well too 👍

So I'm even more confused about the fact that it works when outside the Msys execution environment (UCRT64) I have an error message (only for compiling in C++)

Any idea?

@Biswa96
Copy link
Member

Biswa96 commented Jan 4, 2025

Could you please translate the error message in the screenshot?

@slolo2000
Copy link
Author

The translation give this:


cc1plus.exe - Entry point not found

The procedure entry point crc32_combine was not found in the dynamic link library D:\Dvpt\msys64\ucrt64\bin..\lib\gcc\x86_64-w64-mingw32\14.2.0\cc1plus.exe.

Ok

In a MS DOS command:
D:\Project>gcc.exe -fdiagnostics-color=always -g D:\Project\cpp\helloworld.cpp -o D:\Project\cpp\helloworld.exe
Works well.

D:\Project>g++.exe -fdiagnostics-color=always -g D:\Project\cpp\helloworld.cpp -o D:\Project\cpp\helloworld.exe
Does not work and display the message above.

It is like it misses a path in environment variables which should initialized by ucrt64 environment.

@Biswa96
Copy link
Member

Biswa96 commented Jan 4, 2025

Does adding D:\Dvpt\msys64\ucrt64\bin in PATH environment variable work?

For example, set PATH=D:\Dvpt\msys64\ucrt64\bin;%PATH%

@slolo2000
Copy link
Author

As explained here I already added this folder to my PATH environment variable.

The strangest thing is that everything works perfectly with version msys2-x86_64-20230526.exe of Msys2 but not the latest version msys2-x86_64-20241208.exe

@slolo2000
Copy link
Author

I have done a test to update from msys2-x86_64-20230526.exe to the latest version with the command line:
pacman -Suy
I have exactly the same problem as if I have done a fresh install.

I assume the latest version must use a path to files that is not in the system path.
Any help is welcome.

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