Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 349 Vote(s) - 3.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a when searching for -lstdc++ /usr/bin/ld: cannot find -lstdc++

#1
why am i getting this error?

```
g++ -m32 func.o test.o -o prgram

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
```

my code is as follows:
```
#include<stdio.h>
2
3
4 extern "C" int calcsum(int a, int b, int c);
5
6 int main(int argc,char* argv[])
7 {
8 int a = 10;
9 int b = 20;
10 int c = 30;
11 int sum = calcsum(a,b,c);
12
13 printf("a: %d", a);
14 printf("b: %d", b);
15 printf("c: %d", c);
16 printf("sum: %d", sum);
17 return 0;
18 }
19
```
```
1 section .text
2 global _start
3 _start:
4 global _calcsum
5 _calcsum:
6
7 push ebp
8 mov ebp, esp
9
10 mov eax, [ebp+8]
11 mov ecx, [ebp+12]
12 mov edx, [ebp+16]
13
14 add eax, ecx
15 add eax, edx
16
17 pop ebp
18 ret
```
Reply

#2
You are building a 32-bit binary on a 64-bit system (because you used the `-m32` flag), but have not installed 32-bit versions of the development libraries.

If you're on Ubuntu, try:

sudo apt install gcc-multilib g++-multilib libc6-dev-i386

As for your assembly file, it can't work as-is. `start` will be defined by the cpp file, so remove it from the asm file. Next, remove the underscore from `_calcsum`. When building ELF binaries, function names do not start with an underscore:

```
section .text
global calcsum
calcsum:

push ebp
mov ebp, esp

mov eax, [ebp+8]
mov ecx, [ebp+12]
mov edx, [ebp+16]

add eax, ecx
add eax, edx

pop ebp
ret
```

Build that as a 32-bit ELF object file with:

nasm -felf32 func.s -o func.o
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through