Hier zit ik dus mee, het lukt gewoon niet.
Heel simpele programmaatje:
Als ik het compileer met g++ dan werkt het niet, en het maakt hem helemaal niks uit wat ik als -L aan libraries aan toevoeg:
Maar met gcc doet ie het wel, zelfs zonder -L
:
Alhoewel al een wat meer ingewikkeld programma het ook niet doet:
Wat doe ik nou fout, en wat moet ik misschien installeren?
Ik heb een /usr/lib directory met daar alle benodigde files.
Heel simpele programmaatje:
code:
1
2
3
| int main() {
return 0;
} |
Als ik het compileer met g++ dan werkt het niet, en het maakt hem helemaal niks uit wat ik als -L aan libraries aan toevoeg:
code:
1
2
3
4
5
| darkvater@arrakis:/tmp/> g++ -m32 test.cc -L/usr/lib -o test /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.2.1/libstdc++.so when searching for -lstdc++ /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.2.1/libstdc++.a when searching for -lstdc++ /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status |
Maar met gcc doet ie het wel, zelfs zonder -L
code:
1
2
3
| Darkvater@arrakis:/tmp/> gcc -m32 test.cc -L/usr/lib -o test Darkvater@arrakis:/tmp/> file test test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), not stripped |
Alhoewel al een wat meer ingewikkeld programma het ook niet doet:
code:
1
2
3
4
5
6
| #include <stdio.h>
int main() {
printf("Hello World!\n");
return 0;
} |
code:
1
2
3
4
5
| Darkvater@arrakis:/tmp/> gcc -m32 test.cc -L/usr/lib -lstdc++ -o test /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.2.1/libstdc++.so when searching for -lstdc++ /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.2.1/libstdc++.a when searching for -lstdc++ /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status |
Wat doe ik nou fout, en wat moet ik misschien installeren?
Ik heb een /usr/lib directory met daar alle benodigde files.
[ Voor 24% gewijzigd door Darkvater op 09-11-2007 01:10 ]
Windows Vista? *NEVER* Het waarom - Opera forever!!!
I've seen chickens that were more menacing. Chickens in a coma. On ice. In my fridge