How to compile a gen gcc generated c file?

Windows specific questions.
taijinantangXX
Posts: 13
Joined: Dec 19, 2014 5:29

How to compile a gen gcc generated c file?

Postby taijinantangXX » Dec 19, 2014 6:22

I saw fbc has an option called gen gcc.
I use this: -gen gcc -r to get a .c file.
But when compiling with gcc, it reports a lot of errors.

My question is that : can the -gen gcc -r generated .c file be compiled with normal gcc?
dkl
Site Admin
Posts: 3209
Joined: Jul 28, 2005 14:45
Location: Germany

Re: How to compile a gen gcc generated c file?

Postby dkl » Dec 19, 2014 22:51

What kind of errors do you get? Linker errors (undefined references)? In that case, don't forget to link the needed libraries, especially libfb.

gcc C:/FreeBASIC/lib/win32/fbrt0.o program.c -LC:/FreeBASIC/lib/win32 -lfb ...


You can also take a look at the linker options used by fbc to get more information:
fbc program.bas -v
marcov
Posts: 2762
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: How to compile a gen gcc generated c file?

Postby marcov » Dec 20, 2014 13:14

Does your gcc match your FB compiler architecture wise? (both 32-bit or both 64-bit?)

Return to “Windows”

Who is online

Users browsing this forum: Baidu [Spider] and 37 guests