Invalid or Corrupt File Cannot Read at

Author Bulletin Jacek Jablonski


PostPosted: Visual C++ General, linking problems (invalid or corrupt file) Top

Hello experts!
I was testing compilation programs with dlls. And then I have created uncomplicated dll with header:
int sum(int size)
{
return size*two;
}

And I have compiled it. I accept also created unproblematic panel application using this library. In project options I have added headers path and libs path, but I have linking errors:

Linking... C:\Documents and Settings\Jacek\Moje dokumenty\Visual Studio 2005\Projects\mylib\release\mylib.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x278

Please assist, I don't understand this error and I don't know what to do.
Greetings

Visual C++12

  Peter Ritchie


PostPosted: Visual C++ General, linking problems (invalid or corrupt file) Top

Are y'all using Visual C++ 2003 or 2005.

If 2005, effort right clicking the mylib project in the solution explorer and selecting "clean", or (if 2003) try a rebuild of the solution. If y'all still accept the same trouble, post the build output and someone might be able to offer the guidance.

Jacek Jablonski


PostPosted: Visual C++ Full general, linking problems (invalid or corrupt file) Top

I am using VS 2005. After cleaning, problem still remains.
------ Build started: Projection: center, Configuration: Release Win32 ------
Compiling...
stdafx.cpp
Compiling...
test.cpp
Linking...
C:\Documents and Settings\Jacek\Moje dokumenty\Visual Studio 2005\Projects\mylib\release\mylib.dll : fatal error LNK1107: invalid or decadent file: cannot read at 0x278
Build log was saved at "file://c:\Documents and Settings\Jacek\Moje dokumenty\Visual Studio 2005\Projects\test\examination\Release\BuildLog.htm"
test - 1 error(s), 0 alarm(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-engagement, 0 skipped ==========

Peter Ritchie


PostPosted: Visual C++ General, linking bug (invalid or decadent file) Top

I don't see anywhere in your build log that mylib is being built.
Jacek Jablonski


PostPosted: Visual C++ General, linking problems (invalid or corrupt file) Acme

Mylib is build in other project. Here is log:
------ Build started: Projection: mylib, Configuration: Release Win32 ------
Compiling...
stdafx.cpp
Compiling...
mylib.cpp
Linking...
Generating lawmaking
Finished generating code
Creating manifest...
Build log was saved at "file://c:\Documents and Settings\Jacek\Moje dokumenty\Visual Studio 2005\Projects\mylib\mylib\Release\BuildLog.htm"
mylib - 0 mistake(due south), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 upwardly-to-date, 0 skipped ==========

Peter Ritchie


PostPosted: Visual C++ General, linking bug (invalid or corrupt file) Pinnacle

Your middle project seems to be looking for the mylib dll in a unlike directory than the one it was built to. middle is lament about "C:\Documents and Settings\Jacek\Moje dokumenty\Visual Studio 2005\Projects\mylib\release\mylib.dll" but information technology appears mylib is being output to "c:\Documents and Settings\Jacek\Moje dokumenty\Visual Studio 2005\Projects\mylib\mylib\Release\".

You might desire remove the reference to mylib.dll and re-add it.

Jacek Jablonski


PostPosted: Visual C++ General, linking problems (invalid or corrupt file) Top

Afterward changing that, still the same error.

Peter Ritchie


PostPosted: Visual C++ General, linking problems (invalid or decadent file) Elevation

With assemblies that are decadent or invalid, you should get warnings in the error listing when you lot load your solution/projection. If a referenced DLL is invalid you should also see an assertion warning sign on the icon for the item reference in the solution explorer References branch. Do you get either of those when y'all load your solution
Jacek Jablonski


PostPosted: Visual C++ General, linking issues (invalid or decadent file) Top

I am doing that in this way: I ma creating very very unproblematic dll file. Than I create new project and to this project I add together header file from this dll. In project options I set additional LIB paths, so linker can find this dll.

References branch is empty.O_o


Louis Lafreniere


PostPosted: Visual C++ General, linking bug (invalid or decadent file) Elevation

The problem is that you are trying to link the dll directly to your awarding. An import lib (mylib.lib) should accept been created when you linked the dll. That's the file y'all need to link in, not mylib.dll. That lib will cause your exe to load to your dll at runtime.

-- Louis Lafreniere

Jacek Jablonski


PostPosted: Visual C++ General, linking problems (invalid or decadent file) Top

Unfortunatelly, there is no mylib.lib file in project directory. I am creating dlls in ii means.
ane manner: new project-> panel application than in projection options I set dll.
2 way: new project-> console awarding and there I prepare dll.
Neither of these methods makes mylib.lib file.

Peter Ritchie


PostPosted: Visual C++ General, linking bug (invalid or corrupt file) Top

If y'all desire to generate a lib file for you lot mylib projection, brand sure that "Import Library" is non empty in Project Properties/Linker/Advanced.

Usually this is set to $(TargetDir)$(TargetName).lib.

Jacek Jablonski


PostPosted: Visual C++ General, linking problems (invalid or corrupt file) Top

It is prepare.
But command line doesn't contains /IMPLIB

/OUT:"C:\Documents and Settings\Jacek\Moje dokumenty\Visual Studio 2005\Projects\ezio\Release\ezio.dll" /INCREMENTAL:NO /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"Release\ezio.dll.intermediate.manifest" /DEBUG /PDB:"c:\documents and settings\Jacekszefu\moje dokumenty\visual studio 2005\projects\ezio\release\ezio.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /Motorcar:X86 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib


Louis Lafreniere


PostPosted: Visual C++ General, linking problems (invalid or corrupt file) Height

In that location seems to be a bug in the property canvass... Get to the implib setting and touch the implib name (add a infinite at the end). When I tried that, the /IMPLIB appeared on the link command line.

-- Louis Lafreniere

Jacek Jablonski


PostPosted: Visual C++ General, linking bug (invalid or decadent file) Meridian

.lib file stil doesn't want to appear. But /IMPLIB appeared on the link command line:
/OUT:"C:\Documents and Settings\Jacek\Moje dokumenty\Visual Studio 2005\Projects\mylibrary\Release\mylibrary.dll" /INCREMENTAL:NO /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"Release\mylibrary.dll.intermediate.manifest" /DEBUG /PDB:"c:\documents and settings\szefu\moje dokumenty\visual studio 2005\projects\mylibrary\release\mylibrary.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /IMPLIB:"c:\documents and settings\Jacek\moje dokumenty\visual studio 2005\projects\mylibrary\release\mylibrary.lib" /Car:X86 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib

stevensrhisfor.blogspot.com

Source: http://databaseforum.info/29/501993.aspx

0 Response to "Invalid or Corrupt File Cannot Read at"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel