0

I built a static library (.lib) with VS2012. I wrote a test program by including my header and then tried to link it with the .lib file with g++

g++ Test.cpp Gray.lib -o test.exe

(All files are in the same directory)

And I'm getting undefined reference to errors on functions in my library. What do I do? I already searched for many answers, those didn't help.

1
  • Name decoration is different between the compilers you are using. Commented Apr 27, 2013 at 4:41

1 Answer 1

1

You cannot do that without resorting to hacks, because name mangling is different between compilers you want to use. The most straigforward way is to complile your library for g++ natively.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.