Topics / Index
The Compiler MS Visual C++ Version 5
Content (automatic)
- #content : Content (automatic)
- #installation : Installation
- #new : Creating a new workspace for a new main program
- #includes : Include directories
- #daoinst : Installation of DAO
- #linker : The linker error Symbol __endthreadex und __beginthreadex not resolved
- #linker2 : The linker finds the symbols new and delete twice
- #linker2 : See also
- #www : www
Installation
When installint the Version 5 compiler, then confirm all predefined
settings.
After installation add the include
direcory C:\HOME\CC\INCLUDE, where are my
header files.
Before linking internet applicatons, which use the socket library
wsock32.lib,
execute C:\HOME\CC\MDOS50.BAT. By this
drive K: will be substituted as K: => C:\PROGRA~1\DEVSTU~1
Creating a new workspace for a new main program
Main programs are usually in
C:\HOME\CC\UTIL or
C:\HOME\CC\HTMUTIL or
C:\HOME\CC\QQ
For programs which do not use graphics use the Menu [Datei]
[Neu] [Projekte]
- Select [Win32 Console Appplication]
- Select as "Pfad" C:\HOME\CC\UTIL\MDOS50
- Enter as "Projektname" the name of the main programs file. e.g.
HEME
- Click Button [OK]
For programs which do use graphics use the Menu [Datei] [Neu]
[Projekte]
- Select [Win32 Appplication]
- Select as "Pfad" C:\HOME\CC\UTIL\MSVC50
- Enter as "Projektname" the name of the main programs file. e.g.
GRA2
- Click Button [OK]
This will create a subdirectory C:\HOME\CC\UTIL\MDOS50\HEME resp.
C:\HOME\CC\UTIL\MSVC50\GRA2 and in it the workspace file
and the subdirectories DEBUG and RELEASE.
Then add to this empty project [Projekt] [Dem Projekt
hinzufügen...]
the file heme.cpp
Then build the project. You will get a lot of undefined references
(externals)
Find the source file in C:\HOME\CC\LQ\*.cpp which satisfies the
references. The menu [Bearbeiten] [Suche in Dateien...] may help you
with this.
Before you run the program, select a working dorectory in [Projekt]
[Einstellungen...]
Include directories
C:\Programme\DevStudio\VC\INCLUDE
C:\Programme\DevStudio\VC\MFC\include
C:\Programme\DevStudio\VC\ATL\include
c:\msdev\include
c:\msdev\mfc\include
C:\Programme\DevStudio\SharedIDE\bin\%include%
C:\HOME\CC\INCLUDE
required standard libraries are (from K:\VC\LIB)
wsock32.lib
libc.lib oldnames.lib kernel32.lib
and for mfc application koppsend :
copy kernel32.lib ..\lib
copy user32.lib ..\lib
copy gdi32.lib ..\lib
copy winspool.lib ..\lib
copy comdlg32.lib ..\lib
copy advapi32.lib ..\lib
copy shell32.lib ..\lib
copy ole32.lib ..\lib
copy oleaut32.lib ..\lib
copy uuid.lib ..\lib
copy odbc32.lib ..\lib
copy odbccp32.lib ..\lib
copy wsock32.lib ..\lib
copy libc.lib ..\lib
copy libcmt.lib ..\lib
copy libcd.lib ..\lib
copy comctl32.lib ..\lib
copy OLDNAMES.lib ..\lib
copy WININET.LIB ..\lib
copy libcpmt.lib ..\lib
In [Projekt] [Einstellungen] [Linker] are :
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib wsock32.lib libcpmt.lib oldnames.lib comctl32.lib
wininet.lib libcd.lib
Installation of DAO
Requires for Samples\DAOREAD as well the installation of an ISAM
drivers as
The linker error Symbol __endthreadex und __beginthreadex not
resolved
If this occurs then :
- show the work space.
- remove one of the source files
- undo this by Control Z
- Then press F7 - and be happy :-))
- or define the two routines :
extern "C" {
_CRTIMP unsigned long __cdecl _beginthreadex(void *p1, unsigned a,
unsigned (__stdcall *) (void *pj), void *p2, unsigned b, unsigned *pc)
{
return 0 ;
}
_CRTIMP void __cdecl _endthreadex(unsigned a)
{
return ;
}
} ;
The linker finds the symbols new and delete twice
nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) bereits in LIBCD.lib(new.obj) definiert
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) bereits in LIBCD.lib(dbgdel.obj) definiert
Action: define an additional library in [Project] [Settings] [Linker]
[Object-/Library modules] : nafxcwd.lib
_MT,_AFX_NO_DEBUG_CRT
See also
www
http://hubbard.engr.scu.edu/embedded/avr/msvc_make/msvc_make.html -
Configuring Microsoft Visual C++ for use with an external compiler