LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent type declarations linker error

I've got a project that compiles and links fine in Visual C 6.0 and several GCC versions but gives me this weird error when compiling in CVI 8.0.1.
 
The weird thing is that the errors are all related to functions either implemented in deflate.c or used therein. I know that the function declaration is a bit strange but this is because it is the zlib sources which were written to be compilable in just about every C compiler out there even those not even supporting C89 standard.
 
Anyhow for all I can do, I'can't find what is causing the issue. All functions should use the same prototype for the declaration and the implementation so this baffles me.
 
The reason I wanted to compile and link this library with CVI was to checkout compatibility with Pharlap realtime targets. The Visual C build obviously works just fine for me for normal LabVIEW for Windows.
 
Rolf Kalbermatter


Message Edited by rolfk on 12-10-2007 10:56 AM
Rolf Kalbermatter
My Blog
0 Kudos
Message 1 of 6
(4,201 Views)
It's been a few years since I last compiled zlib on CVI, but from what I
remember, I had to declare some defines at the compiler level in order to
make it compile (/Dsomething).
--
Guillaume Dargaud
http://www.gdargaud.net/


0 Kudos
Message 2 of 6
(4,188 Views)


Guillaume Dargaud wrote:
It's been a few years since I last compiled zlib on CVI, but from what I
remember, I had to declare some defines at the compiler level in order to
make it compile (/Dsomething).
--
Guillaume Dargaud
http://www.gdargaud.net/




I know, CVI does not provide vsnprintf so defining NO_vsnprintf will make the library use vsprintf instead. And with that compiling is not a problem anymore. What doesn't work is linking. It complains abouit above error at the linking step and that after having compiled all the involved source files itself. The declaration of the functions is all done in header files and those header files included in the relevant source files so the declaration should be consistent. But somehow CVI messes up when compiling deflate.c using something different for the functions in that file compared to other module files, both for those implemented in that object module and those used in it, implemented somewhere else.
 
I can't figure out what the actual problem could be, especially since those source files are all compiled in the same run and by CVI.
 
Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 6
(4,184 Views)


Guillaume Dargaud wrote:
It's been a few years since I last compiled zlib on CVI, but from what I
remember, I had to declare some defines at the compiler level in order to
make it compile (/Dsomething).
--
Guillaume Dargaud
http://www.gdargaud.net/




I know, CVI does not provide vsnprintf so defining NO_vsnprintf will make the library use vsprintf instead. And with that compiling is not a problem anymore. What doesn't work is linking. It complains abouit above error at the linking step and that after having compiled all the involved source files itself. The declaration of the functions is all done in header files and those header files included in the relevant source files so the declaration should be consistent. But somehow CVI messes up when compiling deflate.c using something different for the functions in that file compared to other module files, both for fiunctions implemented in that object module and those used in it, implemented somewhere else.
 
I can't figure out what the actual problem could be, especially since those source files are all compiled in the same run and by CVI.
 
Rolf Kalbermatter


Message Edited by rolfk on 12-10-2007 05:07 PM
Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 6
(4,184 Views)

Hi Rolf,

I've asked our experts to take a look at your code. It is a compiler define that CVI does not defined by default. wher VC probably does. We are missing the /DNO_DUMMY_DECL define.

Add this to the Compiler Defines in the Build Options dialog and this should get rid of the inconsistent type declarations errors.

Hope this helps

Thanks

Karsten

Message 5 of 6
(4,050 Views)


@KvZ wrote:

Hi Rolf,

I've asked our experts to take a look at your code. It is a compiler define that CVI does not defined by default. wher VC probably does. We are missing the /DNO_DUMMY_DECL define.

Add this to the Compiler Defines in the Build Options dialog and this should get rid of the inconsistent type declarations errors.

Hope this helps

Thanks

Karsten



Hmm, thanks a lot. This seems to have fixed that issue.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 6
(4,038 Views)