www.digitalmars.com         C & C++   DMDScript  

c++.mfc - Compile MFC - internal error

reply "DigitalMars" <taifun mail.lt> writes:
Hi,

today I've downloaded DM ?ompiler and I'm trying to compile MFC CVS 4.21. I
use smake -f nafxcw.mak and I get the following error:.









SC -cpp -Ae -Ar -mn -o+time -NL -5 -a8 -Nc -c -H -HDNW -HO- -wx -w- -w3 -w6 
-w7 -w11 -w12 -w17 -D_X86_ -D_MT -D_MBCS=1 -I..\..\..\include -oNW\olemon.ob
j ..\olemon.cpp
Internal error: cgobj 3034
--- errorlevel 1
SMAKE fatal error: command "SC" returned with error code 1
Stopping.

Where is the problem?
Please help,
Oxy
Mar 10 2002
next sibling parent reply "Taifun" <taifun mail.lt> writes:
hm now I've downloaded mfc from /Digital_Mars_C++/MS/CVS/HEAD and there was
mfc library already, so I tried to build one of my simplest mfc app. I used
other libs from MS Platform SDK, this is what i get:

c:\Program Files\Microsoft Visual Studio\VC98\Lib\winspool.lib
 Error 43: Not a Valid Library File

Does DMC++ support any librarys from MS Platform SDK, what should I do?

 Hi,

 today I've downloaded DM ?ompiler and I'm trying to compile MFC CVS 4.21.

 use smake -f nafxcw.mak and I get the following error:.

 -w7 -w11 -w12 -w17 -D_X86_ -D_MT -D_MBCS=1 -I..\..\..\include -oNW\olemon.

 j ..\olemon.cpp
 Internal error: cgobj 3034
 --- errorlevel 1
 SMAKE fatal error: command "SC" returned with error code 1
 Stopping.

 Where is the problem?
 Please help,
 Oxy

Mar 10 2002
parent "Walter" <walter digitalmars.com> writes:
Microsoft libraries are in COFF format, not OMF, and so need to be converted
with COFF2OMF. -Walter

"Taifun" <taifun mail.lt> wrote in message
news:a6gcb4$gjs$1 digitaldaemon.com...
 hm now I've downloaded mfc from /Digital_Mars_C++/MS/CVS/HEAD and there

 mfc library already, so I tried to build one of my simplest mfc app. I

 other libs from MS Platform SDK, this is what i get:

 c:\Program Files\Microsoft Visual Studio\VC98\Lib\winspool.lib
  Error 43: Not a Valid Library File

 Does DMC++ support any librarys from MS Platform SDK, what should I do?

 Hi,

 today I've downloaded DM ?ompiler and I'm trying to compile MFC CVS


 I
 use smake -f nafxcw.mak and I get the following error:.


 -w7 -w11 -w12 -w17 -D_X86_ -D_MT -D_MBCS=1 -I..\..\..\include -oNW\olemon.
 ob
 j ..\olemon.cpp
 Internal error: cgobj 3034
 --- errorlevel 1
 SMAKE fatal error: command "SC" returned with error code 1
 Stopping.

 Where is the problem?
 Please help,
 Oxy


Mar 10 2002
prev sibling next sibling parent user domain.invalid writes:
See the c++ newsgroup. Phill had the same problem which Walter 
already solved. But I don't know whether or not the fix made it 
into the lastest available compiler.

DigitalMars wrote:

 Hi,
 
 today I've downloaded DM ?ompiler and I'm trying to compile MFC CVS 4.21. I
 use smake -f nafxcw.mak and I get the following error:.
 
 
 
 
 
 
 
 
 
 SC -cpp -Ae -Ar -mn -o+time -NL -5 -a8 -Nc -c -H -HDNW -HO- -wx -w- -w3 -w6 
 -w7 -w11 -w12 -w17 -D_X86_ -D_MT -D_MBCS=1 -I..\..\..\include -oNW\olemon.ob
 j ..\olemon.cpp
 Internal error: cgobj 3034
 --- errorlevel 1
 SMAKE fatal error: command "SC" returned with error code 1
 Stopping.
 
 Where is the problem?
 Please help,
 Oxy
 
 
 

Mar 10 2002
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
Try downloading the 8.27 beta and try it. -Walter

www.digitalmars.com/dmc/dmcppDownload.html


