LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > eljuventino
User Name
Password

Notices


Rate this Entry

compiling with pro*c in linux

Posted 08-05-2009 at 03:04 AM by eljuventino

Quote:
Originally Posted by johnsfine View Post
It appears that some of the code you are trying to compile is C++ code in files with .c extensions.

That explains why you had a problem with bool which is built into C++ but can't be used in C without having a typedef for it. It also explains why you have a failure with extern "C" which is valid C++ code but meaningless in C.

That CODE=CPP thing sounds like it is intended to deal with that (tell the compiler to ignore the .c extension and process C++ code). But I've never heard of CODE=CPP so I don't know how it should be used and I didn't understand your description of how you did use it.

If it removed the errors with bool then it partially worked. If it didn't remove the error with extern "C" then it didn't completely work, because that is more of the same error. The code is C++ but the compiler was expecting C.

With GCC there are a few ways to force the compiler to process C++ code ignoring the .c extensions. If you are in control of the compile command lines, that may be a simple answer. But I get the idea the compile command lines are put together for you by a complicated makefile. In that case, it may be harder to figure out what to change in order to cause the makefile to generate the compile commands that cause gcc to process C++ code.

I don't speak any French, which makes it a little harder to read your posts, but your posts would be very hard to read even if they were 100% English. Code tags would help. But mainly you need a bit more and better explanation of what you're trying to accomplish and what exactly you did.


I see only compile time errors that certainly don't mean anything like that. So I have no idea where you're seeing that.



Yes, but extern "C" means something else (in addition to or instead of meaning defined elsewhere).

It can be used in C++ code to declare C code defined elsewhere so that C code may be called by this C++ code.
It can also be used to define C++ code (defined here) which presents a C interface so it can be called by C code elsewhere and/or called by other C++ that thinks it is calling C code.


thanks a lot of your help and a good explanation!!CODE=CPP i use it in the pro*c line of precompilation!!know i use this solution and i do some modification that can put away the error related to extern "C" biut i'm afraid that not the correct solution and after that in the execution all goes wrong!!
Posted in Uncategorized
Views 1084 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 01:35 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration