| title | description | ms.date | f1_keywords | helpviewer_keywords | no-loc | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Linker Tools Error LNK2019 |
All about the Microsoft Visual Studio Linker error LNK2019 and how to diagnose and correct it in C and C++ code. |
09/07/2022 |
LNK2019 |
|
|
unresolved external symbol ‘symbol‘ referenced in function ‘function‘
The compiled code for function makes a reference or call to symbol, but the linker can’t find the symbol definition in any of the libraries or object files.
This error message is followed by fatal error LNK1120. To fix error LNK1120, you must fix all LNK2001 and LNK2019 errors first.
Possible causes
There are many ways to get this error. All of them involve a reference to a function or variable that the linker couldn’t resolve, or find a definition for. The compiler can identify when a symbol isn’t declared, but it can’t tell when the symbol isn’t defined. It’s because the definition may be in a different source file or library. If a symbol is referred to but never defined, the linker generates an unresolved external symbol error.
Here are some common problems that cause LNK2019:
The source file that contains the definition of the symbol isn’t compiled
In Visual Studio, make sure the source file that defines the symbol gets compiled as part of your project. Check the intermediate build output directory for a matching .obj file. If the source file isn’t compiled, right-click on the file in Solution Explorer, and then choose Properties to check the properties of the file. The Configuration Properties > General page should show an Item Type of C/C++ Compiler. On the command line, make sure the source file that contains the definition is compiled.
The object file or library that contains the definition of the symbol isn’t linked
In Visual Studio, make sure the object file or library that contains the symbol definition is linked as part of your project. On the command line, make sure the list of files to link includes the object file or library.
The declaration of the symbol isn’t spelled the same as the definition of the symbol
Verify you use the correct spelling and capitalization in both the declaration and the definition, and wherever the symbol is used or called.
A function is used but the type or number of the parameters don’t match the function definition
The function declaration must match the definition. Make sure the function call matches the declaration, and that the declaration matches the definition. Code that invokes function templates must also have matching function template declarations that include the same template parameters as the definition. For an example of a template declaration mismatch, see sample LNK2019e.cpp in the Examples section.
A function or variable is declared but not defined
LNK2019 can occur when a declaration exists in a header file, but no matching definition is implemented. For member functions or static data members, the implementation must include the class scope selector. For an example, see Missing Function Body or Variable.
The calling convention is different between the function declaration and the function definition
Some calling conventions (__cdecl, __stdcall, __fastcall, and __vectorcall) are encoded as part of the decorated name. Make sure the calling convention is the same.
A symbol is defined in a C file, but declared without using extern "C" in a C++ file
A file that’s compiled as C creates decorated names for symbols that are different from the decorated names for the same symbols declared in a C++ file, unless you use an extern "C" modifier. Make sure the declaration matches the compilation linkage for each symbol. Similarly, if you define a symbol in a C++ file that will be used by a C program, use extern "C" in the definition.
A symbol is defined as static and then later referenced outside the file
In C++, unlike C, global constants have static linkage. To get around this limitation, you can include the const initializations in a header file and include that header in your .cpp files, or you can make the variable non-constant and use a constant reference to access it.
A static member of a class isn’t defined
A static class member must have a unique definition, or it will violate the one-definition rule. A static class member that can’t be defined inline must be defined in one source file by using its fully qualified name. If it isn’t defined at all, the linker generates LNK2019.
A build dependency is only defined as a project dependency in the solution
In earlier versions of Visual Studio, this level of dependency was sufficient. However, starting with Visual Studio 2010, Visual Studio requires a project-to-project reference. If your project doesn’t have a project-to-project reference, you may receive this linker error. Add a project-to-project reference to fix it.
An entry point isn’t defined
The application code must define an appropriate entry point: main or wmain for console applications, and WinMain or wWinMain for Windows applications. For more information, see main function and command-line arguments or WinMain function. To use a custom entry point, specify the /ENTRY (Entry-Point Symbol) linker option.
You build a console application by using settings for a Windows application
If the error message is similar to unresolved external symbol WinMain referenced in function function_name, link by using /SUBSYSTEM:CONSOLE instead of /SUBSYSTEM:WINDOWS. For more information about this setting, and for instructions on how to set this property in Visual Studio, see /SUBSYSTEM (Specify Subsystem).
You attempt to link 64-bit libraries to 32-bit code, or 32-bit libraries to 64-bit code
Libraries and object files linked to your code must be compiled for the same architecture as your code. Make sure the libraries your project references are compiled for the same architecture as your project. Make sure the /LIBPATH or Additional Library Directories property points to libraries built for the correct architecture.
You use different compiler options for function inlining in different source files
Using inlined functions defined in .cpp files and mixing function inlining compiler options in different source files can cause LNK2019. For more information, see Function Inlining Problems.
You use automatic variables outside their scope
Automatic (function scope) variables can only be used in the scope of that function. These variables can’t be declared extern and used in other source files. For an example, see Automatic (Function Scope) Variables.
You call intrinsic functions or pass argument types to intrinsic functions that aren’t supported on your target architecture
For example, if you use an AVX2 intrinsic, but don’t specify the /ARCH:AVX2 compiler option, the compiler assumes that the intrinsic is an external function. Instead of generating an inline instruction, the compiler generates a call to an external symbol with the same name as the intrinsic. When the linker tries to find the definition of this missing function, it generates LNK2019. Make sure you only use intrinsics and types supported by your target architecture.
You mix code that uses native wchar_t with code that doesn’t
C++ language conformance work that was done in Visual Studio 2005 made wchar_t a native type by default. If not all files have been compiled by using the same /Zc:wchar_t settings, type references may not resolve to compatible types. Make sure wchar_t types in all library and object files are compatible. Either update from a wchar_t typedef, or use consistent /Zc:wchar_t settings when you compile.
You get errors for *printf* and *scanf* functions when you link a legacy static library
A static library that was built using a version of Visual Studio before Visual Studio 2015 may cause LNK2019 errors when linked with the UCRT. The UCRT header files <stdio.h>, <conio.h>, and <wchar.h>now define many *printf* and *scanf* variations as inline functions. The inlined functions are implemented by a smaller set of common functions. Individual exports for the inlined functions aren’t available in the standard UCRT libraries, which only export the common functions. There are a couple of ways to resolve this issue. The method we recommend is to rebuild the legacy library with your current version of Visual Studio. Make sure the library code uses the standard headers for the definitions of the *printf* and *scanf* functions that caused the errors. Another option for a legacy library that you can’t rebuild is to add legacy_stdio_definitions.lib to the list of libraries you link. This library file provides symbols for the *printf* and *scanf* functions that are inlined in the UCRT headers. For more information, see the Libraries section in Overview of potential upgrade issues.
Third-party library issues and vcpkg
If you see this error when you’re trying to configure a third-party library as part of your build, consider using vcpkg. vcpkg is a C++ package manager that uses your existing Visual Studio tools to install and build the library. vcpkg supports a large and growing list of third-party libraries. It sets all the configuration properties and dependencies required for successful builds as part of your project.
Diagnosis tools
Sometimes it’s difficult to tell why the linker can’t find a particular symbol definition. Often the problem is that you haven’t included the code that contains the definition in your build. Or, build options have created different decorated names for external symbols. There are several tools and options that can help you diagnose LNK2019 errors.
-
The
/VERBOSElinker option can help you determine which files the linker references. This option can help you verify whether the file that contains the definition of the symbol is included in your build. -
The
/EXPORTSand/SYMBOLSoptions of the DUMPBIN utility can help you discover which symbols are defined in your .dll and object or library files. Make sure the exported decorated names match the decorated names the linker searches for. -
The UNDNAME utility can show you the equivalent undecorated external symbol for a decorated name.
Examples
Here are several examples of code that causes LNK2019 errors, together with information about how to fix the errors.
A symbol is declared but not defined
In this example, an external variable is declared but not defined:
// LNK2019.cpp // Compile by using: cl /EHsc /W4 LNK2019.cpp // LNK2019 expected extern char B[100]; // B isn't available to the linker int main() { B[0] = ' '; // LNK2019 }
Here’s another example where a variable and function are declared as extern but no definition is provided:
// LNK2019c.cpp // Compile by using: cl /EHsc LNK2019c.cpp // LNK2019 expected extern int i; extern void g(); void f() { i++; g(); } int main() {}
Unless i and g are defined in one of the files included in the build, the linker generates LNK2019. You can fix the errors by including the source code file that contains the definitions as part of the compilation. Alternatively, you can pass .obj files or .lib files that contain the definitions to the linker.
A static data member is declared but not defined
LNK2019 can also occur when a static data member is declared but not defined. The following sample generates LNK2019, and shows how to fix it.
// LNK2019b.cpp // Compile by using: cl /EHsc LNK2019b.cpp // LNK2019 expected struct C { static int s; }; // Uncomment the following line to fix the error. // int C::s; int main() { C c; C::s = 1; }
Declaration parameters don’t match the definition
Code that invokes function templates must have matching function template declarations. Declarations must include the same template parameters as the definition. The following sample generates LNK2019 on a user-defined operator, and shows how to fix it.
// LNK2019e.cpp // compile by using: cl /EHsc LNK2019e.cpp // LNK2019 expected #include <iostream> using namespace std; template<class T> class Test { // The operator<< declaration doesn't match the definition below: friend ostream& operator<<(ostream&, Test&); // To fix, replace the line above with the following: // template<typename T> friend ostream& operator<<(ostream&, Test<T>&); }; template<typename T> ostream& operator<<(ostream& os, Test<T>& tt) { return os; } int main() { Test<int> t; cout << "Test: " << t << endl; // LNK2019 unresolved external }
Inconsistent wchar_t type definitions
This sample creates a DLL that has an export that uses WCHAR, which resolves to wchar_t.
// LNK2019g.cpp // compile with: cl /EHsc /LD LNK2019g.cpp #include "windows.h" // WCHAR resolves to wchar_t __declspec(dllexport) void func(WCHAR*) {}
The next sample uses the DLL in the previous sample, and generates LNK2019 because the types unsigned short* and WCHAR* aren’t the same.
// LNK2019h.cpp // compile by using: cl /EHsc LNK2019h LNK2019g.lib // LNK2019 expected __declspec(dllimport) void func(unsigned short*); int main() { func(0); }
To fix this error, change unsigned short to wchar_t or WCHAR, or compile LNK2019g.cpp by using /Zc:wchar_t-.
See also
For more information about possible causes and solutions for LNK2019, LNK2001, and LNK1120 errors, see the Stack Overflow question: What is an undefined reference/unresolved external symbol error and how do I fix it?.
First of all, I know this question is all over this site but I have looked at almost all of them and can’t seem to find out what is wrong. This is in VS 2012. Thanks.
//Socket.h
#pragma once
#include <iostream>
#include <WinSock2.h>
using namespace std;
const int STRLEN = 256;
class Socket
{
protected:
WSADATA wsaData;
SOCKET mySocket;
SOCKET myBackup;
SOCKET acceptSocket;
sockaddr_in myAddress;
public:
Socket();
~Socket();
bool SendData( char* );
bool RecvData( char*, int );
void CloseConnection();
void GetAndSendMessage();
};
class ServerSocket : public Socket
{
public:
void Listen();
void Bind( int port );
void StartHosting( int port );
};
class ClientSocket : public Socket
{
public:
void ConnectToServer( const char *ipAddress, int port );
};
Here’s Socket.cpp
//Socket.cpp
#include "stdafx.h"
#include "Socket.h"
Socket::Socket()
{
if( WSAStartup( MAKEWORD(2, 2), &wsaData ) != NO_ERROR )
{
cerr<<"Socket Initialization: Error with WSAStartupn";
system("pause");
WSACleanup();
exit(10);
}
//Create a socket
mySocket = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
if ( mySocket == INVALID_SOCKET )
{
cerr<<"Socket Initialization: Error creating socket"<<endl;
system("pause");
WSACleanup();
exit(11);
}
myBackup = mySocket;
}
Socket::~Socket()
{
WSACleanup();
}
bool Socket::SendData( char *buffer )
{
send( mySocket, buffer, strlen( buffer ), 0 );
return true;
}
bool Socket::RecvData( char *buffer, int size )
{
int i = recv( mySocket, buffer, size, 0 );
buffer[i] = '';
return true;
}
void Socket::CloseConnection()
{
//cout<<"CLOSE CONNECTION"<<endl;
closesocket( mySocket );
mySocket = myBackup;
}
void Socket::GetAndSendMessage()
{
char message[STRLEN];
cin.ignore();//without this, it gets the return char from the last cin and ignores the following one!
cout<<"Send > ";
cin.get( message, STRLEN );
SendData( message );
}
void ServerSocket::StartHosting( int port )
{
Bind( port );
Listen();
}
void ServerSocket::Listen()
{
//cout<<"LISTEN FOR CLIENT..."<<endl;
if ( listen ( mySocket, 1 ) == SOCKET_ERROR )
{
cerr<<"ServerSocket: Error listening on socketn";
system("pause");
WSACleanup();
exit(15);
}
//cout<<"ACCEPT CONNECTION..."<<endl;
acceptSocket = accept( myBackup, NULL, NULL );
while ( acceptSocket == SOCKET_ERROR )
{
acceptSocket = accept( myBackup, NULL, NULL );
}
mySocket = acceptSocket;
}
void ServerSocket::Bind( int port )
{
myAddress.sin_family = AF_INET;
myAddress.sin_addr.s_addr = inet_addr( "0.0.0.0" );
myAddress.sin_port = htons( port );
//cout<<"BIND TO PORT "<<port<<endl;
if ( bind ( mySocket, (SOCKADDR*) &myAddress, sizeof( myAddress) ) == SOCKET_ERROR )
{
cerr<<"ServerSocket: Failed to connectn";
system("pause");
WSACleanup();
exit(14);
}
}
void ClientSocket::ConnectToServer( const char *ipAddress, int port )
{
myAddress.sin_family = AF_INET;
myAddress.sin_addr.s_addr = inet_addr( ipAddress );
myAddress.sin_port = htons( port );
//cout<<"CONNECTED"<<endl;
if ( connect( mySocket, (SOCKADDR*) &myAddress, sizeof( myAddress ) ) == SOCKET_ERROR )
{
cerr<<"ClientSocket: Failed to connectn";
system("pause");
WSACleanup();
exit(13);
}
}
And here’s stdafx.h
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here
#include "Socket.h"
And here are my error messages:
1>------ Build started: Project: Client, Configuration: Debug Win32 ------
1> stdafx.cpp
1> Socket.cpp
1> Client.cpp
1> Generating Code...
1>Socket.obj : error LNK2019: unresolved external symbol __imp__accept@12 referenced in function "public: void __thiscall ServerSocket::Listen(void)" (?Listen@ServerSocket@@QAEXXZ)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__bind@12 referenced in function "public: void __thiscall ServerSocket::Bind(int)" (?Bind@ServerSocket@@QAEXH@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function "public: void __thiscall Socket::CloseConnection(void)" (?CloseConnection@Socket@@QAEXXZ)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__connect@12 referenced in function "public: void __thiscall ClientSocket::ConnectToServer(char const *,int)" (?ConnectToServer@ClientSocket@@QAEXPBDH@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function "public: void __thiscall ServerSocket::Bind(int)" (?Bind@ServerSocket@@QAEXH@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function "public: void __thiscall ServerSocket::Bind(int)" (?Bind@ServerSocket@@QAEXH@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__listen@8 referenced in function "public: void __thiscall ServerSocket::Listen(void)" (?Listen@ServerSocket@@QAEXXZ)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function "public: bool __thiscall Socket::RecvData(char *,int)" (?RecvData@Socket@@QAE_NPADH@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__send@16 referenced in function "public: bool __thiscall Socket::SendData(char *)" (?SendData@Socket@@QAE_NPAD@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function "public: __thiscall Socket::Socket(void)" (??0Socket@@QAE@XZ)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function "public: __thiscall Socket::Socket(void)" (??0Socket@@QAE@XZ)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function "public: __thiscall Socket::Socket(void)" (??0Socket@@QAE@XZ)
1>C:Usersajayp_000documentsvisual studio 2012ProjectsClientDebugClient.exe : fatal error LNK1120: 12 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
- Remove From My Forums
-
Question
-
I am kinda new at this c++, and i am try to to make a Open GL application that when run will make a cube and rotate it on the screen. When i compile my project I get the about 21 different «LNK2019: unresolved external symbol errors». maybe some one can help me figure this out. If you need the project files I can send it too you. I am using visual studio C++ .net 2003. I also tried this code in visual 2005 and received the same thing.
the error i received are as follows:
Error Messages:
OpenGLCube.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function «void __cdecl ReSizeGLScene(int,int)» (?ReSizeGLScene@@YAXHH@Z)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function «void __cdecl ReSizeGLScene(int,int)» (?ReSizeGLScene@@YAXHH@Z)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function «void __cdecl ReSizeGLScene(int,int)» (?ReSizeGLScene@@YAXHH@Z)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function «void __cdecl ReSizeGLScene(int,int)» (?ReSizeGLScene@@YAXHH@Z)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glHint@8 referenced in function «int __cdecl InitGL(void)» (?InitGL@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glDepthFunc@4 referenced in function «int __cdecl InitGL(void)» (?InitGL@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function «int __cdecl InitGL(void)» (?InitGL@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function «int __cdecl InitGL(void)» (?InitGL@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function «int __cdecl InitGL(void)» (?InitGL@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glShadeModel@4 referenced in function «int __cdecl InitGL(void)» (?InitGL@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function «int __cdecl UpdateScene(void)» (?UpdateScene@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glVertex3f@12 referenced in function «int __cdecl UpdateScene(void)» (?UpdateScene@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glColor3f@12 referenced in function «int __cdecl UpdateScene(void)» (?UpdateScene@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function «int __cdecl UpdateScene(void)» (?UpdateScene@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glRotatef@16 referenced in function «int __cdecl UpdateScene(void)» (?UpdateScene@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glTranslatef@12 referenced in function «int __cdecl UpdateScene(void)» (?UpdateScene@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function «int __cdecl UpdateScene(void)» (?UpdateScene@@YAHXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function «void __cdecl KillGLWindow(void)» (?KillGLWindow@@YAXXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function «void __cdecl KillGLWindow(void)» (?KillGLWindow@@YAXXZ)
OpenGLCube.obj : error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function «int __cdecl InitInstance(struct HINSTANCE__ *,int,int,int)» (?InitInstance@@YAHPAUHINSTANCE__@@HHH@Z)
Debug/OpenGLCube.exe : fatal error LNK1120: 20 unresolved externals
Answers
-
Right click on your project, choose Properties. Then Linker, then Input. From these three libraries, add the ones that contain the symbols listed at the top. I would do this empirically: just add them and see if the linker errors go away.
But you can also determine the contents of the libs by using dumpbin.exe. On the command line, set the path by running either Program FilesMicrosoft Visual Studio .NET 2003Vc7binvcvars32.bat or Program FilesMicrosoft Visual Studio 8vcvcvarsall.bat
And then invoke dumpbin.exe: dumpbin.exe /exports CLU32.lib
If these import libraries contain your symbols, you’re set to go. Remember that the corresponding DLL’s must be on the path or the same directory as the executable when you run it.
Note that dumpbin.exe can also be used on the DLL’s themselves: dumpbin.exe /exports CLU32.dll
Brian
PS If you can, reedit your first post and delete the source code. It’s not relevant to the problem and makes this thread hard to read. Thanks.
-
You need to link against the OpenGL import library (something.lib). Add the name of this file to your linker settings.
-
basically whatis happening is you have to use the exact symbol that is located in your lib file, it could be a spelled wrong, also it is case sensitive.
for example:
example.lib —> contains
==================================
scope() —> symbol in lib file
create() —> symbol in lib file
pick() —> symbol in lib file
==================================whenyou use the symbol contained in the lib file.
example code:
======================================================
int main()
{
if (c > 100)
create() // referenced symbol same as what is in your lib file
// symbol referenced is case-sensitive
} // end main
=======================================================
Не могу разобраться в чем проблема… я написал небольшую програмку скомпилировал, а когда через некоторое время внес исправления и попытался исправить получил кучу ошибок:
error LNK2019: unresolved external symbol __imp__fread referenced in function «int __cdecl ReadKZU(struct _iobuf *,unsigned int *)» (?ReadKZU@@YAHPAU_iobuf@@PAI@Z)
и так 33 раза на разных функциях…
Теперь у меня ни один проект не компилится:(((…В чем проблема?
31 ответ
63
05 декабря 2006 года
Zorkus
2.6K / / 04.11.2006
Код давай. Надо с ключами линкера поколдовать, думаю:)
8.2K
05 декабря 2006 года
mohito
35 / / 24.11.2005
В прикрепленном файле код… там две функции одна другую вызывает…
P.S. сам код «корявый», но не в этом суть….
8.2K
06 декабря 2006 года
mohito
35 / / 24.11.2005
Если есть добрые люди, кому не жаль потратить полчасика… скиньте в каком-нибудь виде свои настройки проекта MSVS 2005… я подозреваю что проблема именно в настройках проекта… но никак не могу понять где именно… я уже сократил кол-во ошибок с 33 до 6… =)
240
06 декабря 2006 года
aks
2.5K / / 14.07.2006
)
Зайди в свойства проекта->C/C++ ->Code Generation -> Runtime Library
и скажи, что у тебя там стоит.
240
06 декабря 2006 года
aks
2.5K / / 14.07.2006
Кстати накой консольной программе мессаджбоксы? Неужели нельзя сообщение об ошибке тудаже в консоль и выдать?
8.2K
06 декабря 2006 года
mohito
35 / / 24.11.2005
1. В Runtime Library: Multi-threaded Debug DLL /MDd
2. Это кусок программы, я написал его как консольное приложение, но потом код вставлю в MFC проект. короче не важно, какая разница где-мессадж боксы вызывать=)
240
06 декабря 2006 года
aks
2.5K / / 14.07.2006
Поставь статический рантайм. Чтоб не было написанно DLL, и расскажи что произошло )
63
06 декабря 2006 года
Zorkus
2.6K / / 04.11.2006
mohito, а что соббсна пишет хелп про эту ошибку, можешь кинуть?
P.S. прошу прощения, но MSVS и msdn нету на машине…
8.2K
06 декабря 2006 года
mohito
35 / / 24.11.2005
Исправил Runtime Library: Multi-threaded Debug (/MTd)
Кол-во ошибок увеличилось с 6 до 31 =)…
в начале что-то вроде:
error LNK2005: «public: __thiscall std::_Locinfo::_Locinfo(char const *)…
и так раз 5
потом
LNK2019…
много раз…
8.2K
06 декабря 2006 года
mohito
35 / / 24.11.2005
Здесь пример сообщений об ошибках:
63
06 декабря 2006 года
Zorkus
2.6K / / 04.11.2006
Я спросил статью справки, F1 + click на сообщение об ошибке, статью про возможную причину, а не то что пишет компилятор.
8.2K
06 декабря 2006 года
mohito
35 / / 24.11.2005
А… Момент=)…. смотри в файле:
5.9K
07 декабря 2006 года
Zushenskiy
161 / / 29.06.2006
mohito ты какой проект создаешь?
279
07 декабря 2006 года
bave
456 / / 07.03.2004
Если ставить Code Generation: MultiThread надо чтоб все остальные линкуемые модули (написанные тобой) тоже были откомпилированы с
ключём /MT — иначе линковшик выдаёт кучу ошибок о конфликтах
LIBC и LIBCMT…
8.2K
07 декабря 2006 года
mohito
35 / / 24.11.2005
У меня простой консольный проект, из одного файла.
5.9K
07 декабря 2006 года
Zushenskiy
161 / / 29.06.2006
Выложи проект либо содиржимое файла vcproj
8.2K
07 декабря 2006 года
mohito
35 / / 24.11.2005
Вот vsproj:
63
07 декабря 2006 года
Zorkus
2.6K / / 04.11.2006
Попробуй ключи линкера (свойства проекта, общие, линкер, ком. строка, как-то так) /FORCE , /Zc:wchar_t- .
8.2K
07 декабря 2006 года
mohito
35 / / 24.11.2005
Ага… добавление в Linker->ComandLine опции /FORCE позволило снять ошибку 2019…. теперь прога компилируется(и линкуется) но при запуске выдает: ненайден библиотека MSVCP60D.dll =)… И прикол в том что у меня её нет=) (я искал везде)
63
07 декабря 2006 года
Zorkus
2.6K / / 04.11.2006
http://intercomp.net.ru/dll/m.php?page=82
там нужные либы есть, но все таки почитай подробнее про ключ /FORCE, он ведь многое ставит в игнор, с ним лучше осторожно (хотя, иногда,мне кажется, только он и спасает:))
8.2K
07 декабря 2006 года
mohito
35 / / 24.11.2005
Да, походу /FORCE — сильная штука=)… Т.к. я сумел скомпилировать, но ткпкрь при попытке открыть файл (fopen) уменя возникает Exception (Исключение) =))) (я не вносил изменений в код.. который когда-то запускался=) )… Должен же быть способ кроме как все «зафорсить»?… Или Винду переустанавливать??? (студию переустанавливал трижды… не помогло)
63
07 декабря 2006 года
Zorkus
2.6K / / 04.11.2006
какой именно exception?
5.9K
08 декабря 2006 года
Zushenskiy
161 / / 29.06.2006
твой vcproj настроен нормально. походу проблемы либо с виндой либо со студией. линковщик неможет найти подходящие либы. проверь настройки и переменные окружения самой студии. и погоняй свой комп на инородные прожки типа вирусы.
63
08 декабря 2006 года
Zorkus
2.6K / / 04.11.2006
линковщик неможет найти подходящие либы. проверь настройки и переменные окружения самой студии. и погоняй свой комп на инородные прожки типа вирусы.
Надо скачать dll-ку и кинуть в каталог где храняться dll -ки VS, или в system32, хидер к ней как я понимаю, есть (или он не нужен), а lib — файл для либы можно самому сделать, если надо, точно не скажу как утилитка из VS называется, implib вроде бы, и бросить его туда где все остальные находятся у студии, вот и вся настройка линкера ( это в общем, для абстрактной dll, а для динамически загр. вроде твоей нужна только сама dll и все).
Переменные окружения должны при установке ставиться сами, а вирусы — так с этого надо было начинать;)
8.2K
09 декабря 2006 года
mohito
35 / / 24.11.2005
Проблема решена… Сносом Винды и полной переустановкой системы=))).
Всем МЕГА спасибо за участие в топике…
63
09 декабря 2006 года
Zorkus
2.6K / / 04.11.2006
Проблема решена… Сносом Винды и полной переустановкой системы=))).
Это называется «решена»?:) Ты скажи, стало работать нормально, или нет? И какая именно была ошибка неустранимая? Я из твоего описания не понял.
8.2K
09 декабря 2006 года
mohito
35 / / 24.11.2005
Решана — значит ошибка больше не возникает…. После переустановки Windows и Visual Studio, соответствено все проекты стали нормально компилироваться…
Я предпологаю что проблема все таки была связана с вирусом Nashta (или что-то наподобе) который я обнаружил мой антивирус и по его(антивируса) заявлению успешно удалил…
8.2K
13 декабря 2006 года
mohito
35 / / 24.11.2005
Я нашел в чем была проблема!
Вчера запустил Студию и опять вылетела ошибка 2019…. я думал я комп разнесу=)
Потом стал прикидывать от чего это… и вспомнил… за 2 часа до этого установил себе IFS Development Kit for Windows XP и прописал в настройках Visual Studio пути к папакам Inc и Lib из DDK… и эти папки были первыми по порядку… видимо он вних пытался искать и нефига не находил=)
63
13 декабря 2006 года
Zorkus
2.6K / / 04.11.2006
Сказал бы сразу:)
