• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home » Resolved: Why do I get an undefined reference although everything seems alright ? (C++ Mingw)

Resolved: Why do I get an undefined reference although everything seems alright ? (C++ Mingw)

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

My problem is fairly trivial and simple, I am trying to write a packer and to do so I need to parse PE files, so I’m trying to use the C++ pe-parse library.
I built it following the instructions and I’m now trying to link it to my simple main.cpp file:
Here is my file structure:
MinGW is indeed x64 (x86_64-w64-mingw32) and my libraries also (pei-x86-64 for both pe-parse.dll and pe-parse.lib)
When I run
from root, I get the following linking error:
When I run nm on pe-parse.lib I am able to find the symbol. pe-parse.dll does not contain any, and I tried to to replace -L.\bin\ with -L.\lib\
Any ideas ? I believe the .lib is an import library that has to be linked with the .dll, but I can’t find a way to.
Thank you.

Answer:

You have a library produced by MSVC and you are trying to use g++ to link with it.
Microsoft C++ compiler is not compatible with g++. Objects produced by one of them cannot use objects compiled by the other. They use vastly different ABIs and different standard library implementations.
Your only option is to recompile everything with one compiler.

If you have better answer, please add a comment about this, thank you!

c++ g++ portable-executable
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: PostgreSQL resample 1 minute OHLCV candle data into 5 minute OHLCV candle data

27/03/2023

Resolved: How do I navigate a table without any easily accessible distinctions?

27/03/2023

Resolved: Can a pod make itself unavailable temporarily in kubernetes?

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.