"DigitalMars" <taifun mail.lt> wrote in message
news:a6gap5$g1a$1 digitaldaemon.com...
 Hi,

 today I've downloaded DM ?ompiler and I'm trying to compile MFC CVS 4.21.

 use smake -f nafxcw.mak and I get the following error:.

 -w7 -w11 -w12 -w17 -D_X86_ -D_MT -D_MBCS=1 -I..\..\..\include -oNW\olemon.

 j ..\olemon.cpp
 Internal error: cgobj 3034
 --- errorlevel 1
 SMAKE fatal error: command "SC" returned with error code 1
 Stopping.

 Where is the problem?
 Please help,
 Oxy

Mar 10 2002
parent reply "Taifun" <taifun mail.lt> writes:
"Walter" <walter digitalmars.com> wrote in message
news:a6h63h$ppg$1 digitaldaemon.com...
 Try downloading the 8.27 beta and try it. -Walter

 www.digitalmars.com/dmc/dmcppDownload.html

I tried. Nothing's changed. I tried to use COFF2OMF but it converts winspool.lib to a small empty file (no declarations really), then compiler links it but of course finds unresolved symbols... I even tried to use borland's coff2omf utility wich seems to convert libs correctly, but then linker outputs this error again: Error 43: Not a Valid Library File Is there any way to use winspool.lib and shell32.lib with digital mars? Thanks.
Mar 11 2002
parent reply Christof Meerwald <cmeerw web.de> writes:
On 11 Mar 2002, Taifun wrote:
 I tried to use COFF2OMF but it converts winspool.lib to a small empty
 file (no declarations really), then compiler links it but of course
 finds unresolved symbols... I even tried to use borland's coff2omf

 Is there any way to use winspool.lib and shell32.lib with digital mars?

AFAIK, Microsoft has changed the COFF format for import libraries with Visual C++ 6.0. You have to convert the import libraries with Microsoft's link (link /lib /convert x.lib) to the old format and then you can use DM's coff2omf. bye, Christof
Mar 11 2002
next sibling parent reply "Taifun" <taifun mail.lt> writes:
"Christof Meerwald" <cmeerw web.de> wrote in message
news:a6ihv8$1ca0$1 digitaldaemon.com...
 AFAIK, Microsoft has changed the COFF format for import libraries with
 Visual C++ 6.0. You have to convert the import libraries with Microsoft's
 link (link /lib /convert x.lib) to the old format and then you can use

 coff2omf.

Thnx, for a great reply. Now I can link, but when I execute my application I get an error that winspool.dll is not found, and it's true: there's only winspool.drv. What should I do?
Mar 11 2002
parent reply "Walter" <walter digitalmars.com> writes:
"Taifun" <taifun mail.lt> wrote in message
news:a6il0d$1dtc$1 digitaldaemon.com...
 "Christof Meerwald" <cmeerw web.de> wrote in message
 news:a6ihv8$1ca0$1 digitaldaemon.com...
 AFAIK, Microsoft has changed the COFF format for import libraries with
 Visual C++ 6.0. You have to convert the import libraries with


 link (link /lib /convert x.lib) to the old format and then you can use

 coff2omf.

Thnx, for a great reply. Now I can link, but when I execute my application

 get an error that winspool.dll is not found, and it's true: there's only
 winspool.drv. What should I do?

Try renaming winspool.drv to winspool.dll. Alternatively, patch your exe file changing winspool.dll to winspool.drv.
Mar 12 2002
parent reply "Taifun" <taifun mail.lt> writes:
"Walter" <walter digitalmars.com> wrote in message
news:a6kdl1$cp6$1 digitaldaemon.com...
...
 Try renaming winspool.drv to winspool.dll. Alternatively, patch your exe
 file changing winspool.dll to winspool.drv.

