Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, May 2007
How can i use C-Source code in Qt application


Message 1 in thread

hi to all,
            Iam having to set of C-source code(.c,.h file), i want to include those files to my qt project.How can i do that one.i am using the Visual Studio .Net Editor to write and compile my appliction.

D. Anil kumar

Every success has a story of great failure.
So don't stop with failure where
Success comes after failure.

Message 2 in thread

What is stoping you from using C-source code in a QT project ?
After all Qt is a C++ toolkit, so it will be same as using C code with
any c++ libraries and code base.
I am not sure if it is a QT problem.
 
 
--Prateek
 
________________________________

From: anil kumar [mailto:d.anil@xxxxxxxxxxxxx] 
Sent: Monday, May 07, 2007 12:07 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: How can i use C-Source code in Qt application



	hi to all,
	            Iam having to set of C-source code(.c,.h file), i
want to include those files to my qt project.How can i do that one.i am
using the Visual Studio .Net Editor to write and compile my appliction.
	 
	D. Anil kumar
	 
	Every success has a story of great failure.
	So don't stop with failure where
	Success comes after failure.
	


Message 3 in thread

In c++ standard in your .h files you need to add:
#ifdef __cplusplus
extern "C" {
#endif

....

your all .h content

....

#ifdef __cplusplus
}
#endif

I do not know if Visual studio do not support such a mechanism.

Regards





Alle 08:36, lunedÃÂ 7 maggio 2007, anil kumar ha scritto:
> hi to all,
>             Iam having to set of C-source code(.c,.h file), i want to
> include those files to my qt project.How can i do that one.i am using the
> Visual Studio .Net Editor to write and compile my appliction.
>
> D. Anil kumar
>
> Every success has a story of great failure.
> So don't stop with failure where
> Success comes after failure.

-- 
 [ signature omitted ] 
Message 4 in thread

Just include them in your project.
Compile and link.
Just add the following in your header file:

#ifdef __cplusplus
extern "C"
{
#endif

///your decleration here

#ifdef __cplusplus
}
#endif

anil kumar wrote:
> hi to all,
>             Iam having to set of C-source code(.c,.h file), i want to
> include those files to my qt project.How can i do that one.i am using
> the Visual Studio .Net Editor to write and compile my appliction.
>  
> D. Anil kumar
>  
> Every success has a story of great failure.
> So donât stop with failure where
> Success comes after failure.

--
 [ signature omitted ]