Discussions related to Visual Prolog
mdosnov2016
VIP Member
Posts: 73
Joined: 19 Nov 2016 7:58

linker errors: symbol redefinition in file ...

Unread post by mdosnov2016 »

Hello,
I get a lot of link errors like " symbol redefinition in file ..." and although the project compiles I cannot build it.
Can anybody help?
sample:
Type Action Description Filename Path
e2528 Error 2528: 'Symbol redefinition in file 'Obj\main.789E136F.obj': '?newEx$@outputStreamSupport@@SAXQAV1@@QAVoutputStreamSupportSite@@@PAUmode_struct@stream@@X@Z' (see 'Obj\outputstreamsupport.6F229CFB.obj') symbol redefinition in file
PrologUser
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: linker errors: symbol redefinition in file ...

Unread post by Harrison Pratt »

Yes, in both 7.5 and 8.01. What seems to work is to Remove from Project the offending package and add it back again after completely closing and reopening the IDE and rebuilding the project as much as possible. I remember that just closing/reopening the IDE helps, but only rarely. I don't know what causes this, but suspect that it happens when I move a class to another package.
mdosnov2016
VIP Member
Posts: 73
Joined: 19 Nov 2016 7:58

Re: linker errors: symbol redefinition in file ...

Unread post by mdosnov2016 »

All I 've done is adding the following:

Code: Select all

monitor class log properties     logStream : outputStream. predicates     write : (...). end class log
in my main.pro file and have the following in the main.pack:

Code: Select all

#include @"main.ph" % privately used packages #include @"pfc\stream\outputStreamSupport\outputStreamSupport.ph" #include @"pfc\std\std.ph" #include @"pfc\multiThread\multiThread.ph" #include @"pfc\console\console.ph" #include @"pfc\binary\binary.ph" #include @"pfc\core.ph" #include @"pfc\exception\exception.ph" #include @"pfc\list\list.ph" #include @"pfc\math\math.ph" #include @"pfc\memory\memory.ph" #include @"pfc\memory\segmented\segmented_utf16\segmented_utf16.ph" #include @"pfc\stream\inputStreamSupport\inputStreamSupport.ph" #include @"pfc\fileSystem\fileSystem.ph" #include @"pfc\memory\segmented\segmented.ph" #include @"pfc\memory\segmented\segmentedSupport\segmentedSupport.ph" #include @"pfc\presenter\presenter.ph" #include @"pfc\stream\stream.ph" #include @"pfc\string\string.ph" #include @"pfc\windowsApi\fileSystem_api\fileSystem_api.ph" #include @"pfc\windowsApi\memory_api\memory_api.ph" #include @"pfc\windowsApi\Shell_api\Shell_api.ph" #include @"pfc\windowsApi\string_api\string_api.ph" #include @"pfc\windowsApi\string8_api\string8_api.ph" #include @"pfc\windowsApi\systemInformation_api\systemInformation_api.ph" #include @"pfc\windowsApi\time_api\time_api.ph" #include @"pfc\windowsApi\windowsAPI.ph" #include @"pfc\windowsApi\WinErrors\WinErrors.ph" % private interfaces % private classes % implementations #include @"pfc\stream\outputStreamSupport\outputStreamSegmentedSupport.pro" #include @"pfc\stream\outputStreamSupport\outputStreamSupport.pro" #include @"pfc\fileSystem\directory.pro" #include @"pfc\fileSystem\file.pro" #include @"pfc\fileSystem\filename.pro" #include @"pfc\fileSystem\fileSystem_exception.pro" #include @"pfc\fileSystem\fileVersion.pro" #include @"pfc\fileSystem\inputStream_file.pro" #include @"pfc\fileSystem\messageFile.pro" #include @"pfc\fileSystem\outputStream_file.pro" #include @"main.pro"
which one of all shall I remove and add again and how exactly?
PrologUser
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: linker errors: symbol redefinition in file ...

Unread post by Harrison Pratt »

Are you using 7.5 or 8.0 ?

What happens if you remove monitor class log from your project?
mdosnov2016
VIP Member
Posts: 73
Joined: 19 Nov 2016 7:58

Re: linker errors: symbol redefinition in file ...

Unread post by mdosnov2016 »

how do I remove monitor class log ?
can you point it out because I cannot see it anywhere in the project.
Michael
PrologUser
mdosnov2016
VIP Member
Posts: 73
Joined: 19 Nov 2016 7:58

Re: linker errors: symbol redefinition in file ...

Unread post by mdosnov2016 »

I am using commercial 8 edition
PrologUser
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: linker errors: symbol redefinition in file ...

Unread post by Harrison Pratt »

I thought that monitor class log was something you created--I couldn't find it by grepping the Visual Prolog 8 installation directory and subdirectories.

A few days ago I had a project (fortunately a small one for exploring VIP8) that was munged by invoking Optimal Set of Include Directories. To sort it out I built a new project and used a 'diff' tool to compare files in the two projects. The problem there was in main.pack You might try that approach to see if you can puzzle out what happened ... I wish I'd kept notes on that problem.

Variations of that symbol redefinition problem are not a rare ones for me. I'll try to document it next time it occurs instead of just tweaking it out of existence and forgetting about it.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Re: linker errors: symbol redefinition in file ...

Unread post by Thomas Linder Puls »

You should remove all the includes of pfc\...\...pro files from your pack file. It is wrong to include such files.
Regards Thomas Linder Puls
PDC
Post Reply