> *. Lib files cannot be generated.
Symptom:
The *. Lib file is not generated for a newly generated DLL.
Solution:
The reason is that no symbol is exported. either explicitly specify a *. Def file or "_ declspec (dllexport)" is required )"
Therefore, smcp_dll or *. Def file is required.
-----------------------------------------------------------------
# Ifdef smcp_dll
# Ifdef smcpdecl_app_qtwidgets
# Define export_app_qtwidgets _ declspec (dllexport)
# Else
# Define export_app_qtwidgets _ declspec (dllimport)
# Endif
# Else
# Define export_app_qtwidgets
# Endif
-----------------------------------------------------------------
In the linker-> advanced property Tab Of the DLL project, verify that the value for import library (. lib file you are looking for) is correct/reasonable. the value of this property will determine what the import library is named, and where the linker will write it.
You may also need to generate an imports definition file (. def) in your project, or check your header files and make sure your exported functions are tagged with the _ declspec (dllexport) qualifier in the header file. this is usually toggled by a # define such:
#ifdef MYAPI_EXPORTS #define MYAPI_API __declspec(dllexport) #else #define MYAPI_API __declspec(dllimport) #endif void MYAPI_API foo(int bar);
Basically you want the compiler to see dllexport when it is building the library, but dllimport when your client code is # including the header file. if Visual Studio generated the basic project structure, it probably already created a suitable # define to use.
You do not have to both create the. Def file and add the dllexport, just one or the other.I prefer the latter. Also, if you choose to use a. Def file, you need to specify it in the linker PROPERTIES OF YOUR library project.
> Targe machine shocould be changed
Set "target machine": machinex64 (/machine: x64)
> Materials
Optimization of 64 bit programs
Http://www.codeproject.com/Articles/33565/Optimization-of-64-bit-programs
20 issues of porting C ++ code on the 64-bit Platform
Http://www.codeproject.com/Articles/18855/20-issues-of-porting-C-code-on-the-64-bit-platform
Lessons on development of 64-bit C/C ++ applications
Http://www.codeproject.com/Articles/359970/Lessons-on-development-of-64-bit-C-Cplusplus-appli