User forums > Help
Code won't link using Microsoft Visual C++ 6
stahta01:
Please give me the steps you used to generate the "Hello World" code, it could be a bug in the code.
Tim S
JackDriver:
Hi Tim,
The steps I took were:
1. Downloaded CB and installed on my PC
2. Configured Microsoft Visual C++ V6 as the default compiler, setting options as req'd under Settings->Compiler and debugger including "Full command line" logging.
3. Created a new project using File->New->Project and followed the Wizard steps:
Console Application,
C++, Project title=hello, Folder=c:\tmp,
Complier = Microsoft Visual C++ V6,
Create "Debug" configuration: Ouput Dir = bin\Debug, Objects output dir = obj\Debug
Create "Release" configuration: Ouput Dir = bin\Release, Objects output dir = obj\Release
Multi-threaded Dynamic CRT mode
4. Used the "Build" toolbar button to compile and link
The result was that the code compiled (object files were created) but not linked (no .exe created) and the message "Nothing to be done" in the log window following the linker command.
stahta01:
--- Quote from: JackDriver on March 12, 2008, 03:43:39 am ---3. Created a new project using File->New->Project and followed the Wizard steps:
Console Application,
C++, Project title=hello, Folder=c:\tmp,
Complier = Microsoft Visual C++ V6,
Create "Debug" configuration: Ouput Dir = bin\Debug, Objects output dir = obj\Debug
Create "Release" configuration: Ouput Dir = bin\Release, Objects output dir = obj\Release
Multi-threaded Dynamic CRT mode
4. Used the "Build" toolbar button to compile and link
The result was that the code compiled (object files were created) but not linked (no .exe created) and the message "Nothing to be done" in the log window following the linker command.
--- End quote ---
Here's my build log
--- Code: ----------------- Build: Debug in hello ---------------
cl.exe /nologo /W3 /EHsc /Zi /D_DEBUG /MDd /I"C:\Program Files\Microsoft Visual Studio\VC98\ATL\Include" /I"C:\Program Files\Microsoft Visual Studio\VC98\Include" /I"C:\Program Files\Microsoft Visual Studio\VC98\MFC\Include" /c main.cpp /Foobj\Debug\main.obj
main.cpp
link.exe /nologo /LIBPATH:"C:\Program Files\Microsoft Visual Studio\VC98\Lib" /LIBPATH:"C:\Program Files\Microsoft Visual Studio\VC98\MFC\Lib" /out:bin\Debug\hello.exe msvcrtd.lib msvcprtd.lib obj\Debug\main.obj /DEBUG
LINK : LNK6004: bin\Debug\hello.exe not found or not built by the last incremental link; performing full link
Output size is 28.08 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End code ---
The exe was created in bin\Debug sub-folder and runs under C::B and from CMD window.
Are you running SP6?
Checking NMAKE version seems the best, mine is 6.00.9782.0
--- Code: ---C:\Program Files\Microsoft Visual Studio\VC98\Bin>CALL "C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat"
Setting environment for using Microsoft Visual C++ tools.
C:\Program Files\Microsoft Visual Studio\VC98\Bin>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
C:\Program Files\Microsoft Visual Studio\VC98\Bin>NMAKE.EXE
Microsoft (R) Program Maintenance Utility Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.
--- End code ---
Tim S
JackDriver:
Hi Tim,
Yes I am running SP6 for VC6 and have checked the nmake version which is identical to yours. If I run the linker command as logged from a DOS cmd window in the project directory then the link occurs correctly.
I have just deleted the entire projct and regenerated it as before with the same results. Below is the contents of the hello.cbp file:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="hello" />
<Option pch_mode="2" />
<Option compiler="microsoft_visual_c_6" />
<Build>
<Target title="Debug">
<Option output="bin\Debug\hello" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option type="1" />
<Option compiler="microsoft_visual_c_6" />
<Compiler>
<Add option="/Zi" />
<Add option="/D_DEBUG" />
<Add option="/MDd" />
</Compiler>
<Linker>
<Add option="/DEBUG" />
<Add library="msvcrtd.lib" />
<Add library="msvcprtd.lib" />
</Linker>
</Target>
<Target title="Release">
<Option output="bin\Release\hello" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option type="1" />
<Option compiler="microsoft_visual_c_6" />
<Compiler>
<Add option="/Ox" />
<Add option="/DNDEBUG" />
<Add option="/MD" />
</Compiler>
<Linker>
<Add library="msvcrt.lib" />
<Add library="msvcprt.lib" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="/W3" />
<Add option="/EHsc" />
</Compiler>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
What I am wanting to know is why "Nothing to be done" is reported. Does CB produce this or is it an output from the linker?
Cheers,
Joseph
stahta01:
Basic question, are you doing build or rebuild?
And, is it project or workspace?
Build
Rebuild
build workspace
Rebuild workspace
What happens if you do "run" ?
Tim S
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version