Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: VS2003 & 0.8.2SDK & Win32 dll (Read 5227 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

VS2003 & 0.8.2SDK & Win32 dll

Hi!

I use VS .net 2003 and foobar 0.8.2.
I did this:
1) Choose New Project->Win32 project->Dll, named it foo_my
2) Add component_client.cpp to foo_my
3) Add projects foobar200SDK, pfc, utf8api
4) Set dependences: foo_my -> foobar2000SDK
   Foobar2000SDK -> pfc, Foobar2000SDK -> utf8api
5) Disable precompiled headers
6) Select Release

And than I got following:

------ Build started: Project: utf8api, Configuration: Release Win32 ------
Linking...
  Creating library .\../Release/utf8api.lib and object .\../Release/utf8api.exp
crash_info.obj : error LNK2019: unresolved external symbol "unsigned int __cdecl strlen_max(char const *,unsigned int)" (?strlen_max@@YAIPBDI@Z) referenced in function _uPrintCrashInfo
systray.obj : error LNK2001: unresolved external symbol "unsigned int __cdecl strlen_max(char const *,unsigned int)" (?strlen_max@@YAIPBDI@Z)

Huge of LNK2019 and others!!!

string_base::skip_trailing_char(unsigned int)" (?skip_trailing_char@string_base@@QAEXI@Z) referenced in function _uGetOpenFileNameMulti
.\../Release/utf8api.dll : fatal error LNK1120: 17 unresolved externals
utf8api - 26 error(s), 0 warning(s)

------ Build started: Project: foo_my, Configuration: Release Win32 ------
Linking...
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _realloc already defined in LIBCMT.lib(realloc.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: __i64toa already defined in LIBCMT.lib(xtoa.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: __ui64toa already defined in LIBCMT.lib(xtoa.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _atoi already defined in LIBCMT.lib(atox.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: __ultoa already defined in LIBCMT.lib(xtoa.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: __itoa already defined in LIBCMT.lib(xtoa.obj)
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: _free already defined in LIBCMT.lib(free.obj); second definition ignored
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: _realloc already defined in LIBCMT.lib(realloc.obj); second definition ignored
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: _malloc already defined in LIBCMT.lib(malloc.obj); second definition ignored
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: __i64toa already defined in LIBCMT.lib(xtoa.obj); second definition ignored
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: __ui64toa already defined in LIBCMT.lib(xtoa.obj); second definition ignored
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: _atoi already defined in LIBCMT.lib(atox.obj); second definition ignored
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: __ultoa already defined in LIBCMT.lib(xtoa.obj); second definition ignored
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: __itoa already defined in LIBCMT.lib(xtoa.obj); second definition ignored


I don’t want to use MFC Dll, I just moved from BCB and I’ve never worked with MFC, I need a simple dll (for a start  Thanks for any help!

P.S
Sorry, if there are any grammatical mistakes

VS2003 & 0.8.2SDK & Win32 dll

Reply #1
1) you should add the foobar2000_component_client project to your workspace and make your project dependend on it instead of directly adding component_client.cpp.

2) You should use the same version of the runtime libraries as the static libraries you link against, i.e. use multithreaded dll runtimes like foobar2000_sdk and foobar2000_component_client. (Look for "C++/Code generation" in project settings.)

VS2003 & 0.8.2SDK & Win32 dll

Reply #2
Thanks! I did so. It works, but not at all. I add component_client project and set "foo_my->runtime library->Multi-threaded DLL (/MD)". And foo_my was compilled successfully, but I still have the same problems during utf8api compilling. Should I do something else?


VS2003 & 0.8.2SDK & Win32 dll

Reply #4
Now it works! Thanks a lot!