Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linker input file unused because linking not done #333

Open
spfhi opened this issue Jun 6, 2017 · 3 comments
Open

linker input file unused because linking not done #333

spfhi opened this issue Jun 6, 2017 · 3 comments

Comments

@spfhi
Copy link

spfhi commented Jun 6, 2017

in extension.cpp I need to invoke a xx.a static library.

when I execute make,I met this error:
g++ -Wall -c -I. -I/data/yangrenqiang/vad_php_cpp/vad/lib/ -O2 -std=c++11 -fpic -o vad.o vad.cpp vad.a
g++: warning: vad.a: linker input file unused because linking not done

if you kown how to import static library vad.a,please tell me.

thanks.

@sjinks
Copy link
Contributor

sjinks commented Jun 6, 2017

g++ -c means "compile the source file". If you meant to link it, consider removing -c from the command line.

@spfhi
Copy link
Author

spfhi commented Jun 7, 2017

But if I remove -c,It will report error like this:

vad.cpp:(.text+0xd4): undefined reference to Php::Namespace::add(char const*, Php::Value (* const&)(Php::Parameters&), std::initializer_listPhp::Argument const&)'
vad.cpp:(.text+0xea): undefined reference to Php::Extension::module()' vad.cpp:(.text+0x113): undefined reference to Php::Extension::Extension(char const*, char const*, int)'
vad.cpp:(.text+0x126): undefined reference to Php::Extension::~Extension()'

Because I need invoke some function of a static library(xxx.a) in vad.cpp which is extension's file.So I don't know how to do?

@Prasaddiwalkar
Copy link

@Renqiangme Did you figure out the solution for this issue?

I am also facing same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants