Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

unknown character error C2018

Hi,

 

I have problems running examples of USB 6009 (examples ANSI C) in Visual Studios c++,  2008 (6.0). I have included the NIDAQmx.h file and given path, the same for the libary NIDAQmx.lib. In the beginnig I had problems with recieving for both the .h and library -file  "permission  denied".

But I think I managed to overcome this, since now it seems like it finds problems in the library file, this must mean that it can open the library-file right?

 

However,  now I recieve another error instead.. It says that "error C2018: unknown character .." in the library file. How can I solve this problem?

 

This is what I include in my .cpp file: 

 

 

#include "stdafx.h"
#include <NIDAQmx.lib>
#include <stdio.h>
#include "NIDAQmx.h"

 

This is what I recieve: 

 

1>------ Build started: Project: T_win32consoleapplication, Configuration: Release Win32 ------
1>Compiling...
1>stdafx.cpp
1>C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc\NIDAQmx.lib(1) : error C2059: syntax error : '<'
1>C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc\NIDAQmx.lib(2) : error C2018: unknown character '0x60'
1>C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc\NIDAQmx.lib(3) : error C2018: unknown character '0x11'
1>C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc\NIDAQmx.lib(3) : error C2018: unknown character '0x5'
1>C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc\NIDAQmx.lib(3) : error C2018: unknown character '0x5'
1>C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc\NIDAQmx.lib(3) : error C2018: unknown character '0x2'
1>C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc\NIDAQmx.lib(3) : error C2018: unknown character '0x5'

and so on...

 

I would really appriciate help!

 

Thanks,

 

Hanna 

0 Kudos
Message 1 of 11
(6,850 Views)

I hope this link will help you out. Post back.

 

Mathan

0 Kudos
Message 2 of 11
(6,846 Views)

Hi,

 

Everything works now! It was due to my lack of experience in programming..

 

I looked at the link and after considering the answer. I worked out that I needed to put in the adresses of the files I wanted to include in the project, by Tools -> Options, not only include the .h file in top of the .cpp-file. Then also the libery needed to be in the project cataloge... Ok, now it all works. I learn..

 

Thanks a lot!

 

 // Hanna

Message 3 of 11
(6,829 Views)

Thanks for sharing that. Could you please mark the post which you think is the solution? This will definitely help the people in the future who are facing same kind of problem.

 

Thanks,

Mathan

0 Kudos
Message 4 of 11
(6,827 Views)
Why are you using 2 diff ids?
0 Kudos
Message 5 of 11
(6,823 Views)

The problem is solved by adding the adresses of the library and NIDAQmx.h files in the Visual Studios.

 

You do this by clicking Tools -> Options and then adding the adresses of the files you want to include in your project.

 

To be able to mark this as a solution I need a Solution? and I cannot find one, how do I do this?

 

Sorry for this but I am really a beginner.

 

Regards,

 

Hanna

 

 

0 Kudos
Message 6 of 11
(6,754 Views)

Hi Hanna

 

If you started a thread you should see a green button to the right, just below the kudos button in every post in that thread. It says "Solution?" and looks like this:

solution.PNG 

 

If you think a post solved your problem press it and the thread will be marked as Solved, which helps others with similar problems since they know this thread contains a solution.

 

Best Regards

 

David

NISW

0 Kudos
Message 7 of 11
(6,722 Views)

Something is wrong with this thread, maybe? I do not see any "solution?" below the "kudos". I have another thread where I can see this "solution?" so I have seen how it should look now. The solution is given above, where I describe how to add the adresses to VS.

 

Kind Regards,

 

Hanna

0 Kudos
Message 8 of 11
(6,719 Views)

Hi Hanna

 

Maybe you started the thread with a different accout? The top post is by hanna_ellis and your current account is hellis. That would explain why you can't see the solution button.

 

Best Regards

 

David

0 Kudos
Message 9 of 11
(6,717 Views)

Yes, this must be it. I do not know now, but I may think that I happened to write my thread on a work mate`s account..

0 Kudos
Message 10 of 11
(6,709 Views)