how to fix fatal error LNK1120: 5 unresolved externals

1,123 views
Skip to first unread message

richa

unread,
Apr 23, 2008, 5:23:45 AM4/23/08
to CLIPSESG
Hi ,
I am creating a new project using clips.This is my code :

#include "stdio.h"
#include "clips.h"
void iniz()
{
void InitializeEnvironment ();
Load ("rpm.clp");
Reset ();
Run(-1L);
}

My Project settings are :

C/C++ ->General->Additional Include Directories:-

C:\Documents and Settings\Richa\Desktop\ClipsCheck\Source\CLIPS
C:\Documents and Settings\Richa\Desktop\ClipsCheck\Source\Interface
..............................................................................................................................
Linker ->General->Additional Library Directories:-

"C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib"

Linker ->Input->Additional Dependencies:-

odbc32.lib odbccp32.lib comctl32.lib
...............................................................................................................................
But when i am building this ,getting following errors...

1>main.obj : error LNK2001: unresolved external symbol
_GetCurrentEnvironment
1>main.obj : error LNK2001: unresolved external symbol _EnvReset
1>main.obj : error LNK2001: unresolved external symbol _EnvLoad
1>main.obj : error LNK2001: unresolved external symbol _EnvRun
1>MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol
_WinMain@16
1>C:\Documents and Settings\Richa\Desktop\ClipsCheck\Release
\ClipsCheck.exe : fatal error LNK1120: 5 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\Richa
\Desktop\ClipsCheck\Release\BuildLog.htm"
1>ClipsCheck - 6 error(s), 0 warning(s)

How can I fix this error?What are the causes for this type of error?

CLIPS Support

unread,
Apr 23, 2008, 12:24:15 PM4/23/08
to CLIPSESG
Did you include the CLIPS source files (the one's ending in .c) to
your project?

richa

unread,
Apr 24, 2008, 12:25:03 AM4/24/08
to CLIPSESG
Ok.
After adding all Source files these errors are occurring

MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol
_WinMain@16
1>C:\Documents and Settings\Richa\Desktop\ClipsCheck\Release
\ClipsCheck.exe : fatal error LNK1120: 1 unresolved externals

How to fix this.Though i m giving the right path of LIB

richa

unread,
Apr 24, 2008, 2:17:37 AM4/24/08
to CLIPSESG
I added WinMain also from Interface but prompt is not working.But
previous error is solved.

Tell me that how can i pass the Output of CLIPS Rules project to any C
Project?
How to link between them so that my C Project takes the Output of
CLIPS as its INPUT?

CLIPS Support

unread,
Apr 24, 2008, 12:09:54 PM4/24/08
to CLIPSESG
Don't add the source files for the Windows interface, just the CLIPS
source files. Refer to section 2 of the Advanced Programming Guide for
which files belong to CLIPS.
Reply all
Reply to author
Forward
0 new messages