Cannot compile new 4.7 project from code

I just downloaded 4.7. I create a new blank project from code. The files generate but there is a LINK error during the compiling.

Error 1 error LNK1181: cannot open input file ‘ws2_32.lib’ D:\TestGame\Intermediate\ProjectFiles\LINK TestGame

I am on Windows 8.1 x64 - VS2013 Professional.
This is an modified blank project.

Hey Demonicated-

To help me investigate the problem you’re having there are a couple questions I’d like to ask. Are you using 4.7 from the launcher or are you using a source code build from GitHub? Does the same error appear when creating a new unmodified project? Do you get the same error if you update to 4.7.1?

Cheers

I just upgraded to 4.7.1 and am still having the same issue when creating a new project from code.

I open the engine from the Epic games launcher → click new project → click the C++ tab → click Basic Code project. It copies the files, begins compiling and I get the message Project Conversion Failed. The project failed to compile with this version of the engine. Would you like to open the project in Visual Studio?

Here is the build log:

The project failed to compile with this version of the engine. Build output is as follows:

Running C:/Program Files/Epic Games/4.7/Engine/Binaries/DotNET/UnrealBuildTool.exe Test Development Win64 -project=“D:/Documents” -rocket -editorrecompile -progress
Parsing headers for TestEditor
Reflection code generated for TestEditor
Performing 7 actions (4 in parallel)
[3/7] Resource Test.rc
[2/7] Resource ModuleVersionResource.rc.inl
PCH.Test.Test.h.cpp
Test.generated.cpp
Test.cpp
TestGameMode.cpp
[7/7] Link UE4Editor-Test.dll
LINK : fatal error LNK1181: cannot open input file ‘ws2_32.lib’
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: D:\Documents\GitHub\Test\Binaries\Win64\UE4Editor-Test.dll
Cumulative action seconds (4 processors): 0.00 building projects, 23.34 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.11 linking, 0.00 other
UBT execution time: 33.96 seconds

Blueprint projects work fine, but I want to create a code project

Hey Demonicated-

The problem may be that your %Temp% folder his too many files in it as pointed out here: [4.7] UnrealBuildTool Failed to generate project files - C++ - Epic Developer Community Forums

I would try searching for the folder on your computer and clear out any older temporary files that are no longer needed. Let me know if you still have any problems after that.

Cheers

Hi ,

I have got exac5tly the same problem as Demonicated had. Therefore I tried if clearing the Temp folder would solve the problem, but i still keep getting this error:

The project failed to compile with this version of the engine. Build output is as follows:

Running D:/Program Files/Epic Games/4.7/Engine/Binaries/DotNET/UnrealBuildTool.exe MyProject3 Development Win64 -project=“D://Unreal Projects/MyProject3/MyProject3.uproject” -rocket -editorrecompile -progress
Parsing headers for MyProject3Editor
Reflection code generated for MyProject3Editor
Performing 7 actions (4 in parallel)
[2/7] Resource ModuleVersionResource.rc.inl
[3/7] Resource MyProject3.rc
PCH.MyProject3.MyProject3.h.cpp
MyProject3.cpp
MyProject3.generated.cpp
MyProject3GameMode.cpp
[7/7] Link UE4Editor-MyProject3.dll
LINK : fatal error LNK1181: cannot open input file ‘ws2_32.lib’
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: D:\Unreal Projects\MyProject3\Binaries\Win64\UE4Editor-MyProject3.dll
Cumulative action seconds (4 processors): 0,00 building projects, 27,79 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,10 linking, 0,00 other
UBT execution time: 37,34 seconds

Any other suggestions what may solve it?

Thanks in advance,

Yeah still didnt work for me either.
Some things to note: I recently uninstalled Visual Studio 2015.
Also my engine was on the C drive while my project was on D.

I have tried reinstalling everything from scratch and am still getting this issue.

What I dont understand is how to find this being linked. This is a sockets library and is 32 bit im assuming. Is there a 64 bit lib file that should be referenced instead? or where could I manually add this file to fix the linking issue? A common folder somewhere?

I’m having Visual Studio on C, but my Engine as well as the Project are located on D. I also recently uninstalled Visual Studio 2015, our situations seem to be quite similar…

Hey Demonicated and nukeru-

I have submitted a report about the inability to create a code project (UE-11387) for further investigation. In the meantime can you attempt a couple other things for me? First, if you create a blueprint project are you able to, in the editor, go to File->Add Code to Project? Additionally, can you check if you have the Windows SDK installed? You can get the SDK here (http://www.microsoft.com/en-us/download/details.aspx?id=8279) if you don’t have it or are unsure if you do or not.

EDIT: Another solution to check would be to follow 's answer here (Can't create C++ projects, or open ones from Beta - Programming & Scripting - Epic Developer Community Forums) to see if VS120COMNTOOLS is set properly

Thanks

I’ve tried adding code manually as you described and i got the same error as before. I have Windows SDK installed and my VS120COMNTOOLS variable is set to the right path. Unlike Demonicated (Windows 8.1) I’m on Windows 7 by the way, so this doesn’t seem to play a role.

I found a workaround that solved the problem for my case:

The needed lib is located at: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib (at least in my case)
I copied it to: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib and afterwards I could create a C++ Project without any further errors.

I could imagine that either my Visual Studio directory is lacking some libs, although I used the “Repair” functionality several times so it should be complete, or the compiler is just searching the lib in the wrong directory and somehow expects it in VS instead of at the Windows SDK folder.

I had this problem today. Windows 8.1, 64-bit

I got it fixed by going to programs and features in Windows. (where you uninstall stuff)
Click on MS Visual Studio 2013
Click REPAIR
and when the options show up as to where to REPAIR from, choose the internet… even if you have a disc or an image. It doesn’t ask for a key or anything.

Let it go. took about 20 mins for me. Then it all worked fine.

Hope it helps you.

Hey guys-

Now that 4.7.3 has been released I encourage everyone to update their engine version and attempt to create a C++ project again. If anyone is still having problems creating projects please let us know what operating system you are using, if you are using the binary version or source code version of the engine, and any other information that may be useful such as error messages.

Cheers

Hi, I am having problem. I am on 4.16.0 Unreal Engine

Please reply these Can't compile the project - Pipeline & Plugins - Epic Developer Community Forums questions

Hello 143258-

Please create a new post for the issue you’re having and provide as much detail about the problem itself and your setup to help reproduce and investigate the problem.

Cheers

I solved the problem somehow.

OK here I asked the question a few day ago.

It still doesn’t work. I also tried to install the Windows SDK and even but it didn’t work, I installed the .NET Framework 4.7 too.

Newest: I’m trying to repair VS.

Hi, I am having promlems to and it would be realy nice if you could help me : )

Here is my Question

I solved the problem somehow.