Jump to content
Tuts 4 You

Trivial C runtime. Linker error


Loizos

Recommended Posts

I am giving a shot on BigBoote's tutorial "Writing your own packer".

 

Right at the beginning of the project I ran into linking problems.

 

As a result of not using the default libraries(on purpose) , the linker complains about the unresolved external symbol __ DllMainCRTStartup@12

 

In order to fix the linking error the author suggested on replacing the DllMain function with DllMainCRTStartup.He claims that this will fix the linker's error and at the same time be the EP.I've tried replacing the Boiler-Plate DllMain function with the DllMainCRTStartup  but the problem is still there.I have done my research and I can't seem to find anyone that had similar problems.

 

Any ideas?

 


BOOL WINAPI _DllMainCRTStartup ( HANDLE, DWORD, LPVOID )
{
//Program will go here
return TRUE;
}

 

 

Edited by Loizos
Link to comment
6 hours ago, A200K said:

What dev environment do you use?

If you use Visual Studio, try setting the entry point to DllMain in your linker settings of the project

See more here:

https://msdn.microsoft.com/en-us/library/f9t8842e.aspx

Problem solved!The linker doesn't complain anymore.Setting it as an EP makes sense , I don't know why I haven't thought of it. Thank you.

Edited by Loizos
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...