Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8394965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:11:03+00:00 2026-06-09T20:11:03+00:00

I am using RHEL 6 and trying to compile some code using SWIG. The

  • 0

I am using RHEL 6 and trying to compile some code using SWIG.

The SWIG file is named mySwig.i and looks like

   %module base_module
   %{
     #include "base.h"
   %}
   %include "base.h"

The mySwig.i file is kept in a folder named foo. The folder foo also has other .h, .c and .cxx files.

The command I use is

    gcc -fpic -c foo/*

The output is:

    foo/mySwig.i:1 error: expected identifier or '(' before '%' token
    foo/mySwig.i:3 error: stray '#' in program
    foo/mySwig.i:5 error: expected identifier or '(' before '%' token

Does anyone have any ideas how to resolve these errors?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:11:05+00:00Added an answer on June 9, 2026 at 8:11 pm

    gcc -fpic -c foo/* will match all files in the directory foo/. You only want to match C files most likely. You can do what with gcc -fpic -c foo/*.c if you really want.

    Personally I’d recommend using something like CMake or Autotools, or even just a Makefile to build your project rather than calling cc directly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to compile a code written using CUDA 3.2 on RHEL 5.6. The
I'm using RHEL 5.3 (linux 2.6.18) I have a legacy code that relies on
I am trying to create a jar using the following command on a RHEL
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
I'm trying to update a PHP module using yum, but am getting an error.
I am using RHEL 4 i am using syscall stat as follows:- if (stat
I am using mono 2.10.2 to run a .Net application on RHEL 5. The
I'm using RHEL 5.3, shipped with gcc 4.1.2 and boost 1.33. So, there's no
Environment: RHEL 5 servers, MySQL 5.1.43, PHP 5.1.6 (using MySQLi). Currently only available within
I've built a ZF app using 1.10 for deployment on RHEL server in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.