User forums > Help

What does it take to compile a ^%$ MFC app?

<< < (3/4) > >>

mandrav:

--- Quote from: batagy ---One of the source file contains a reference to afxres.h, which is as far as I know (because I cannot code a single word  :oops: ) is an MFC thing. I found it on internet, that if the source doesn't contain MFC's, in that case afxres.h can be changed to winresrc.h without any problem. So I changed to it to winresrc.h, but in this case the compiling fails, so it seems there are some MFC dependent function.
--- End quote ---

If there is no other dependency on MFC except afxres.h, try putting windows.h/winresrc.h (depends on the platform).
I had it happen to me once and I actually just comented out "#include <afxres.h>" and some language-specific instructions in the resource file and everything went fine after that.

Yiannis.

batagy:

--- Quote from: mandrav ---If there is no other dependency on MFC except afxres.h, try putting windows.h/winresrc.h (depends on the platform).
I had it happen to me once and I actually just comented out "#include <afxres.h>" and some language-specific instructions in the resource file and everything went fine after that.

Yiannis.
--- End quote ---

Thanks.
When I try to compile it in its original form, CodeBlocks only highlights afxres.h. Does this means that afxres.h is the only MFC dependency?

mandrav:

--- Quote from: batagy ---Thanks.
When I try to compile it in its original form, CodeBlocks only highlights afxres.h. Does this means that afxres.h is the only MFC dependency?
--- End quote ---

I wouldn't know without looking at the log...
Read the build log carefully. It's all there ;)

Yiannis.

batagy:

--- Quote from: mandrav ---I wouldn't know without looking at the log...
Read the build log carefully. It's all there ;)

Yiannis.
--- End quote ---

Hi,

When I create a totally empty afxres.h file, and put in one of the headers folder, to following is the log of CodeBlocks:

Project   : gammu
Compiler  : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : D:\Gammu\gammu\win32\dll\
--------------------------------------------------------------------------------
Switching to target: Release
affix.c
blue_w32.c
bluetoth.c
bluez.c
devfunc.c
irda.c
ser_w32.c
gsmcomon.c
gsmstate.c
cfg.c
coding.c
md5.c
misc.c
alcatel.c
atgen.c
samsung.c
siemens.c
sonyeric.c
dct3func.c
n0650.c
n6110.c
n7110.c
n9210.c
6510cal.c
6510file.c
n6510.c
dct4func.c
n3320.c
n3650.c
nauto.c
nfunc.c
nfuncold.c
obexgen.c
pfunc.c
mroutgen.c
alcabus.c
at.c
fbus2.c
mbus2.c
phonet.c
obex.c
mrouter.c
backics.c
backldif.c
backlmb.c
backtext.c
backvcf.c
backvcs.c
gsmback.c
gsmcal.c
gsmdata.c
gsmlogo.c
gsmmisc.c
gsmnet.c
gsmpbk.c
gsmring.c
gsmems.c
gsmmulti.c
gsmsms.c
gammu.rc (20): error RC2144 : PRIMARY LANGUAGE ID not a number
gammu.rc (56): error RC2135 : file not found: VS_VERSION_INFO
gammu.rc (57): error RC2135 : file not found: 1
gammu.rc (58): error RC2135 : file not found: 1
gammu.rc (59): error RC2135 : file not found: 0x3fL
gammu.rc (65): error RC2135 : file not found: FILEOS
gammu.rc (66): error RC2135 : file not found: 0x2L
gammu.rc (69): error RC2164 : unexpected value in RCDATA
gammu.rc (71): error RC2135 : file not found: BLOCK
gammu.rc (73): error RC2135 : file not found: VALUE
gammu.rc (74): error RC2135 : file not found: VALUE
gammu.rc (75): error RC2135 : file not found: VALUE
Process terminated with status 1 (0 minutes, 41 seconds)
0 errors, 0 warnings
 
----

When I put winresrc.h or windows.h instead of afxres.h in the gammu.rc file, the following occurs:

Project   : gammu
Compiler  : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : D:\Gammu\gammu\win32\dll\
--------------------------------------------------------------------------------
Switching to target: Release
affix.c
blue_w32.c
bluetoth.c
bluez.c
devfunc.c
irda.c
ser_w32.c
gsmcomon.c
gsmstate.c
cfg.c
coding.c
md5.c
misc.c
alcatel.c
atgen.c
samsung.c
siemens.c
sonyeric.c
dct3func.c
n0650.c
n6110.c
n7110.c
n9210.c
6510cal.c
6510file.c
n6510.c
dct4func.c
n3320.c
n3650.c
nauto.c
nfunc.c
nfuncold.c
obexgen.c
pfunc.c
mroutgen.c
alcabus.c
at.c
fbus2.c
mbus2.c
phonet.c
obex.c
mrouter.c
backics.c
backldif.c
backlmb.c
backtext.c
backvcf.c
backvcs.c
gsmback.c
gsmcal.c
gsmdata.c
gsmlogo.c
gsmmisc.c
gsmnet.c
gsmpbk.c
gsmring.c
gsmems.c
gsmmulti.c
gsmsms.c
gammu.c
Linking dynamic library: .\Release\gammu.dll
ser_w32.obj : error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function _serial_open
ser_w32.obj : error LNK2019: unresolved external symbol __imp__RegEnumValueA@32 referenced in function _serial_open
ser_w32.obj : error LNK2019: unresolved external symbol __imp__RegOpenKeyExA@20 referenced in function _serial_open
.\Release\gammu.dll : fatal error LNK1120: 3 unresolved externals
Process terminated with status 1 (0 minutes, 37 seconds)
4 errors, 0 warnings
 
Now what's your opinion about this? I cannot do programming, so I don't know what it does mean.

Thanks

mandrav:

--- Quote ---Linking dynamic library: .\Release\gammu.dll
ser_w32.obj : error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function _serial_open
ser_w32.obj : error LNK2019: unresolved external symbol __imp__RegEnumValueA@32 referenced in function _serial_open
ser_w32.obj : error LNK2019: unresolved external symbol __imp__RegOpenKeyExA@20 referenced in function _serial_open
.\Release\gammu.dll : fatal error LNK1120: 3 unresolved externals
Process terminated with status 1 (0 minutes, 37 seconds)
4 errors, 0 warnings

Now what's your opinion about this? I cannot do programming, so I don't know what it does mean.
--- End quote ---

This indicates that the resource files were built. The linking failed.
Try adding advapi32.lib in your linker libraries. It should take care of the problem.

Yiannis.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version