Ok now I'm greally gooft: OPTLINK : Warning 134: No Start Address When I run my app it crashes of course :) Please, once again, help. I want to use DM ;) My makefile looks like this: FLAGS=-Jm -w- -Ae -o -mn -DWIN32 -D_WINDOWS -D_MBCS LIBS=user32+kernel32+shell32+winspool+NAFXCW testsdk.exe: testsdk.obj testsdkDlg.obj stdafx.obj testsdk.res link testsdk.obj+testsdkDlg.obj+stdafx.obj,,,$(LIBS),testsdk.def/RC:testsdk/noi; testsdk.obj: testsdk.cpp stdafx.obj scppn /c $(FLAGS) testsdk.cpp testsdkDlg.obj: testsdkDlg.cpp testsdk.obj scppn /c $(FLAGS) testsdkDlg.cpp stdafx.obj: stdafx.cpp makefile scppn /c $(FLAGS) stdafx.cpp testsdk.res: testsdk.rc rcc testsdk -otestsdk.res -32
Mar 12 2002
next sibling parent reply Jan Knepper <jan smartsoft.cc> writes:
 Ok now I'm greally gooft:
     OPTLINK : Warning 134: No Start Address

Try a link switches as: /CO /L /M:ADDRESS :GROUP /X /NOI /DE /DET /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512 /RC :.\<Project>.RES Are you sure you need to include WINSPOOL.LIB into your project? I've got quite a few MFC projects with DMC++, but do not recall ever having to include WINSPOOL.LIB... Jan
Mar 12 2002
parent reply "Taifun" <taifun mail.lt> writes:
"Jan Knepper" <jan smartsoft.cc> wrote in message
news:3C8DFADC.9253768A smartsoft.cc...
 Ok now I'm greally gooft:
     OPTLINK : Warning 134: No Start Address

Try a link switches as: /CO /L /M:ADDRESS :GROUP /X /NOI /DE /DET /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512 /RC :.\<Project>.RES Are you sure you need to include WINSPOOL.LIB into your project? I've got

 a few MFC projects with DMC++, but do not recall ever having to include
 WINSPOOL.LIB...

 Jan

winspool.lib links itself even when I don't. So, my application runs perfectly - thank you ALL for help! Have a nice day/night, Taifun.
Mar 12 2002
parent Jan Knepper <jan smartsoft.cc> writes:
 Yes! That was exactly the problem ( I added /ENTRY switch ;] ). BTW,
 winspool.lib links itself even when I don't.
 So, my application runs perfectly - thank you ALL for help!

Great!
 Have a nice day/night,

Still day for me... Jan
Mar 12 2002
prev sibling parent "Walter" <walter digitalmars.com> writes:
No start address usually means you have no main, winmain, or dllmain
anywhere in your program. What is the entry point for your program?

"Taifun" <taifun mail.lt> wrote in message
news:a6kl2n$fqu$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:a6kdl1$cp6$1 digitaldaemon.com...
...
 Try renaming winspool.drv to winspool.dll. Alternatively, patch your exe
 file changing winspool.dll to winspool.drv.

Ok now I'm greally gooft: OPTLINK : Warning 134: No Start Address When I run my app it crashes of course :) Please, once again, help. I want to use DM ;) My makefile looks like this: FLAGS=-Jm -w- -Ae -o -mn -DWIN32 -D_WINDOWS -D_MBCS LIBS=user32+kernel32+shell32+winspool+NAFXCW testsdk.exe: testsdk.obj testsdkDlg.obj stdafx.obj testsdk.res link

 testsdk.obj: testsdk.cpp stdafx.obj
  scppn /c $(FLAGS) testsdk.cpp

 testsdkDlg.obj: testsdkDlg.cpp testsdk.obj
  scppn /c $(FLAGS) testsdkDlg.cpp

 stdafx.obj: stdafx.cpp makefile
  scppn /c $(FLAGS) stdafx.cpp

 testsdk.res: testsdk.rc
  rcc testsdk -otestsdk.res -32

Mar 12 2002
prev sibling parent "Walter" <walter digitalmars.com> writes:
"Christof Meerwald" <cmeerw web.de> wrote in message
news:a6ihv8$1ca0$1 digitaldaemon.com...
 On 11 Mar 2002, Taifun wrote:
 I tried to use COFF2OMF but it converts winspool.lib to a small empty
 file (no declarations really), then compiler links it but of course
 finds unresolved symbols... I even tried to use borland's coff2omf

 Is there any way to use winspool.lib and shell32.lib with digital mars?

AFAIK, Microsoft has changed the COFF format for import libraries with Visual C++ 6.0. You have to convert the import libraries with Microsoft's link (link /lib /convert x.lib) to the old format and then you can use

 coff2omf.

Thanks, I'll update the coff2omf documentation.
Mar 12 2002