LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble Using Old obj files in new version of LabWindows/CVI

  • I have LabWindows/CVI 2010 and was trying to load external modules (.obj) created in LabWindows 4.0
  • I've had success recompiling the old code into new obj. files and they seem to work correctly
  • The problem is with one piece of code of which I don't have the source code, so I only have .obj file created from LabWindows 4.0.  It doesn't seem to load correctly

 

Is there some kind of compatibility option I can use to load .obj files created from an older version of LabWindows (in this case 4.0) ?

 

 

0 Kudos
Message 1 of 7
(3,118 Views)

Hi seanmu13,

 

I just tested it myself, and I had no trouble using an object file created using CVI 4.0 for Visual C/C++.  Do you know what compiler this object file was created for?  I believe 4.0 is capable of creating .obj files for msvc, borland, symantec, and watcom so it may have been created for one of these.  Is there a specific error message you received?

Justin D
Applications Engineer
National Instruments
http://www.ni.com/support/
0 Kudos
Message 2 of 7
(3,108 Views)

I'm not sure what compiler was used for this object file, but I'm starting to believe it's a DLL file being referenced that is giving us trouble.  The specific error is while calling RunExternalModule.  I get an error return code of -5 (Undefined References), although I'm not sure what that means for my program.

0 Kudos
Message 3 of 7
(3,095 Views)

Hi seanmu13,

 

So you are actually getting the program to compile and run and it errors out during runtime?  This indicates that you are using the proper compiler, but you may be correct about it not being able to find a DLL import LIB or another OBJ that is trying to be loaded.

Justin D
Applications Engineer
National Instruments
http://www.ni.com/support/
0 Kudos
Message 4 of 7
(3,092 Views)

Yes, that is correct, the program compiles but throws an error during runtime.

0 Kudos
Message 5 of 7
(3,086 Views)

Hi seanmu13,

 

It does indeed sound like that OBJ is trying to load and call an external module.  Without the source code, it makes figuring out what it is trying to load a bit tricky.  You may be able to attach an external debugger to the process to see what resource it is trying to load.  I am not sure how extensive this piece of code is, but you may be better off rewriting this portion.

Justin D
Applications Engineer
National Instruments
http://www.ni.com/support/
0 Kudos
Message 6 of 7
(3,081 Views)

You could try calling GetExternalModuleAddrEx before calling RunExternalModule. That function allows you to pass in a buffer that is filled with the names of any unresolved symbols. You'll have to pass GetExternalModuleAddrEx the name of an external symbol in the module; you should be able to pass _foo_entry_point (if the file were named FOO.obj).

 

Mert

0 Kudos
Message 7 of 7
(3,050 Views)