| Summary: | "Symbol already defined in object" with static library of SDL2 compiled by Visual Studio | ||
|---|---|---|---|
| Product: | SDL | Reporter: | oliverrheinhardt |
| Component: | *don't know* | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | 2.0.3 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 7 | ||
| Attachments: | SDL 2.0.3 source code in static library configuration with MSVC. | ||
|
Description
oliverrheinhardt
2014-05-12 07:37:02 UTC
Created attachment 1646 [details]
SDL 2.0.3 source code in static library configuration with MSVC.
I used "VisualC/VS2012EE.sln" and related projects.
The properties of them are a little bit changed.
Source codes are not changed.
1) For "SDL2" project, all configurations, all platforms.
"Configuration Type" was changed from ".dll" to ".lib".
2) For all projects, "Release" configuration, all platforms.
"Runtime libraries" was changed from /MD to /MT.
3) For all projects, "Debug" configuration, all platforms.
"Runtime libraries" was changed from /MDd to /MTd.
I forgot to mention that there is NO ERROR in "SDL2.lib" build.
It works.
However, when I try to LINK this library, the LNK2005 occurs.
If you link SDL statically, you also need to define HAVE_LIBC so it builds with the C runtime that your application uses. This should probably go in a FAQ. (In reply to Sam Lantinga from comment #2) > If you link SDL statically, you also need to define HAVE_LIBC so it builds > with the C runtime that your application uses. > > This should probably go in a FAQ. Oh, thank you. At that time I could not find it. :( Many thanks, Can this bug be closed, then? --ryan. Oops, I'm sorry for not telling you about it clearly. Yes, I think so. Thanks for your help. |