Solved

Error LNK1136

Posted on 2002-06-20
14
516 Views
Last Modified: 2012-05-04
Hello,
I am trying to expose some funcionality of a 'Normal' DLL into a COM DLL in VC++ 6.0.
When I try to compile, I get the fatal error LNK1136: invalid or corrupt file. But in other projects no COM the 'Normal' dll works well.
Some ideas??


0
Comment
Question by:cero
  • 4
  • 4
  • 3
  • +2
14 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 7096134
That's what MSDN says:

Corrupt Object File
Sometimes the linker is unable to process your object files because they are corrupt. Besides the usual causes of corrupt files such as network problems or exposing a floppy disk to a magnetic field, sometimes the compiler writes an incorrect object file, which you should report to Microsoft Product Support Services. See the Technical Support command on the Help menu for more information.

After you have ruled out a hardware, operating system, or network problem as the cause of the corrupt object file, you should try the tips below because sometimes by changing compiler options and recompiling, the compiler will write a non-corrupt object file.

Here are some things to try when recompiling:

Turn off optimization with the /Od (Disable) option.


Disable incremental compilation with the /Gi– (Enable Incremental Compilation) option.


Disable minimal rebuild with the /Gm– (Enable Minimal Rebuild) option.


Compile with the /Gy (Enable Function-Level Linking) option to package functions.


Use a different code generation option. See the /G (Optimize for Processor) options.


Change the order of functions and global variables.



Do you have SP5 installed?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7099625
>> But in other projects no COM the 'Normal' dll works well.

The DLL is not at issue.  This problem is related to the .LIB file.  Delete it and rebuild the DLL to create a new .LIB file.  Make sure that the COM program is accessing the correct .LIB file (e.g., there could be a good one in one directory and an corrupt one in another directory.  Do a whole-disk search for the name of that file.)

-- Dan
0
 
LVL 2

Expert Comment

by:venkaiah
ID: 7101590
Hi friend.
what the  DanRollins says .it is right follow that
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7102233
venkaiah makes a good point there ;-).  -- Dan
0
 
LVL 2

Author Comment

by:cero
ID: 7109279
Ok. I solve the problem. I have another problem.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7109292
good news, cero!
Which expert here helped you to solve the problem?

-- Dan
0
 
LVL 2

Author Comment

by:cero
ID: 7111992
Thats the problem. All of you give me good ideas (I had read before many ideas you posted here).
I don't know what thing solve the problem, I create another project and it works!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 49

Expert Comment

by:DanRollins
ID: 7112126
If you want to split the points between two or more experts, please do this:

Post a new 0-pt Question to Community Support here's a quick link):

       http://www.experts-exchange.com/jsp/qAskQuestion.jsp?ta=commspt

In the question, mention which experts deserve points.  Here are the names of the experts who made salient comments:

      jkr
      DanRollins

And be sure to provide this question ID:

      Q_20314296

-- Dan
0
 
LVL 2

Author Comment

by:cero
ID: 7116375
OK. I do it, but what can I do with this question?

Cero
0
 
LVL 2

Author Comment

by:cero
ID: 7116899
And Next, how delete this question .
0
 

Expert Comment

by:ComTech
ID: 7117021
Hello all, a request of points split, I will now reduce the question of 500 to 250 to allow for the split.

jkr will be accepted here at the question, I will create a new question for DanRollins in this Topic Area for the same amount of points.

cero, thanks for visiting Experts-Exchange

ComTech,
Community Support
Administrator @ EE
0
 

Expert Comment

by:ComTech
ID: 7117040
Hello Dan, your points are here: http://www.experts-exchange.com/admin/adminManageQuestion.jsp?qid=20317507

Thanks all,

CT
0
 
LVL 86

Expert Comment

by:jkr
ID: 7117048
Thank you!
0
 

Expert Comment

by:ComTech
ID: 7117254
Address change for DanRollins

CT : >
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now