Project

General

Profile

Bug #515

Unresolved external symbol strcasecmp in windows

Added by Kyle Beauchamp over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

I can't build under windows (See log below) because we are calling strcasecmp--a function that does not exist in windows (see http://osdir.com/ml/voip.sipx.devel/2006-09/msg00108.html).

I think the problem is that people are calling strcasecmp instead of gmx_strcasecmp. I'm still trying to figure out how many places this occurs. I'll post more when I get a fix.

Here are the error messages, which gives some idea of the various places this is happening. I think a similar thing is happening with strncasecmp.

3>------ Build started: Project: mdrun, Configuration: Release x64 ------
3>Linking...
3>gmx.lib(index.obj) : error LNK2019: unresolved external symbol strcasecmp referenced in function add_grp
3>gmx.lib(strdb.obj) : error LNK2001: unresolved external symbol strcasecmp
3>gmx.lib(pdbio.obj) : error LNK2001: unresolved external symbol strcasecmp
3>gmx.lib(wman.obj) : error LNK2001: unresolved external symbol strcasecmp
3>gmx.lib(atomprop.obj) : error LNK2001: unresolved external symbol strcasecmp
3>gctio.obj : error LNK2001: unresolved external symbol strcasecmp
3>gmx.lib(filenm.obj) : error LNK2001: unresolved external symbol strcasecmp
3>gmx.lib(checkpoint.obj) : error LNK2001: unresolved external symbol strcasecmp
3>gmx.lib(tpxio.obj) : error LNK2001: unresolved external symbol strcasecmp
3>gmx.lib(xvgr.obj) : error LNK2019: unresolved external symbol strncasecmp referenced in function xvgrstr
3>gmx.lib(futil.obj) : error LNK2001: unresolved external symbol strncasecmp
3>gmx.lib(pargs.obj) : error LNK2001: unresolved external symbol strncasecmp
3>gmx.lib(index.obj) : error LNK2001: unresolved external symbol strncasecmp
3>C:\FAH\gromacs-build-aug22-64-notfah\src\kernel\Release\mdrun.exe : fatal error LNK1120: 2 unresolved externals

index.c (26.8 KB) index.c Fixed index.c Kyle Beauchamp, 08/22/2010 10:19 PM
strdb.c (4.27 KB) strdb.c fixed strdb.c Kyle Beauchamp, 08/22/2010 10:20 PM
pdbio.c (22.1 KB) pdbio.c fixed pdbio.c Kyle Beauchamp, 08/22/2010 10:22 PM
patches.diff (9.19 KB) patches.diff Patches Kyle Beauchamp, 08/22/2010 10:29 PM

History

#1 Updated by Kyle Beauchamp over 9 years ago

In file Index.c, function static void analyse_prot

lines 386:

if (strcasecmp(chains[i][j],atnm) == 0)
match=TRUE;
} else {
if (strncasecmp(chains[i][j],atnm,strlen(chains[i][j])) == 0)
match=TRUE;

line 414: if (strcasecmp(chains[i][j],*atoms->atomname[n]) == 0)

#2 Updated by Kyle Beauchamp over 9 years ago

Created an attachment (id=519)
Fixed index.c

#3 Updated by Kyle Beauchamp over 9 years ago

Created an attachment (id=520)
fixed strdb.c

#4 Updated by Kyle Beauchamp over 9 years ago

Created an attachment (id=521)
fixed pdbio.c

#5 Updated by Kyle Beauchamp over 9 years ago

Created an attachment (id=522)
Patches

#6 Updated by Kyle Beauchamp over 9 years ago

I made all of the necessary changes to get gromacs to build on windows. I replaced strcasecmp with gmx_strcasecmp and strncasecmp with gmx_strncasecmp in several files.

I did a git diff > patches.diff and attached the file. Let me know if there's a better way to send the patches.

Please note that my changes also have some changes regarding the previous bug 514.

#7 Updated by Erik Lindahl over 9 years ago

Hi Kyle!

Thanks, but I've already committed a change that does it - commit 2bc778da28f973191b0eaa3792c272445dfff7e7.

This is all due to a header change earlier today, to avoid the dependence on config.h. If you give me 15-20 minutes I'll try a windows build myself and see if there is anything else before I close this thread. If you find more stuff you can add it here.

#8 Updated by Erik Lindahl over 9 years ago

Windows should now build fine, so I'm closing this bugzilla, but there could still be some bugs...

Also available in: Atom PDF