Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #10769 > unrolled thread

find c files within c++ project

Started byahso <ahso47@yahoo.com>
First post2011-10-10 04:04 -0700
Last post2011-10-11 06:04 +0000
Articles 6 — 5 participants

Back to article view | Back to comp.lang.c++


Contents

  find c files within c++ project ahso <ahso47@yahoo.com> - 2011-10-10 04:04 -0700
    Re: find c files within c++ project Marcel Müller <news.5.maazl@spamgourmet.org> - 2011-10-10 13:29 +0200
    Re: find c files within c++ project Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-10-10 13:38 +0000
      Re: find c files within c++ project ahso <ahso47@yahoo.com> - 2011-10-10 09:19 -0700
    Re: find c files within c++ project Nobody <nobody@nowhere.com> - 2011-10-10 18:05 +0100
      Re: find c files within c++ project Juha Nieminen <nospam@thanks.invalid> - 2011-10-11 06:04 +0000

#10769 — find c files within c++ project

Fromahso <ahso47@yahoo.com>
Date2011-10-10 04:04 -0700
Subjectfind c files within c++ project
Message-ID<5bce53f2-fedb-43fa-a96d-88e88fd8fd3f@h10g2000yqd.googlegroups.com>
Hi
I get tons of: undefined references so i suspect to have
some c header files which need: extern "C"
So how can I find those? Or can i put this in every header?
Thanks

[toc] | [next] | [standalone]


#10770

FromMarcel Müller <news.5.maazl@spamgourmet.org>
Date2011-10-10 13:29 +0200
Message-ID<4e92d736$0$7626$9b4e6d93@newsspool1.arcor-online.net>
In reply to#10769
On 10.10.11 13.04, ahso wrote:
> I get tons of: undefined references so i suspect to have
> some c header files which need: extern "C"

Are you sure?

> So how can I find those? Or can i put this in every header?
> Thanks

Tracking a few examples of your undefined symbols to their root will be 
more helpful than firing haphazardly with the shotgun on header files.

The extern "C" C++ guards are useful if and only if C code sould be used 
within C++ code.


Marcel

[toc] | [prev] | [next] | [standalone]


#10772

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2011-10-10 13:38 +0000
Message-ID<slrnj95tao.1bk.grahn+nntp@frailea.sa.invalid>
In reply to#10769
On Mon, 2011-10-10, ahso wrote:
> Hi
> I get tons of: undefined references so i suspect to have
> some c header files which need: extern "C"
> So how can I find those?

They are only C header files if their implementation is compiled
as C code rather than C++. Surely your Makefile (or whatever you use
for a build system) can tell you what it compiles and how.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#10775

Fromahso <ahso47@yahoo.com>
Date2011-10-10 09:19 -0700
Message-ID<f19ae123-2da5-4de5-8d46-b726d540784c@x19g2000vbl.googlegroups.com>
In reply to#10772
    LIBS += -llua -lBulletDynamics -lBulletCollision -lLinearMath -
lcurl -lopenal -lalut

Those are the Qtcreator libs. ~400 undefined references errors so
something very basic is very wrong.
Nobody can help how to approach such?

[toc] | [prev] | [next] | [standalone]


#10777

FromNobody <nobody@nowhere.com>
Date2011-10-10 18:05 +0100
Message-ID<pan.2011.10.10.17.05.09.192000@nowhere.com>
In reply to#10769
On Mon, 10 Oct 2011 04:04:00 -0700, ahso wrote:

> I get tons of: undefined references so i suspect to have
> some c header files which need: extern "C"
> So how can I find those? Or can i put this in every header?

If you're including C headers which don't have the C++ "guards", then you
can do:

	extern "C" {
	#include <foo.h>
	}

This usually works, but there are things which can appear in a C header
which make it invalid as C++ (e.g. use of C++-specific keywords as
identifiers).

[toc] | [prev] | [next] | [standalone]


#10787

FromJuha Nieminen <nospam@thanks.invalid>
Date2011-10-11 06:04 +0000
Message-ID<4e93dc62$0$2827$7b1e8fa0@news.nbl.fi>
In reply to#10777
Nobody <nobody@nowhere.com> wrote:
> On Mon, 10 Oct 2011 04:04:00 -0700, ahso wrote:
> 
>> I get tons of: undefined references so i suspect to have
>> some c header files which need: extern "C"
>> So how can I find those? Or can i put this in every header?
> 
> If you're including C headers which don't have the C++ "guards", then you
> can do:
> 
>        extern "C" {
>        #include <foo.h>
>        }

  That's such a "Paulish" answer that I'm pretty sure you are him.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web