powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / C++ [игнор отключен] [закрыт для гостей] / BCB -> VC++7.1: unresolved external любые C++ Run-Time функции
3 сообщений из 3, страница 1 из 1
BCB -> VC++7.1: unresolved external любые C++ Run-Time функции
    #32565284
slydiman
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Я в идеале знаю BCB6, но вот пришлось заняться VC++ и вперся.

На Visual C++ 7.1 (точнее Visual Studio .NET 2003) создаю проект VC++ Class Library (.NET).
Использую любую Standard Run-Time функцию, например memset (все начилось с ZeroMemory)
и получаю:

error LNK2001: unresolved external symbol "void * __cdecl memset(void *,int,unsigned int)" (?memset@@$$J0YAPAXPAXHI@Z)

Куда копать? Перебрал все ключи линкера, библиотеки и пр. - бесполезно.
Или в .NET проекте вообще нельзя использовать memset(), а только System.Buffer.SetByte() ?
А дальше мне нужно использовать Win32, например CreateFileMapping()... И как быть? :(
...
Рейтинг: 0 / 0
BCB -> VC++7.1: unresolved external любые C++ Run-Time функции
    #32565841
Basilisk
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
slydiman
дальше мне нужно использовать Win32, например CreateFileMapping()... И как быть? :(


From MSDN:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
Calling Unmanaged Code from a Managed Application
The DllImport attribute is very useful when reusing existing unmanaged code in a managed application. For instance, your managed application might need to make calls to the unmanaged WIN32 API.

This common scenario is demonstrated in the following code sample where the MessageBox (located in User32.lib) is called:

#using <mscorlib.dll>
using namespace System::Runtime::InteropServices; 
// for DllImportAttribute

namespace SysWin32
{
   [DllImport("user32.dll", EntryPoint = "MessageBox", CharSet = Unicode)]
   int MessageBox(void* hWnd, wchar_t* lpText, wchar_t* lpCaption, 
                  unsigned int uType);
}

int main( )
{
   SysWin32::MessageBox(  0 , L"Hello world!", L"Greetings",  0  );
}
The main point of interest is the line of code containing DllImport. Based on the parameter values, this line of code tells the compiler to declare a function residing in the User32.dll and to treat all strings appearing in the signature (such as parameters or the return value) like Unicode strings. If the EntryPoint argument is missing, the default value is the name of the function. In addition, because the CharSet argument specifies Unicode, the common language runtime will first look for a function called MessageBoxW (W because of the Unicode specification). If the runtime does not find this function, it will then look for MessageBox and the corresponding decorated name depending on the calling convention. The only supported conventions are __cdecl and __stdcall.

When calling a function contained in a user-defined DLL, it is necessary to precede the DLL function declaration with extern "C", like this:

// The function declaration in SampleDLL.h file
extern "C" SAMPLEDLL_API int fnSampleDLL(void);
For more information on other supported parameter values, see DllImport.

...
Рейтинг: 0 / 0
BCB -> VC++7.1: unresolved external любые C++ Run-Time функции
    #32712202
Krasych
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Такая же проблема, только не задавался целью использовать WinAPI. Просто не линкуются функции стандартной библиотеки... Объясните неразумному, если разобрались, пожалуйста!!!
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / C++ [игнор отключен] [закрыт для гостей] / BCB -> VC++7.1: unresolved external любые C++ Run-Time функции
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]